summaryrefslogtreecommitdiff
path: root/tests/src/CLRTest.Jit.targets
blob: 1a0b5e3fce2eee569c6e8de92e00f4972bc19b53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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>$([MSBuild]::MakeRelative($(OutputPath), $(BaseOutputPathWithConfig)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 --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
    "$CORE_ROOT/corerun" "$CORE_ROOT/jit-dasm.dll" --crossgen $CORE_ROOT/crossgen --platform $CORE_ROOT --output $(JitDisasmOut) $(InputAssemblyName)
    _jdExitCode=$?
    if [ $_jdExitCode -ne 0 ]
    then
        echo EXECUTION OF JIT-DASM - FAILED $_jdExitCode
        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>$([MSBuild]::MakeRelative($(OutputPath), $(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>