diff options
Diffstat (limited to 'tests/src/CLRTest.CrossGen.targets')
-rw-r--r-- | tests/src/CLRTest.CrossGen.targets | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/tests/src/CLRTest.CrossGen.targets b/tests/src/CLRTest.CrossGen.targets index 9dc441f636..efbe05732b 100644 --- a/tests/src/CLRTest.CrossGen.targets +++ b/tests/src/CLRTest.CrossGen.targets @@ -41,29 +41,47 @@ WARNING: When setting properties based on their current state (for example: if [ ! -z ${RunCrossGen+x} ]%3B then export COMPlus_ZapRequire=$(ZapRequire) export COMPlus_ZapRequireList=$(MSBuildProjectName) - if [ ! -f $(MSBuildProjectName).org ]%3B then - TakeLock - if [ ! -f $(MSBuildProjectName).org ]%3B then - mkdir IL - cp $(MSBuildProjectName).exe IL/$(MSBuildProjectName).exe - mv $(MSBuildProjectName).exe $(MSBuildProjectName).org - echo $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD/IL%3A$PWD /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe - $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD/IL%3A$PWD /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe - __cgExitCode=$? - if [ $__cgExitCode -ne 0 ] - then - echo Crossgen failed with exitcode: $__cgExitCode - ReleaseLock - exit 1 - fi - fi - ReleaseLock - fi -fi - ]]> + + if [ -d IL ]%3B then + echo Inconsistency, IL dir already exists, reinstall tests + exit 1 + fi + + mkdir IL + cp *.{dll,exe} IL/ + + __Command="$CORE_ROOT/crossgen $CrossGenOptions /p $CORE_ROOT%3A$PWD/IL /in $PWD/IL/$(MSBuildProjectName).exe /out $PWD/$(MSBuildProjectName).ni.exe" + + echo "Running CrossGen: $__Command" + $__Command + __cgExitCode=$? + if [ $__cgExitCode -ne 0 ] + then + mv IL/* . + rm -rf $(MSBuildProjectName).ni.exe + rm -rf IL + echo Crossgen failed with exitcode: $__cgExitCode + exit 1 + fi + + # Need to copy this to coreroot so that ni gets into TPA list (it's not loaded otherwise) + mv $(MSBuildProjectName).ni.exe $CORE_ROOT +fi + ]]> </CrossgenBashScript> + <CrossgenCleanupBashScript Condition="'$(CLRTestKind)' == 'BuildAndRun' and '$(CrossGenTest)' != 'false'"> + <![CDATA[ +if [ ! -z ${RunCrossGen+x} ] || [ ! -z ${RunCrossGen2+x} ]%3B then + mv IL/* . + rm -rf $CORE_ROOT/$(MSBuildProjectName).ni.exe + rm -rf IL +fi + ]]> + </CrossgenCleanupBashScript> + <BashCLRTestPreCommands>$(BashCLRTestPreCommands);$(CrossgenBashScript)</BashCLRTestPreCommands> + <BashCLRTestPostCommands>$(BashCLRTestPostCommands);$(CrossgenCleanupBashScript)</BashCLRTestPostCommands> </PropertyGroup> </Target> @@ -73,29 +91,6 @@ fi <CrossgenBatchScript Condition="'$(CLRTestKind)' == 'BuildAndRun'"> <![CDATA[ -REM CrossGen Script -if defined RunCrossGen ( - if defined LargeVersionBubble ( set OptionalArguments=!OptionalArguments! /largeversionbubble) - set COMPlus_ZapRequire=$(ZapRequire) - set COMPlus_ZapRequireList=$(MSBuildProjectName) - if not exist "$(MSBuildProjectName).org" ( - call :TakeLock - set CrossGenStatus=0 - if not exist "$(MSBuildProjectName).org" ( - mkdir IL - copy $(MSBuildProjectName).exe IL\$(MSBuildProjectName).exe - ren $(MSBuildProjectName).exe $(MSBuildProjectName).org - echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" !OptionalArguments! /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe - %_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" !OptionalArguments! /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe - set CrossGenStatus=!ERRORLEVEL! - ) - call :ReleaseLock - IF NOT !CrossGenStatus!==0 ( - ECHO Crossgen failed with exitcode - !CrossGenStatus! - Exit /b 1 - ) - ) -) ]]> </CrossgenBatchScript> @@ -104,5 +99,5 @@ if defined RunCrossGen ( </Target> - -</Project>
\ No newline at end of file + +</Project> |