-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sourcegen #3880
base: main
Are you sure you want to change the base?
Update sourcegen #3880
Changes from 21 commits
cc0d3be
990d154
0969391
45cb700
acec139
b21bf50
2b6ee6c
8294a2d
b546d0c
0f8c9cb
c4a2bb8
2520e34
0b651fa
91414af
e89c7d3
b0ead66
e298e0a
def4e8b
ad94d29
88ff2bc
9477851
873bd97
5e41dba
430bb08
31001ac
ce4198b
04f6470
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -21,9 +21,9 @@ | |||||
<Uri>https://github.com/microsoft/testanywhere</Uri> | ||||||
<Sha>4d80102c4530845265843db1454a4abda4128ba2</Sha> | ||||||
</Dependency> | ||||||
<Dependency Name="MSTest.Engine" Version="1.0.0-alpha.24473.2"> | ||||||
<Dependency Name="MSTest.SourceGeneration" Version="1.0.0-alpha.24555.1"> | ||||||
<Uri>https://github.com/microsoft/testanywhere</Uri> | ||||||
<Sha>aa2fcc8616d988b234bc1d218465b20c56d0b82f</Sha> | ||||||
<Sha>3c99c34d0f99de8dacfe909073722bd8ba45f2d8</Sha> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</Dependency> | ||||||
</ToolsetDependencies> | ||||||
</Dependencies> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,14 +3,14 @@ | |||||
<!-- MSTest version --> | ||||||
<VersionPrefix>3.7.0</VersionPrefix> | ||||||
Youssef1313 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<!-- Testing Platform version --> | ||||||
<TestingPlatformVersionPrefix>1.5.0</TestingPlatformVersionPrefix> | ||||||
<TestingPlatformVersionPrefix>1.6.0</TestingPlatformVersionPrefix> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to be reset
Suggested change
|
||||||
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel> | ||||||
</PropertyGroup> | ||||||
<PropertyGroup Label="MSTest prod dependencies - darc updated"> | ||||||
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>10.0.0-beta.24554.2</MicrosoftDotNetBuildTasksTemplatingPackageVersion> | ||||||
<MicrosoftTestingExtensionsCodeCoverageVersion>17.13.0-preview.24555.1</MicrosoftTestingExtensionsCodeCoverageVersion> | ||||||
<!-- comment to facilitate merge conflicts --> | ||||||
<MicrosoftTestingInternalFrameworkVersion>1.5.0-preview.24554.7</MicrosoftTestingInternalFrameworkVersion> | ||||||
<MSTestEngineVersion>1.0.0-alpha.24473.2</MSTestEngineVersion> | ||||||
<MSTestSourceGenerationVersion>1.0.0-alpha.24555.1</MSTestSourceGenerationVersion> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Syncing versions
Suggested change
|
||||||
</PropertyGroup> | ||||||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ | |
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; | ||
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; | ||
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; | ||
#if NET8_0_OR_GREATER | ||
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter; | ||
#endif | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting.Internal; | ||
|
@@ -300,8 +303,13 @@ private static bool DynamicDataAttached(UnitTestElement test, Lazy<TestMethodInf | |
return testMethodInfo.Value != null && TryProcessTestDataSourceTests(test, testMethodInfo.Value, tests); | ||
} | ||
|
||
[UnconditionalSuppressMessage("Aot", "IL3000:DoNotUseLocation", Justification = "Fixture tests are not supported in NativeAOT mode.")] | ||
|
||
private static void AddFixtureTests(TestMethodInfo testMethodInfo, List<UnitTestElement> tests, HashSet<string> fixtureTests) | ||
{ | ||
#if NET8_0_OR_GREATER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be |
||
ApplicationStateGuard.Ensure(System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported, "Fixture tests are not supported in NativeAOT mode."); | ||
#endif | ||
string assemblyName = testMethodInfo.Parent.Parent.Assembly.GetName().Name!; | ||
string assemblyLocation = testMethodInfo.Parent.Parent.Assembly.Location; | ||
string className = testMethodInfo.Parent.ClassType.Name; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,17 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting; | |
public static class TestingPlatformBuilderHook | ||
{ | ||
#pragma warning disable IDE0060 // Remove unused parameter | ||
public static void AddExtensions(ITestApplicationBuilder testApplicationBuilder, string[] arguments) => testApplicationBuilder.AddMSTest(() => [Assembly.GetEntryAssembly()!]); | ||
public static void AddExtensions(ITestApplicationBuilder testApplicationBuilder, string[] arguments) | ||
{ | ||
#if NET8_0_OR_GREATER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC it did not build with just netcoreapp, and net7 is out of life and rest of the platform used net8 so I used net8 |
||
if (!System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported) | ||
{ | ||
// We don't have a reliable way to get reference to the entry dll when compiled as NativeAOT. So instead we do the same registration | ||
// in source generator. | ||
return; | ||
} | ||
#endif | ||
testApplicationBuilder.AddMSTest(() => [Assembly.GetEntryAssembly()!]); | ||
} | ||
} | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ | |
|
||
<Import Project="$(MSBuildThisFileDirectory)Common.targets"/> | ||
|
||
<PropertyGroup Condition=" '$(IsTestApplication)' == 'true' "> | ||
<EnableMSTestRunner>true</EnableMSTestRunner> | ||
</PropertyGroup> | ||
|
||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? |
||
<Target Name="_MSTestSDKValidateFeatures" BeforeTargets="Build"> | ||
<Error Condition=" '$(EnableAspireTesting)' == 'true' " Text="Aspire MSTest currently doesn't support NativeAOT mode." /> | ||
<Error Condition=" '$(EnablePlaywright)' == 'true' " Text="Playwright MSTest currently doesn't support NativeAOT mode." /> | ||
|
@@ -15,14 +19,12 @@ | |
|
||
<!-- Core --> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Sdk="MSTest" | ||
Version="$(MicrosoftTestingPlatformVersion)" VersionOverride="$(MicrosoftTestingPlatformVersion)" /> | ||
<PackageReference Include="MSTest.TestFramework" Sdk="MSTest" | ||
Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" /> | ||
<PackageReference Include="MSTest.Engine" Sdk="MSTest" | ||
Version="$(MSTestEngineVersion)" VersionOverride="$(MSTestEngineVersion)" /> | ||
<PackageReference Include="MSTest.TestAdapter" Sdk="MSTest" | ||
Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" /> | ||
<PackageReference Include="MSTest.SourceGeneration" Sdk="MSTest" | ||
Version="$(MSTestEngineVersion)" VersionOverride="$(MSTestEngineVersion)" /> | ||
Version="$(MSTestSourceGenerationVersion)" VersionOverride="$(MSTestSourceGenerationVersion)" /> | ||
<!-- | ||
Most of the times this dependency is not required but we leave the opportunity to align the version of the platform being used. | ||
At the moment this is mainly used for our acceptance tests because the locally/CI built version ends with -dev or -ci which is | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's sync versions: