summaryrefslogtreecommitdiff
path: root/tests/src/CLRTest.Execute.Bash.targets
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2016-01-01 06:25:29 -0800
committerKyungwoo Lee <kyulee@microsoft.com>2016-01-01 06:31:57 -0800
commite380f2c2751ec539a1acd4cf0c027ab62d845328 (patch)
treede82e1e142cc4d93bc4bc9d095ee2c1ca4fc29ea /tests/src/CLRTest.Execute.Bash.targets
parenta9dc13887582351bcb2796b1be0c6a23ced07642 (diff)
downloadcoreclr-e380f2c2751ec539a1acd4cf0c027ab62d845328.tar.gz
coreclr-e380f2c2751ec539a1acd4cf0c027ab62d845328.tar.bz2
coreclr-e380f2c2751ec539a1acd4cf0c027ab62d845328.zip
Enable ilasm round trip test for xPlatforms
1. Enable CLRTest.Execute.Bash.targets similar to CLRTest.Execute.Batch.targets. 2. _IlasmSwitches uses '-' instead of '/' 3. Disable optimization on the prebuilt asmparse.c due to https://github.com/dotnet/coreclr/issues/2305
Diffstat (limited to 'tests/src/CLRTest.Execute.Bash.targets')
-rw-r--r--tests/src/CLRTest.Execute.Bash.targets64
1 files changed, 54 insertions, 10 deletions
diff --git a/tests/src/CLRTest.Execute.Bash.targets b/tests/src/CLRTest.Execute.Bash.targets
index f0543f714a..042aa8b7da 100644
--- a/tests/src/CLRTest.Execute.Bash.targets
+++ b/tests/src/CLRTest.Execute.Bash.targets
@@ -52,6 +52,41 @@ fi
</PropertyGroup>
</Target>
+ <Target
+ Name="GetIlasmRoundTripBashScript"
+ Returns="$(IlasmRoundTripBashScript)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <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 == 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 == 0 ]
+then
+ echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
+ exit 1
+fi
+ ]]>
+ </IlasmRoundTripBashScript>
+ </PropertyGroup>
+ </Target>
+
<!-- This is here because of this bug: http://blogs.msdn.com/b/msbuild/archive/2006/01/03/508629.aspx-->
<Target Name="FetchExternalProperties">
<!--Call GetExecuteShFullPath to get ToRunProject cmd file Path -->
@@ -95,7 +130,7 @@ fi
<Target Name="GenerateBashExecutionScript"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)\$(MSBuildProjectName).sh"
- DependsOnTargets="FetchExternalProperties;GetCrossgenBashScript">
+ DependsOnTargets="FetchExternalProperties;GetCrossgenBashScript;GetIlasmRoundTripBashScript">
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
@@ -148,15 +183,22 @@ fi
</ItemGroup>
<PropertyGroup>
- <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'true'">$(_CLRTestToRunFileFullPath)</_CLRTestRunFile>
- <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND $(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</_CLRTestRunFile>
-
- <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'false'">"$(MSBuildProjectName).exe"</_CLRTestRunFile>
- <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND !$(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $(_CLRTestRunFile)</_CLRTestRunFile>
+ <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun"</_CLRTestRunFile>
+ <BashCLRTestLaunchCmds Condition="'$(IlasmRoundTrip)'=='true'"><![CDATA[
+echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments $Host_Args
+$(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments $Host_Args
+if [ ! $? == $CLRTestExpectedExitCode ]
+then
+ echo END EXECUTION OF IL{D}ASM BINARY - FAILED $? vs $CLRTestExpectedExitCode
+ echo FAILED
+ exit 1
+fi
+ ]]></BashCLRTestLaunchCmds>
- <BashCLRTestLaunchCmds Condition=" '$(BashCLRTestLaunchCmds)'=='' "><![CDATA[
-echo $(_CLRTestRunFile) $CLRTestExecutionArguments $Host_Args
-$_DebuggerFullPath $(_CLRTestRunFile) $CLRTestExecutionArguments $Host_Args
+ <BashCLRTestLaunchCmds><![CDATA[
+$(BashCLRTestLaunchCmds)
+echo $_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments $Host_Args
+$_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments $Host_Args
CLRTestExitCode=$?
]]></BashCLRTestLaunchCmds>
</PropertyGroup>
@@ -232,6 +274,8 @@ $(BashCLRTestArgPrep)
$(BashCLRTestExitCodePrep)
# CrossGen Script (when /p:CrossGen=true)
$(CrossgenBashScript)
+# IlasmRoundTrip Script
+$(IlasmRoundTripBashScript)
# PreCommands
$(_BashCLRTestPreCommands)
# Launch
@@ -255,4 +299,4 @@ $(BashCLRTestExitCodeCheck)
Overwrite="true" />
</Target>
-</Project> \ No newline at end of file
+</Project>