|
2 | 2 | <!-- This file contains various test variations valid for all test projects + some supporting logic --> |
3 | 3 | <Project> |
4 | 4 | <ItemGroup> |
| 5 | + <TestVariations Include="debug" Description="Debug ('Configuration=Debug')" /> |
| 6 | + <TestVariations Include="release" Description="Release ('Configuration=Release')" /> |
5 | 7 | <TestVariations Include="interpreter" Description="Run with the interpreter ('UseInterpreter=true')" /> |
6 | 8 | <TestVariations Include="bundle-original-resources" Description="Bundle original resources ('BundleOriginalResources=true')" /> |
7 | 9 | <TestVariations Include="do-not-bundle-original-resources" Description="Do not bundle original resources ('BundleOriginalResources=false')" /> |
|
11 | 13 | <TestVariations Include="coreclr" Description="Use CoreCLR ('UseMonoRuntime=false')" /> |
12 | 14 | </ItemGroup> |
13 | 15 |
|
14 | | - <PropertyGroup Condition="'$(TestVariation)' == 'interpreter'"> |
| 16 | + <PropertyGroup> |
| 17 | + <_TestVariationForComparison>|$([System.String]::Join('|', $(TestVariation.Split('|', StringSplitOptions.RemoveEmptyEntries))))|</_TestVariationForComparison> |
| 18 | + </PropertyGroup> |
| 19 | + |
| 20 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|debug|'))"> |
| 21 | + <Configuration>Debug</Configuration> |
| 22 | + </PropertyGroup> |
| 23 | + |
| 24 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|release|'))"> |
| 25 | + <Configuration>Release</Configuration> |
| 26 | + </PropertyGroup> |
| 27 | + |
| 28 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|interpreter|'))"> |
15 | 29 | <UseInterpreter>true</UseInterpreter> |
16 | 30 | </PropertyGroup> |
17 | 31 |
|
18 | | - <PropertyGroup Condition="'$(TestVariation)' == 'nativeaot'"> |
| 32 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|nativeaot|'))"> |
19 | 33 | <PublishAot>true</PublishAot> |
20 | 34 | <_IsPublishing>true</_IsPublishing> |
21 | 35 | </PropertyGroup> |
22 | 36 |
|
23 | | - <PropertyGroup Condition="'$(TestVariation)' == 'linksdk'"> |
| 37 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|linksdk|'))"> |
24 | 38 | <MtouchLink>SdkOnly</MtouchLink> |
25 | 39 | <LinkMode>$(MtouchLink)</LinkMode> |
26 | 40 | </PropertyGroup> |
27 | 41 |
|
28 | | - <PropertyGroup Condition="'$(TestVariation)' == 'linkall'"> |
| 42 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|linkall|'))"> |
29 | 43 | <MtouchLink>Full</MtouchLink> |
30 | 44 | <LinkMode>$(MtouchLink)</LinkMode> |
31 | 45 | </PropertyGroup> |
32 | 46 |
|
33 | | - <PropertyGroup Condition="'$(TestVariation)' == 'bundle-original-resources'"> |
| 47 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|bundle-original-resources|'))"> |
34 | 48 | <BundleOriginalResources>true</BundleOriginalResources> |
35 | 49 | </PropertyGroup> |
36 | 50 |
|
37 | | - <PropertyGroup Condition="'$(TestVariation)' == 'do-not-bundle-original-resources'"> |
| 51 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|do-not-bundle-original-resources|'))"> |
38 | 52 | <BundleOriginalResources>false</BundleOriginalResources> |
39 | 53 | </PropertyGroup> |
40 | 54 |
|
41 | | - <PropertyGroup Condition="'$(TestVariation)' == 'nativeaot'"> |
| 55 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|nativeaot|'))"> |
42 | 56 | <PublishAot>true</PublishAot> |
43 | 57 | <_IsPublishing>true</_IsPublishing> |
44 | 58 | </PropertyGroup> |
45 | 59 |
|
46 | | - <PropertyGroup Condition="'$(TestVariation)' == 'coreclr'"> |
| 60 | + <PropertyGroup Condition="$(_TestVariationForComparison.Contains('|coreclr|'))"> |
47 | 61 | <UseMonoRuntime>false</UseMonoRuntime> |
48 | 62 | </PropertyGroup> |
49 | 63 |
|
50 | 64 | <Target Name="ValidateTestVariation" Condition="'$(TestVariation)' != '' And '$(OutputType)' == 'exe'" BeforeTargets="Build"> |
51 | 65 | <ItemGroup> |
52 | | - <_FilteredTestVariations Include="@(TestVariations)" Condition="'%(Identity)' == '$(TestVariation)'" /> |
| 66 | + <_InvalidTestVariations Include="$(TestVariation.Split('|'))" Exclude="@(TestVariations)" /> |
53 | 67 | </ItemGroup> |
54 | | - <Error Text="The test variation '$(TestVariation)' is not valid. Please run 'make list-variations' to list all the valid variations." Condition="@(_FilteredTestVariations->Count()) == '0'" /> |
| 68 | + <Error Text="Invalid test variation(s): '@(_InvalidTestVariations,', ')'. Please run 'make list-variations' to list all the valid variations." Condition="@(_InvalidTestVariations->Count()) != '0'" /> |
55 | 69 | </Target> |
56 | 70 | </Project> |
0 commit comments