diff options
Diffstat (limited to 'tests/src/CLRTest.Jit.targets')
-rw-r--r-- | tests/src/CLRTest.Jit.targets | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/tests/src/CLRTest.Jit.targets b/tests/src/CLRTest.Jit.targets new file mode 100644 index 0000000000..4eb632722e --- /dev/null +++ b/tests/src/CLRTest.Jit.targets @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +*********************************************************************************************** +CLRTest.Jit.targets + +WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have + created a backup copy. Incorrect changes to this file will make it + impossible to load or build your projects from the command-line or the IDE. + +This file contains the logic for generating command scripts for special GC tests. + +WARNING: When setting properties based on their current state (for example: + <Foo Condition="'$(Foo)'==''>Bar</Foo>). Be very careful. Another script generation + target might be trying to do the same thing. It's better to avoid this by instead setting a new property. + + Additionally, be careful with itemgroups. Include will propagate outside of the target too! + +*********************************************************************************************** +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <Target Name="GetJitDisasmBashScript" + Returns="$(JitDisasmBashScript)"> + <PropertyGroup> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName> + <JitDisasmOut>$(BaseOutputPathWithConfig.Replace("\","/"))dasm/$(BuildProjectRelativeDir.Replace("\","/"))</JitDisasmOut> + <JitDisasmBashScript> +<![CDATA[ +# JitDisasm Script +if [ ! -z $RunningJitDisasm ] +then + echo $CORE_ROOT/corerun "$CORE_ROOT/jit-dasm.dll" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName) + "$CORE_ROOT/corerun" "$CORE_ROOT/jit-dasm" --crossgen $CORE_ROOT/crossgen.exe --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName) + if [ $ERRORLEVEL -ne 0 ] + then + echo EXECUTION OF JIT-DASM - FAILED $ERRORLEVEL + exit 1 + fi +fi +]]> + </JitDisasmBashScript> + </PropertyGroup> + </Target> + + <Target Name="GetJitDisasmBatchScript" + Returns="$(JitDisasmBatchScript)"> + <PropertyGroup> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName> + <JitDisasmOut>$(BaseOutputPathWithConfig)dasm\$(BuildProjectRelativeDir)</JitDisasmOut> + <JitDisasmBatchScript> +<![CDATA[ +REM JitDisasm Script +if defined RunningJitDisasm ( + echo %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName) + %CORE_ROOT%\corerun %CORE_ROOT%\jit-dasm.dll --crossgen %CORE_ROOT%/crossgen.exe --platform %CORE_ROOT%%3B%25cd%25 --output $(JitDisasmOut) $(InputAssemblyName) + IF NOT "!ERRORLEVEL!"=="0" ( + ECHO EXECUTION OF JIT-DASM - FAILED !ERRORLEVEL! + Exit /b 1 + ) + Exit /b 0 +) + ]]> + </JitDisasmBatchScript> + </PropertyGroup> + </Target> + + <PropertyGroup Condition="$(RunWithGcStress) != ''" > + <CLRTestBatchPreCommands> +<![CDATA[ + $(CLRTestBatchPreCommands) +set COMPlus_GCStress=$(RunWithGcStress) + ]]> + </CLRTestBatchPreCommands> + <BashCLRTestPreCommands> +<![CDATA[ + $(BashCLRTestPreCommands) +export COMPlus_GCStress=$(RunWithGcStress) + ]]> + </BashCLRTestPreCommands> + </PropertyGroup> + + +</Project> |