summaryrefslogtreecommitdiff
path: root/tests/src/CLRTest.Execute.Bash.targets
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /tests/src/CLRTest.Execute.Bash.targets
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'tests/src/CLRTest.Execute.Bash.targets')
-rw-r--r--tests/src/CLRTest.Execute.Bash.targets163
1 files changed, 131 insertions, 32 deletions
diff --git a/tests/src/CLRTest.Execute.Bash.targets b/tests/src/CLRTest.Execute.Bash.targets
index c487468149..f015cc710d 100644
--- a/tests/src/CLRTest.Execute.Bash.targets
+++ b/tests/src/CLRTest.Execute.Bash.targets
@@ -27,27 +27,31 @@ WARNING: When setting properties based on their current state (for example:
<DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
<TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
- <IlasmRoundTrip Condition="'$(ReferenceLocalMscorlib)'!=''">false</IlasmRoundTrip>
-
<IlasmRoundTripBashScript Condition="'$(IlasmRoundTrip)'=='true'">
<![CDATA[
-echo "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
-"$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
-_ERRORLEVEL=$?
-if [ $ERRORLEVEL -ne 0 ]
+# Disable Ilasm round-tripping for Linker tests.
+# Todo: Ilasm round-trip on linked binaries.
+
+if [ -z "$DoLink" ];
then
- echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL
- exit 1
-fi
+ echo "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+ "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+ ERRORLEVEL=$?
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL
+ exit 1
+ fi
-echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
-"$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
-_ERRORLEVEL=$?
-if [ $ERRORLEVEL -ne 0 ]
-then
- echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
- exit 1
-fi
+ echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+ ERRORLEVEL=$?
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
+ exit 1
+ fi
+fi
]]>
</IlasmRoundTripBashScript>
</PropertyGroup>
@@ -103,13 +107,17 @@ fi
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
- <PropertyGroup>
+ <PropertyGroup>
+ <!-- An exit code of 2 indicates "Skipped" for regular non-windows runs, but "Failed" in Helix -->
+ <GCBashScriptExitCode Condition="'$(BuildTestsAgainstPackages)' != 'true'">2</GCBashScriptExitCode>
+ <GCBashScriptExitCode Condition="'$(BuildTestsAgainstPackages)' == 'true'">0</GCBashScriptExitCode>
+
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(GCStressIncompatible)' == 'true'"><![CDATA[
$(BashCLRTestEnvironmentCompatibilityCheck)
if [ ! -z "$COMPlus_GCStress" ]
then
echo SKIPPING EXECUTION BECAUSE COMPlus_GCStress IS SET
- exit 0
+ exit $(GCBashScriptExitCode)
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(JitOptimizationSensitive)' == 'true'"><![CDATA[
@@ -117,7 +125,7 @@ $(BashCLRTestEnvironmentCompatibilityCheck)
if [ \( ! -z "$COMPlus_JitStress" \) -o \( ! -z "$COMPlus_JitStressRegs" \) -o \( ! -z "$COMPlus_JITMinOpts" \) ]
then
echo "SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts) IS SET"
- exit 0
+ exit $(GCBashScriptExitCode)
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(HeapVerifyIncompatible)' == 'true'"><![CDATA[
@@ -125,7 +133,7 @@ $(BashCLRTestEnvironmentCompatibilityCheck)
if [ ! -z "$COMPlus_HeapVerify" ]
then
echo SKIPPING EXECUTION BECAUSE COMPlus_HeapVerify IS SET
- exit 0
+ exit $(GCBashScriptExitCode)
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
@@ -179,25 +187,116 @@ fi
</BashCLRTestExecutionScriptArgument>
</ItemGroup>
+ <PropertyGroup>
+ <ReflectionRootsXml>$(MSBuildProjectName).reflect.xml</ReflectionRootsXml>
+ <BashLinkerTestLaunchCmds>
+ <![CDATA[
+# Linker commands
+
+LinkBin=__Link
+Assemblies="-a System.Private.CoreLib"
+ReflectionRoots=
+
+shopt -s nullglob
+
+if [ ! -z "$DoLink" ];
+then
+ if [ ! -x "$ILLINK" ];
+ then
+ echo "Illink executable [$ILLINK] Invalid"
+ exit 1
+ fi
+
+ # Clean up old Linked binaries, if any
+ rm -rf $LinkBin
- <PropertyGroup>
+ # Remove Native images, since the goal is to run from Linked binaries
+ rm -f *.ni.*
+
+ # Use hints for reflection roots, if provided in $(ReflectionRootsXml)
+ if [ -f $(ReflectionRootsXml) ];
+ then
+ ReflectionRoots="-x $(ReflectionRootsXml)"
+ fi
+
+ # Include all .exe files in this directory as entry points (some tests had multiple .exe file modules)
+ for bin in *.exe *.dll;
+ do
+ Assemblies="$Assemblies -a ${bin%.*}"
+ done
+
+ # Run dotnet-linker
+ # Run the Linker such that all assemblies except System.Private.Corlib.dll are linked
+ # Debug symbol generation needs some fixes, and is currently omitted.
+ # Once this is fixed, add -b true option.
+ echo "$ILLINK -out $LinkBin -d $CORE_ROOT -c link -l none -t $Assemblies $ReflectionRoots"
+ $ILLINK -out $LinkBin -d $CORE_ROOT -c link -l none -t $Assemblies $ReflectionRoots
+ ERRORLEVEL=$?
+ if [ $ERRORLEVEL -ne 0 ]
+ then
+ echo ILLINK FAILED $ERRORLEVEL
+ if [ -z "$KeepLinkedBinaries" ];
+ then
+ rm -rf $LinkBin
+ fi
+ exit 1
+ fi
+
+ # Copy CORECLR native binaries to $LinkBin,
+ # so that we can run the test based on that directory
+ cp $CORE_ROOT/*.so $LinkBin/
+ cp $CORE_ROOT/corerun $LinkBin/
+
+ # Copy some files that may be arguments
+ for f in *.txt;
+ do
+ [ -e "$f" ] && cp $f $LinkBin
+ done
+
+ ExePath=$LinkBin/$(InputAssemblyName)
+ export CORE_ROOT=$PWD/$LinkBin
+fi
+]]>
+ </BashLinkerTestLaunchCmds>
+ <BashLinkerTestCleanupCmds>
+ <![CDATA[
+# Clean up the LinkBin directories after test execution.
+# Otherwise, RunTests may run out of disk space.
+
+if [ ! -z "$DoLink" ];
+then
+ if [ -z "$KeepLinkedBinaries" ];
+ then
+ rm -rf $LinkBin
+ fi
+fi
+]]>
+ </BashLinkerTestCleanupCmds>
+ </PropertyGroup>
+ <PropertyGroup>
<_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun"</_CLRTestRunFile>
<BashCLRTestLaunchCmds Condition="'$(IlasmRoundTrip)'=='true'"><![CDATA[
-echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
-$(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
-if [ $? -ne $CLRTestExpectedExitCode ]
-then
- echo END EXECUTION OF IL{D}ASM BINARY - FAILED $? vs $CLRTestExpectedExitCode
- echo FAILED
- exit 1
+if [ -z "$DoLink" ]; then
+ echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
+ $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments
+ if [ $? -ne $CLRTestExpectedExitCode ]
+ then
+ echo END EXECUTION OF IL{D}ASM BINARY - FAILED $? vs $CLRTestExpectedExitCode
+ echo FAILED
+ exit 1
+ fi
fi
]]></BashCLRTestLaunchCmds>
- <BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun'"><![CDATA[
+ <BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun'">
+ <![CDATA[
+ExePath=$(InputAssemblyName)
+$(BashLinkerTestLaunchCmds)
$(BashCLRTestLaunchCmds)
-echo $_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments
-$_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments
+echo $_DebuggerFullPath $(_CLRTestRunFile) $ExePath $CLRTestExecutionArguments
+$_DebuggerFullPath $(_CLRTestRunFile) $ExePath $CLRTestExecutionArguments
CLRTestExitCode=$?
+$(BashLinkerTestCleanupCmds)
]]></BashCLRTestLaunchCmds>
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'RunOnly'"><![CDATA[
$(BashCLRTestLaunchCmds)