Skip to content

Commit ecbf05a

Browse files
authored
[tests] Add a 'nativeaot' test variation. (#23786)
1 parent 37da695 commit ecbf05a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/common/shared-dotnet.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<Project>
44
<!-- NativeLibName: the platform-specific subdirectory of tests/test-libraries/.libs where to get libraries with all the relevant architectures -->
55

6+
<Import Project="$(MSBuildThisFileDirectory)/test-variations.csproj" />
7+
68
<!-- Logic for iOS -->
79
<PropertyGroup Condition="$(TargetFramework.EndsWith('-ios'))">
810
<AssetTargetFallback>xamarinios10;$(AssetTargetFallback)</AssetTargetFallback>
@@ -98,7 +100,6 @@
98100

99101
<Import Project="$(MSBuildThisFileDirectory)/../ComputeRegistrarConstant.targets" />
100102
<Import Project="$(MSBuildThisFileDirectory)/../nunit.framework.targets" Condition="'$(ExcludeNUnitLiteReference)' != 'true'" />
101-
<Import Project="$(MSBuildThisFileDirectory)/test-variations.csproj" />
102103

103104
<Import Project="$(GeneratedProjectFile)" Condition="'$(GeneratedProjectFile)' != ''" />
104105

tests/common/test-variations.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<ItemGroup>
55
<TestVariations Include="interpreter" Description="Run with the interpreter ('UseInterpreter=true')" />
66
<TestVariations Include="bundle-original-resources" Description="Bundle original resources ('BundleOriginalResources=true')" />
7-
<TestVariations Include="do-not-bundle-original-resources" Description="Do not original resources ('BundleOriginalResources=false')" />
7+
<TestVariations Include="do-not-bundle-original-resources" Description="Do not bundle original resources ('BundleOriginalResources=false')" />
8+
<TestVariations Include="nativeaot" Description="Enable NativeAOT ('PublishAot=true' and '_IsPublishing=true')" />
89
</ItemGroup>
910

1011
<PropertyGroup Condition="'$(TestVariation)' == 'interpreter'">
@@ -19,6 +20,11 @@
1920
<BundleOriginalResources>false</BundleOriginalResources>
2021
</PropertyGroup>
2122

23+
<PropertyGroup Condition="'$(TestVariation)' == 'nativeaot'">
24+
<PublishAot>true</PublishAot>
25+
<_IsPublishing>true</_IsPublishing>
26+
</PropertyGroup>
27+
2228
<Target Name="ValidateTestVariation" Condition="'$(TestVariation)' != '' And '$(OutputType)' == 'exe'" BeforeTargets="Build">
2329
<ItemGroup>
2430
<_FilteredTestVariations Include="@(TestVariations)" Condition="'%(Identity)' == '$(TestVariation)'" />

0 commit comments

Comments
 (0)