diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2016-03-22 01:18:21 -0700 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2016-03-23 13:15:18 -0700 |
commit | 6afc14de44435422e59b81493e561256ea756f8c (patch) | |
tree | 91551694b22188400f78c7781ad8bf70873b7792 /tests/runtest.cmd | |
parent | 50c1cafb162d4f74b253add4c079a4afff7aa057 (diff) | |
download | coreclr-6afc14de44435422e59b81493e561256ea756f8c.tar.gz coreclr-6afc14de44435422e59b81493e561256ea756f8c.tar.bz2 coreclr-6afc14de44435422e59b81493e561256ea756f8c.zip |
Enable support to precompile the FX assemblies at test invocation time.
Diffstat (limited to 'tests/runtest.cmd')
-rw-r--r-- | tests/runtest.cmd | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd index 35ff794b34..7625486e58 100644 --- a/tests/runtest.cmd +++ b/tests/runtest.cmd @@ -54,6 +54,7 @@ if /i "%1" == "Exclude" (set __Exclude=%2&shift&shift&goto Arg_Loop) if /i "%1" == "Exclude0" (set __Exclude0=%2&shift&shift&goto Arg_Loop) if /i "%1" == "TestEnv" (set __TestEnv=%2&shift&shift&goto Arg_Loop) if /i "%1" == "sequential" (set __BuildSequential=1&shift&goto Arg_Loop) +if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop) if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&set __SkipWrapperGeneration=true&shift&goto Arg_Loop) if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs @@ -158,6 +159,11 @@ if errorlevel 1 exit /b 1 call :ResolveDependecies +if not defined __DoCrossgen goto :SkipPrecompileFX +call :PrecompileFX + +:SkipPrecompileFX + if defined __GenerateLayoutOnly ( exit /b 1 ) @@ -203,6 +209,32 @@ REM === Helper routines REM === REM ========================================================================================= +REM Compile the managed assemblies in Core_ROOT before running the tests +:PrecompileAssembly + +REM Skip mscorlib since it is already precompiled. +if /I "%3" == "mscorlib.dll" exit /b 0 +if /I "%3" == "mscorlib.ni.dll" exit /b 0 + +"%1\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" "%2" >nul 2>nul +set /a __exitCode = %errorlevel% +if "%__exitCode%" == "-2146230517" ( + echo %2 is not a managed assembly. + exit /b 0 +) + +if %__exitCode% neq 0 ( + echo Unable to precompile %2 + exit /b 0 +) + +echo Successfully precompiled %2 +exit /b 0 + +:PrecompileFX +for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nF%%~xF +exit /b 0 + :msbuild @REM Subroutine to invoke msbuild. All arguments are passed to msbuild. The first argument should be the @REM .proj file to invoke. @@ -261,7 +293,7 @@ echo %__MsgPrefix% Created the runtime layout with all dependencies in:%CORE_ROO exit /b 0 if errorlevel 1 ( - echo Test Depenedevy Resolution Failed + echo Test Dependency Resolution Failed exit /b 1 ) |