diff options
Diffstat (limited to 'tests/testenvironment.proj')
-rw-r--r-- | tests/testenvironment.proj | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/tests/testenvironment.proj b/tests/testenvironment.proj new file mode 100644 index 0000000000..f99209ba03 --- /dev/null +++ b/tests/testenvironment.proj @@ -0,0 +1,149 @@ +<Project DefaultTargets="CreateTestEnvFile"> + <!-- This project creates a .cmd or .sh file that sets the environment variables corresponding to the specified Scenario property. + For example, to create SetStressModes.cmd file for scenario "jitstress1" you can use the following command: + + dotnet msbuild testenvironment.proj /p:TestEnvFileName=SetStressModes.cmd /p:Scenario=jitstress1 /p:TargetsWindows=true + --> + + + <!-- COMPlus_* variables that can be specified for a test scenario --> + <PropertyGroup> + <COMPlusVariables> + COMPlus_TieredCompilation; + COMPlus_EnableAES; + COMPlus_EnableAVX; + COMPlus_EnableAVX2; + COMPlus_EnableBMI1; + COMPlus_EnableBMI2; + COMPlus_EnableFMA; + COMPlus_EnableIncompleteISAClass; + COMPlus_EnableLZCNT; + COMPlus_EnablePCLMULQDQ; + COMPlus_EnablePOPCNT; + COMPlus_EnableSSE; + COMPlus_EnableSSE2; + COMPlus_EnableSSE3; + COMPlus_EnableSSE3_4; + COMPlus_EnableSSSE3; + COMPlus_EnableSSE41; + COMPlus_EnableSSE42; + COMPlus_FeatureSIMD; + COMPlus_ForceRelocs; + COMPlus_GCStress; + COMPlus_HeapVerify; + COMPlus_JITMinOpts; + COMPlus_JitStress; + COMPlus_JitStressRegs; + COMPlus_TailcallStress; + COMPlus_ReadyToRun; + COMPlus_ZapDisable + </COMPlusVariables> + </PropertyGroup> + <ItemGroup> + <COMPlusVariable Include="$(COMPlusVariables)" /> + </ItemGroup> + + <!-- Default values for some COMPlus_* variables --> + <ItemDefinitionGroup> + <TestEnvironment> + <TieredCompilation>0</TieredCompilation> + </TestEnvironment> + </ItemDefinitionGroup> + + <!-- TestEnvironment is a mapping between Scenario and COMPlus_* environment variable values that are written to __TestEnv file --> + <ItemGroup> + <!-- "normal" scenario doesn't define any COMPlus_* variables and uses the coreclr runtime default values + while other scenarios use the default values of COMPlus_* variables defined in ItemDefinitionGroup above --> + <TestEnvironment Include="normal" TieredCompilation="" /> + <TestEnvironment Include="minopts" JITMinOpts="1" /> + <TestEnvironment Include="no_tiered_compilation" TieredCompilation="0" /> + <TestEnvironment Include="forcerelocs" ForceRelocs="1" /> + <TestEnvironment Include="jitstress1" JitStress="1" /> + <TestEnvironment Include="jitstress2" JitStress="2" /> + <TestEnvironment Include="jitstress1_tiered" JitStress="1" TieredCompilation="1" /> + <TestEnvironment Include="jitstress2_tiered" JitStress="2" TieredCompilation="1" /> + <TestEnvironment Include="jitstressregs1" JitStressRegs="1" /> + <TestEnvironment Include="jitstressregs2" JitStressRegs="2" /> + <TestEnvironment Include="jitstressregs3" JitStressRegs="3" /> + <TestEnvironment Include="jitstressregs4" JitStressRegs="4" /> + <TestEnvironment Include="jitstressregs8" JitStressRegs="8" /> + <TestEnvironment Include="jitstressregs0x10" JitStressRegs="0x10" /> + <TestEnvironment Include="jitstressregs0x80" JitStressRegs="0x80" /> + <TestEnvironment Include="jitstressregs0x1000" JitStressRegs="0x1000" /> + <TestEnvironment Include="jitstress2_jitstressregs1" JitStress="2" JitStressRegs="1" /> + <TestEnvironment Include="jitstress2_jitstressregs2" JitStress="2" JitStressRegs="2" /> + <TestEnvironment Include="jitstress2_jitstressregs3" JitStress="2" JitStressRegs="3" /> + <TestEnvironment Include="jitstress2_jitstressregs4" JitStress="2" JitStressRegs="4" /> + <TestEnvironment Include="jitstress2_jitstressregs8" JitStress="2" JitStressRegs="8" /> + <TestEnvironment Include="jitstress2_jitstressregs0x10" JitStress="2" JitStressRegs="0x10" /> + <TestEnvironment Include="jitstress2_jitstressregs0x80" JitStress="2" JitStressRegs="0x80" /> + <TestEnvironment Include="jitstress2_jitstressregs0x1000" JitStress="2" JitStressRegs="0x1000" /> + <TestEnvironment Include="tailcallstress" TailcallStress="1" /> + <TestEnvironment Include="jitsse2only" EnableAVX="0" EnableSSE3_4="0" /> + <TestEnvironment Include="jitnosimd" FeatureSIMD="0" /> + <TestEnvironment Include="jitincompletehwintrinsic" EnableIncompleteISAClass="1" /> + <!-- testing the legacy SSE encoding --> + <TestEnvironment Include="jitx86hwintrinsicnoavx" EnableIncompleteISAClass="1" EnableAVX="0" /> + <!-- testing SNB/IVB --> + <TestEnvironment Include="jitx86hwintrinsicnoavx2" EnableIncompleteISAClass="1" EnableAVX2="0" /> + <!-- match "jitnosimd", may need to remove after decoupling HW intrinsic from FeatureSIMD --> + <TestEnvironment Include="jitx86hwintrinsicnosimd" EnableIncompleteISAClass="1" FeatureSIMD="0" /> + <TestEnvironment Include="jitnox86hwintrinsic" EnableIncompleteISAClass="1" EnableSSE="0" EnableSSE2="0" EnableSSE3="0" EnableSSSE3="0" EnableSSE41="0" EnableSSE42="0" EnableAVX="0" EnableAVX2="0" EnableAES="0" EnableBMI1="0" EnableBMI2="0" EnableFMA="0" EnableLZCNT="0" EnablePCLMULQDQ="0" EnablePOPCNT="0" /> + <TestEnvironment Include="gcstress0x3" GCStress="0x3" /> + <TestEnvironment Include="gcstress0xc" GCStress="0xC" /> + <TestEnvironment Include="zapdisable" ZapDisable="1" ReadyToRun="0" /> + <TestEnvironment Include="heapverify1" HeapVerify="1" /> + <TestEnvironment Include="gcstress0xc_zapdisable" GCStress="0xC" ZapDisable="1" ReadyToRun="0" /> + <TestEnvironment Include="gcstress0xc_zapdisable_jitstress2" GCStress="0xC" ZapDisable="1" ReadyToRun="0" JitStress="2" /> + <TestEnvironment Include="gcstress0xc_zapdisable_heapverify1" GCStress="0xC" ZapDisable="1" ReadyToRun="0" HeapVerify="1" /> + <TestEnvironment Include="gcstress0xc_jitstress1" GCStress="0xC" JitStress="1" /> + <TestEnvironment Include="gcstress0xc_jitstress2" GCStress="0xC" JitStress="2" /> + <TestEnvironment Include="gcstress0xc_minopts_heapverify1" GCStress="0xC" JITMinOpts="1" HeapVerify="1" /> + </ItemGroup> + + <!-- We use target batching on the COMPlusVariable items to iterate over the all COMPlus_* environment variables + that can be specified by a test scenario. --> + <Target Name="OutputCOMPlusVariables" Inputs="@(COMPlusVariable)" Outputs="%(COMPlusVariable.Identity)"> + <PropertyGroup> + <_COMPlusVariable>%(COMPlusVariable.Identity)</_COMPlusVariable> + <_COMPlusVariableMetadataName>$(_COMPlusVariable.Replace('COMPlus_', ''))</_COMPlusVariableMetadataName> + </PropertyGroup> + + <ItemGroup> + <_TestEnvironment Include="@(TestEnvironment)" Condition="'%(Identity)' == '$(Scenario)'" /> + <_TestEnvironmentWithMetadata Include="@(_TestEnvironment->HasMetadata($(_COMPlusVariableMetadataName)))" /> + + <!-- _TestEnvironmentWithMetadata can be either empty or contain one item: + + 1) If _TestEnvironmentWithMetadata is empty, then this suggests that the test scenario with identity $(Scenario) + doesn't define COMPlus_* environment variable with name $(_COMPlusVariable); + + 2) Otherwise, the test scenario defines such COMPlus_* environment variable and the specified value + of this variable can be extracted by using Metadata() item function. + --> + + <_COMPlusVariable Include="$(_COMPlusVariable)" Condition="@(_TestEnvironmentWithMetadata->Count()) == 1"> + <Value>@(_TestEnvironmentWithMetadata->Metadata($(_COMPlusVariableMetadataName)))</Value> + </_COMPlusVariable> + </ItemGroup> + + <!-- Conceptually, this target creates a collection of _COMPlusVariable items that corresponds to + COMPlus_* environment variables specified for the test scenario with identity $(Scenario) --> + + </Target> + + <Target Name="CreateTestEnvFile" DependsOnTargets="OutputCOMPlusVariables"> + <ItemGroup Condition="'$(TargetsWindows)' == 'true'"> + <_TestEnvFileLine Include="@echo off" /> + <_TestEnvFileLine Include="@(_COMPlusVariable->'set %(Identity)=%(Value)')" /> + </ItemGroup> + + <ItemGroup Condition="'$(TargetsWindows)' != 'true'"> + <_TestEnvFileLine Include="#!/usr/bin/env bash" /> + <_TestEnvFileLine Include="@(_COMPlusVariable->'export %(Identity)=%(Value)')" /> + </ItemGroup> + + <WriteLinesToFile File="$(TestEnvFileName)" Lines="@(_TestEnvFileLine)" Overwrite="true" /> + </Target> + +</Project> |