diff --git a/Directory.Build.props b/Directory.Build.props index b1ac2559f9ed1..ef0e8c1b44d76 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -397,12 +397,10 @@ true true - true - true - true + true - false + false @@ -413,7 +411,7 @@ '$(IsReferenceAssemblyProject)' != 'true' and '$(IsGeneratorProject)' != 'true' and '$(IsTestProject)' != 'true' and - '$(IsPublishedAppTestProject)' != 'true' and + '$(IsTrimmingTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(UsingMicrosoftDotNetSharedFrameworkSdk)' != 'true' and '$(MSBuildProjectExtension)' != '.pkgproj' and @@ -464,7 +462,7 @@ - + true diff --git a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml index 94761028f48ab..bc29a657c456c 100644 --- a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml +++ b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml @@ -21,11 +21,3 @@ steps: nativeAotTest: true helixQueues: ${{ parameters.helixQueues }} liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} - - # Can't run arm/arm64 tests on x64 build machines - - ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: - - # Publishing tooling doesn't support different configs between runtime and libs, so only run tests in Release config - - ${{ if eq(parameters.buildConfig, 'release') }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) $(_nativeSanitizersArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} - displayName: Run NativeAot Library Tests diff --git a/eng/pipelines/libraries/execute-trimming-tests-steps.yml b/eng/pipelines/libraries/execute-trimming-tests-steps.yml index 567abab0bb984..13778ee0ab63a 100644 --- a/eng/pipelines/libraries/execute-trimming-tests-steps.yml +++ b/eng/pipelines/libraries/execute-trimming-tests-steps.yml @@ -1,8 +1,14 @@ parameters: archType: '' extraTestArgs: '' + runAotTests: true steps: # Execute tests - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} displayName: Run Trimming Tests + + # Execute AOT test app tests + - ${{ if eq(parameters.runAotTests, true) }}: + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTestAppTests.binlog ${{ parameters.extraTestArgs }} + displayName: Run Native AOT Test App Tests diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index aec5e1057ac53..2b001b769f50f 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -135,3 +135,4 @@ extends: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml parameters: extraTestArgs: '/p:WasmBuildNative=false' + runAotTests: false diff --git a/eng/testing/linker/SupportFiles/Directory.Build.props b/eng/testing/linker/SupportFiles/Directory.Build.props index 5a54c83e56923..4e33801ab1283 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.props +++ b/eng/testing/linker/SupportFiles/Directory.Build.props @@ -11,6 +11,7 @@ false true + true $(NoWarn);IL2121 diff --git a/eng/testing/linker/trimmingTests.props b/eng/testing/linker/trimmingTests.props index b917cd5fe3826..b822294a93d04 100644 --- a/eng/testing/linker/trimmingTests.props +++ b/eng/testing/linker/trimmingTests.props @@ -1,6 +1,8 @@ - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'trimmingTests')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'trimmingTests')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'aotTests')) + $([MSBuild]::NormalizeDirectory('$(TrimmingTestDir)', 'projects')) $(MSBuildThisFileDirectory)project.csproj.template true diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 926bafa52cfef..9ff325e82972c 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -81,6 +81,9 @@ <_additionalPropertiesString>@(_propertiesAsItems->'<%(Identity)>%(Value)</%(Identity)>', '%0a ') + + + + Properties="Configuration=$(Configuration);BuildProjectReferences=false;TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture);_IsPublishing=true" /> - + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index b219e7cf41a91..e3d599b2d8276 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -131,7 +131,7 @@ - + diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj deleted file mode 100644 index 8001203352b58..0000000000000 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/System.Diagnostics.DiagnosticSource.NativeAotTests.proj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/DiagnosticSourceEventSourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/DiagnosticSourceEventSourceTests.cs similarity index 100% rename from src/libraries/System.Diagnostics.DiagnosticSource/tests/NativeAotTests/DiagnosticSourceEventSourceTests.cs rename to src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/DiagnosticSourceEventSourceTests.cs diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj index ca9483e224ffb..919c0b7614b14 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TrimmingTests/System.Diagnostics.DiagnosticSource.proj @@ -2,6 +2,8 @@ + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 6406fca7b8cbf..145dcd12ee739 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -649,16 +649,23 @@ BuildInParallel="$(BuildTestInParallel)" /> + + + + + + + + + + + + - -