diff options
Diffstat (limited to 'tests/runtest.cmd')
-rw-r--r-- | tests/runtest.cmd | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd index 5620789575..23b4bb5f42 100644 --- a/tests/runtest.cmd +++ b/tests/runtest.cmd @@ -1,10 +1,11 @@ -@if not defined __echo @echo off +@if not defined _echo @echo off setlocal EnableDelayedExpansion :: Set the default arguments set __BuildArch=x64 set __BuildType=Debug set __BuildOS=Windows_NT +set __MSBuildBuildArch=x64 :: Default to highest Visual Studio version available set __VSVersion=vs2015 @@ -30,6 +31,8 @@ set __Sequential= set __msbuildExtraArgs= set __LongGCTests= set __GCSimulatorTests= +set __AgainstPackages= +set __JitDisasm= :Arg_Loop if "%1" == "" goto ArgsDone @@ -43,6 +46,7 @@ if /i "%1" == "-help" goto Usage if /i "%1" == "x64" (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop) if /i "%1" == "x86" (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop) +if /i "%1" == "arm" (set __BuildArch=arm&set __MSBuildBuildArch=arm&shift&goto Arg_Loop) if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop) if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop) @@ -55,6 +59,7 @@ if /i "%1" == "SkipWrapperGeneration" (set __SkipWrapperGeneration=true&shift&go 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" == "AgainstPackages" (set __AgainstPackages=1&shift&goto Arg_Loop) if /i "%1" == "sequential" (set __Sequential=1&shift&goto Arg_Loop) if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop) if /i "%1" == "longgc" (set __LongGCTests=1&shift&goto Arg_Loop) @@ -63,11 +68,12 @@ if /i "%1" == "jitstress" (set COMPlus_JitStress=%2&shift&shift&goto if /i "%1" == "jitstressregs" (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop) if /i "%1" == "jitminopts" (set COMPlus_JITMinOpts=1&shift&shift&goto Arg_Loop) if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&shift&goto Arg_Loop) +if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop) if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&set __SkipWrapperGeneration=true&shift&goto Arg_Loop) if /i "%1" == "PerfTests" (set __PerfTests=true&set __SkipWrapperGeneration=true&shift&goto Arg_Loop) if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop) REM change it to COMPlus_GCStress when we stop using xunit harness -if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop) +if /i "%1" == "gcstresslevel" (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop) if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs :: All the rest of the args will be collected and passed directly to msbuild. @@ -142,6 +148,10 @@ if not defined __Sequential ( set __msbuildCommonArgs=%__msbuildCommonArgs% /p:ParallelRun=false ) +if defined __AgainstPackages ( + set __msbuildCommonArgs=%__msbuildCommonArgs% /p:BuildTestsAgainstPackages=true +) + REM Prepare the Test Drop REM Cleans any NI from the last run powershell "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force" @@ -160,8 +170,8 @@ xcopy /s "%__BinDir%" "%CORE_ROOT%" :SkipCoreRootSetup -if defined __Exclude (if not exist %__Exclude% echo %__MsgPrefix%Error: Exclusion .targets file not found && exit /b 1) -if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script not found && exit /b 1) +if defined __Exclude (if not exist %__Exclude% echo %__MsgPrefix%Error: Exclusion file %__Exclude% not found && exit /b 1) +if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script %__TestEnv% not found && exit /b 1) REM These log files are created automatically by the test run process. Q: what do they depend on being set? set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.html @@ -185,7 +195,7 @@ call :PrecompileFX :SkipPrecompileFX if defined __GenerateLayoutOnly ( - exit /b 1 + exit /b 0 ) if not exist %CORE_ROOT%\coreclr.dll ( @@ -248,6 +258,8 @@ REM ============================================================================ REM Compile the managed assemblies in Core_ROOT before running the tests :PrecompileAssembly +if defined __JitDisasm goto :jitdisasm + 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 @@ -267,6 +279,27 @@ if %__exitCode% neq 0 ( echo Successfully precompiled %2 exit /b 0 +:jitdisasm + +if /I "%3" == "mscorlib.ni.dll" exit /b 0 + +echo "%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2" +"%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2" +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 and generated dasm for %2 +exit /b 0 + :PrecompileFX for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nF%%~xF exit /b 0 @@ -297,6 +330,7 @@ set __msbuildLogArgs=^ set __msbuildArgs=%* %__msbuildCommonArgs% %__msbuildLogArgs% @REM The next line will overwrite the existing log file, if any. +echo %_msbuildexe% %__msbuildArgs% echo Invoking: %_msbuildexe% %__msbuildArgs% > "%__BuildLog%" %_msbuildexe% %__msbuildArgs% @@ -334,13 +368,23 @@ if defined __GCSimulatorTests ( set RunningGCSimulatorTests=1 ) +if defined __JitDisasm ( + if defined __DoCrossgen ( + echo Running jit disasm on framework and test assemblies + ) + if not defined __DoCrossgen ( + echo Running jit disasm on test assemblies only + ) + set RunningJitDisasm=1 +) + set __BuildLogRootName=Tests_GenerateRuntimeLayout call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true if errorlevel 1 ( echo Test Dependency Resolution Failed exit /b 1 ) -echo %__MsgPrefix% Created the runtime layout with all dependencies in %CORE_ROOT% +echo %__MsgPrefix%Created the runtime layout with all dependencies in %CORE_ROOT% exit /b 0 @@ -360,12 +404,14 @@ echo Set to "" to disable default exclusion file. echo Exclude- Optional parameter - this will exclude individual tests from running, specified by ExcludeList ItemGroup in an .targets file. echo TestEnv- Optional parameter - this will run a custom script to set custom test environment settings. echo VSVersion- Optional parameter - VS2013 or VS2015 ^(default: VS2015^) +echo AgainstPackages - Optional parameter - this indicates that we are running tests that were built against packages echo GenerateLayoutOnly - If specified will not run the tests and will only create the Runtime Dependency Layout echo RunCrossgenTests - Runs ReadytoRun tests echo jitstress n - Runs the tests with COMPlus_JitStress=n echo jitstressregs n - Runs the tests with COMPlus_JitStressRegs=n echo jitminopts - Runs the tests with COMPlus_JITMinOpts=1 echo jitforcerelocs - Runs the tests with COMPlus_ForceRelocs=1 +echo jitdisasm - Runs jit-dasm on the tests echo gcstresslevel n - Runs the tests with COMPlus_GCStress=n echo 0: None 1: GC on all allocs and 'easy' places echo 2: GC on transitions to preemptive GC 4: GC on every allowable JITed instr |