Update PgoData to release-20180530-0051 (#18194)
[platform/upstream/coreclr.git] / tests / runtest.cmd
1 @if not defined _echo @echo off
2 setlocal EnableDelayedExpansion
3
4 :: Set the default arguments
5 set __BuildArch=x64
6 set __BuildType=Debug
7 set __BuildOS=Windows_NT
8 set __MSBuildBuildArch=x64
9
10 set "__ProjectDir=%~dp0"
11
12 :: Define a prefix for most output progress messages that come from this script. That makes
13 :: it easier to see where these are coming from. Note that there is a trailing space here.
14 set "__MsgPrefix=RUNTEST: "
15
16 call "%__ProjectDir%"\..\setup_vs_tools.cmd
17
18 REM setup_vs_tools.cmd will correctly echo error message.
19 if NOT '%ERRORLEVEL%' == '0' exit /b 1
20
21 set __VSVersion=vs2017
22
23 if defined VS140COMNTOOLS set __VSVersion=vs2015
24 if defined VS150COMNTOOLS set __VSVersion=vs2017
25
26 :: remove trailing slash
27 if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
28 set "__ProjectFilesDir=%__ProjectDir%"
29 set "__RootBinDir=%__ProjectDir%\..\bin"
30 set "__LogsDir=%__RootBinDir%\Logs"
31
32 set __Sequential=
33 set __msbuildExtraArgs=
34 set __LongGCTests=
35 set __GCSimulatorTests=
36 set __AgainstPackages=
37 set __JitDisasm=
38 set __IlasmRoundTrip=
39 set __CollectDumps=
40 set __DoCrossgen=
41 set __CrossgenAltJit=
42 set __PerfTests=
43
44 :Arg_Loop
45 if "%1" == "" goto ArgsDone
46
47 if /i "%1" == "/?"    goto Usage
48 if /i "%1" == "-?"    goto Usage
49 if /i "%1" == "/h"    goto Usage
50 if /i "%1" == "-h"    goto Usage
51 if /i "%1" == "/help" goto Usage
52 if /i "%1" == "-help" goto Usage
53
54 if /i "%1" == "x64"                   (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop)
55 if /i "%1" == "x86"                   (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop)
56 if /i "%1" == "arm"                   (set __BuildArch=arm&set __MSBuildBuildArch=arm&shift&goto Arg_Loop)
57 if /i "%1" == "arm64"                 (set __BuildArch=arm64&set __MSBuildBuildArch=arm64&shift&goto Arg_Loop)
58
59 if /i "%1" == "debug"                 (set __BuildType=Debug&shift&goto Arg_Loop)
60 if /i "%1" == "release"               (set __BuildType=Release&shift&goto Arg_Loop)
61 if /i "%1" == "checked"               (set __BuildType=Checked&shift&goto Arg_Loop)
62
63 if /i "%1" == "vs2015"                (set __VSVersion=%1&shift&goto Arg_Loop)
64 if /i "%1" == "vs2017"                (set __VSVersion=%1&shift&goto Arg_Loop)
65
66 if /i "%1" == "TestEnv"               (set __TestEnv=%2&shift&shift&goto Arg_Loop)
67 if /i "%1" == "AgainstPackages"       (set __AgainstPackages=1&shift&goto Arg_Loop)
68 if /i "%1" == "sequential"            (set __Sequential=1&shift&goto Arg_Loop)
69 if /i "%1" == "crossgen"              (set __DoCrossgen=1&shift&goto Arg_Loop)
70 if /i "%1" == "crossgenaltjit"        (set __DoCrossgen=1&set __CrossgenAltJit=%2&shift&shift&goto Arg_Loop)
71 if /i "%1" == "longgc"                (set __LongGCTests=1&shift&goto Arg_Loop)
72 if /i "%1" == "gcsimulator"           (set __GCSimulatorTests=1&shift&goto Arg_Loop)
73 if /i "%1" == "jitstress"             (set COMPlus_JitStress=%2&shift&shift&goto Arg_Loop)
74 if /i "%1" == "jitstressregs"         (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop)
75 if /i "%1" == "jitminopts"            (set COMPlus_JITMinOpts=1&shift&goto Arg_Loop)
76 if /i "%1" == "jitforcerelocs"        (set COMPlus_ForceRelocs=1&shift&goto Arg_Loop)
77 if /i "%1" == "jitdisasm"             (set __JitDisasm=1&shift&goto Arg_Loop)
78 if /i "%1" == "ilasmroundtrip"        (set __IlasmRoundTrip=1&shift&goto Arg_Loop)
79 if /i "%1" == "GenerateLayoutOnly"    (set __GenerateLayoutOnly=1&shift&goto Arg_Loop)
80 if /i "%1" == "PerfTests"             (set __PerfTests=true&shift&goto Arg_Loop)
81 if /i "%1" == "runcrossgentests"      (set RunCrossGen=true&shift&goto Arg_Loop)
82 if /i "%1" == "link"                  (set DoLink=true&set ILLINK=%2&shift&shift&goto Arg_Loop)
83 if /i "%1" == "tieredcompilation"     (set COMPLUS_TieredCompilation=1&shift&goto Arg_Loop)
84 if /i "%1" == "gcname"                (set COMPlus_GCName=%2&shift&shift&goto Arg_Loop)
85 if /i "%1" == "timeout"               (set __TestTimeout=%2&shift&shift&goto Arg_Loop)
86
87 REM change it to COMPlus_GCStress when we stop using xunit harness
88 if /i "%1" == "gcstresslevel"         (set __GCSTRESSLEVEL=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
89 if /i "%1" == "collectdumps"          (set __CollectDumps=true&shift&goto Arg_Loop)
90
91 if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
92 :: All the rest of the args will be collected and passed directly to msbuild.
93 :CollectMsbuildArgs
94 shift
95 if "%1"=="" goto ArgsDone
96 set __msbuildExtraArgs=%__msbuildExtraArgs% %1
97 goto CollectMsbuildArgs
98 :SkipMsbuildArgs
99
100 set CORE_ROOT=%1
101 echo %__MsgPrefix%CORE_ROOT is initially set to: "%CORE_ROOT%"
102 shift 
103 :ArgsDone
104
105 :: Done with argument processing. Check argument values for validity.
106
107 if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script %__TestEnv% not found && exit /b 1)
108 if "%__PerfTests%"=="true" (if defined __GenerateLayoutOnly echo %__MsgPrefix%Error: Don't specify both "PerfTests" and "GenerateLayoutOnly" && exit /b 1)
109
110 :: Set the remaining variables based upon the determined configuration
111 set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
112 set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
113
114 :: Default global test environment variables
115 :: REVIEW: are these ever expected to be defined on entry to this script? Why? By whom?
116 :: REVIEW: XunitTestReportDirBase is not used in this script. Who needs to have it set?
117 if not defined XunitTestBinBase       set  XunitTestBinBase=%__TestWorkingDir%
118 if not defined XunitTestReportDirBase set  XunitTestReportDirBase=%XunitTestBinBase%\Reports\
119
120 :: Set up msbuild and tools environment. Check if msbuild and VS exist.
121
122 set _msbuildexe=
123 if /i "%__VSVersion%" == "vs2017" (
124     set "__VSToolsRoot=%VS150COMNTOOLS%"
125     set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
126
127     set _msbuildexe="%VS150COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe"
128 ) else if /i "%__VSVersion%" == "vs2015" (
129     set "__VSToolsRoot=%VS140COMNTOOLS%"
130     set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
131
132     set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
133     if not exist !_msbuildexe! set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
134 )
135
136 :: Does VS really exist?
137 if not exist "%__VSToolsRoot%\..\IDE\devenv.exe"      goto NoVS
138 if not exist "%__VCToolsRoot%\vcvarsall.bat"          goto NoVS
139 if not exist "%__VSToolsRoot%\VsDevCmd.bat"           goto NoVS
140
141 :: Does MSBuild really exist?
142 if not exist %_msbuildexe% (
143     echo %__MsgPrefix%Error: Could not find MSBuild.exe.  Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
144     exit /b 1
145 )
146
147 if not defined VSINSTALLDIR (
148     echo %__MsgPrefix%Error: runtest.cmd should be run from a Visual Studio Command Prompt.  Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
149     exit /b 1
150 )
151
152 :: Note: We've disabled node reuse because it causes file locking issues.
153 ::       The issue is that we extend the build with our own targets which
154 ::       means that that rebuilding cannot successfully delete the task
155 ::       assembly. 
156 set __msbuildCommonArgs=/nologo /nodeReuse:false %__msbuildExtraArgs% /p:Platform=%__MSBuildBuildArch%
157
158 if not defined __Sequential (
159     set __msbuildCommonArgs=%__msbuildCommonArgs% /maxcpucount
160 ) else (
161     set __msbuildCommonArgs=%__msbuildCommonArgs% /p:ParallelRun=false
162 )
163
164 if defined __AgainstPackages (
165     set __msbuildCommonArgs=%__msbuildCommonArgs% /p:BuildTestsAgainstPackages=true
166 )
167
168 if defined DoLink (
169     set __msbuildCommonArgs=%__msbuildCommonArgs% /p:RunTestsViaIllink=true
170 )
171
172 if not exist %__LogsDir% md %__LogsDir%
173
174 REM These log files are created automatically by the test run process. Q: what do they depend on being set?
175 set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.html
176 set __TestRunXmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.xml
177
178 REM Prepare the Test Drop
179
180 if not defined __GenerateLayoutOnly (
181     echo %__MsgPrefix%Removing 'ni' files and 'lock' folders from %__TestWorkingDir%
182     REM Cleans any NI from the last run
183     powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
184     REM Cleans up any lock folder used for synchronization from last run
185     powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force |  where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
186 )
187
188 if defined CORE_ROOT goto SkipCoreRootSetup
189
190 set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
191 echo %__MsgPrefix%Using Default CORE_ROOT as %CORE_ROOT%
192 echo %__MsgPrefix%Copying Built binaries from %__BinDir% to %CORE_ROOT%
193 if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%"
194 md "%CORE_ROOT%"
195 xcopy "%__BinDir%" "%CORE_ROOT%"
196
197 :SkipCoreRootSetup
198
199 if not exist %CORE_ROOT%\coreclr.dll (
200     echo %__MsgPrefix%Error: Ensure you have done a successful build of the Product and %CORE_ROOT% contains runtime binaries.
201     exit /b 1
202 )
203
204 if "%__PerfTests%"=="true" goto RunPerfTests
205
206 REM =========================================================================================
207 REM ===
208 REM === Run normal (non-perf) tests
209 REM ===
210 REM =========================================================================================
211
212 call :SetTestEnvironment
213
214 call :ResolveDependencies
215 if errorlevel 1 exit /b 1
216
217 if defined __DoCrossgen call :PrecompileFX
218
219 REM Delete the unecessary mscorlib.ni file.
220 if exist %CORE_ROOT%\mscorlib.ni.dll del %CORE_ROOT%\mscorlib.ni.dll
221
222 if defined __GenerateLayoutOnly (
223     exit /b 0
224 )
225
226 ::Check if the test Binaries are built
227 if not exist %XunitTestBinBase% (
228     echo %__MsgPrefix%Error: Ensure the Test Binaries are built and are present at %XunitTestBinBase%.
229     echo %__MsgPrefix%Run "buildtest.cmd %__BuildArch% %__BuildType%" to build the tests first.
230     exit /b 1
231 )
232
233 if "%__CollectDumps%"=="true" (
234     :: Install dumpling
235     set "__DumplingHelperPath=%__ProjectDir%\..\Tools\DumplingHelper.py"
236     python "!__DumplingHelperPath!" install_dumpling
237
238     :: Create the crash dump folder if necessary
239     set "__CrashDumpFolder=%tmp%\CoreCLRTestCrashDumps"
240     if not exist "!__CrashDumpFolder!" (
241         mkdir "!__CrashDumpFolder!"
242     )
243
244     :: Grab the current time before execution begins. This will be used to determine which crash dumps
245     :: will be uploaded.
246     for /f "delims=" %%a in ('python !__DumplingHelperPath! get_timestamp') do @set __StartTime=%%a
247 )
248
249 echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
250 echo %__MsgPrefix%Starting the test run ...
251
252 set __BuildLogRootName=TestRunResults
253 call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:Runtests=true /clp:showcommandline
254 set __errorlevel=%errorlevel%
255
256 if "%__CollectDumps%"=="true" (
257     python "%__DumplingHelperPath%" collect_dump %errorlevel% "%__CrashDumpFolder%" %__StartTime% "CoreCLR_Tests"
258 )
259
260 if %__errorlevel% GEQ 1 (
261     echo Test Run failed. Refer to the following:
262     echo     Html report: %__TestRunHtmlLog%
263     exit /b 1
264 )
265
266 goto TestsDone
267
268 REM =========================================================================================
269 REM ===
270 REM === Run perf tests
271 REM ===
272 REM =========================================================================================
273
274 :RunPerfTests 
275 echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%  
276 echo %__MsgPrefix%Starting the test run ...  
277
278 set __BuildLogRootName=PerfTestRunResults  
279 echo %__MsgPrefix%Running perf tests  
280 call :msbuild "%__ProjectFilesDir%\runtest.proj" /t:RunPerfTests /clp:showcommandline  
281
282 if errorlevel 1 (  
283    echo %__MsgPrefix%Test Run failed. Refer to the following:  
284    echo     Html report: %__TestRunHtmlLog%  
285 )  
286
287 goto TestsDone
288
289 REM =========================================================================================
290 REM ===
291 REM === All tests complete!
292 REM ===
293 REM =========================================================================================
294
295 :TestsDone
296
297 echo %__MsgPrefix%Test run successful. Refer to the log files for details:
298 echo     %__TestRunHtmlLog%
299 echo     %__TestRunXmlLog%
300 exit /b 0
301
302 REM =========================================================================================
303 REM ===
304 REM === Compile the managed assemblies in Core_ROOT before running the tests
305 REM ===
306 REM =========================================================================================
307
308 :PrecompileAssembly
309
310 if defined __JitDisasm goto :jitdisasm
311
312 REM Skip mscorlib since it is already precompiled.
313 if /I "%3" == "mscorlib.dll" exit /b 0
314 if /I "%3" == "mscorlib.ni.dll" exit /b 0
315
316 "%1\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" "%2" >nul 2>nul
317 set /a __exitCode = %errorlevel%
318 if "%__exitCode%" == "-2146230517" (
319     echo %2 is not a managed assembly.
320     exit /b 0
321 )
322
323 if %__exitCode% neq 0 (
324     echo Unable to precompile %2
325     exit /b 0
326 )
327     
328 echo %__MsgPrefix%Successfully precompiled %2
329 exit /b 0
330
331 :jitdisasm
332
333 if /I "%3" == "mscorlib.ni.dll" exit /b 0
334
335 echo "%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
336 "%1\corerun" "%1\jit-dasm.dll" --crossgen %1\crossgen.exe --platform %CORE_ROOT% --output %__TestWorkingDir%\dasm "%2"
337 set /a __exitCode = %errorlevel%
338
339 if "%__exitCode%" == "-2146230517" (
340     echo %2 is not a managed assembly.
341     exit /b 0
342 )
343
344 if %__exitCode% neq 0 (
345     echo Unable to precompile %2
346     exit /b 0
347 )
348
349 echo %__MsgPrefix%Successfully precompiled and generated dasm for %2
350 exit /b 0
351
352 :PrecompileFX
353 setlocal
354
355 if defined __CrossgenAltJit (
356     REM Set altjit flags for the crossgen run. Note that this entire crossgen section is within a setlocal/endlocal scope,
357     REM so we don't need to save or unset these afterwards.
358     echo %__MsgPrefix%Setting altjit environment variables for %__CrossgenAltJit%.
359     set COMPlus_AltJit=*
360     set COMPlus_AltJitNgen=*
361     set COMPlus_AltJitName=%__CrossgenAltJit%
362     set COMPlus_AltJitAssertOnNYI=1
363     set COMPlus_NoGuiOnAssert=1
364     set COMPlus_ContinueOnAssert=0
365 )
366
367 for %%F in (%CORE_ROOT%\*.dll) do call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nF%%~xF
368 endlocal
369 exit /b 0
370
371 REM =========================================================================================
372 REM ===
373 REM === Subroutine to invoke msbuild.
374 REM ===
375 REM === All arguments are passed to msbuild. The first argument should be the .proj file to invoke.
376 REM ===
377 REM === On entry, environment variable __BuildLogRootName must be set to a file name prefix for the generated log files.
378 REM === All the "standard" environment variables that aren't expected to change per invocation must also be set,
379 REM === like __msbuildCommonArgs.
380 REM ===
381 REM === The build log files will be overwritten, not appended to.
382 REM ===
383 REM =========================================================================================
384
385 :msbuild
386
387 echo %__MsgPrefix%Invoking msbuild
388
389 set "__BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
390 set "__BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
391 set "__BuildErr=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
392
393 set __msbuildLogArgs=^
394 /fileloggerparameters:Verbosity=normal;LogFile="%__BuildLog%";Append ^
395 /fileloggerparameters1:WarningsOnly;LogFile="%__BuildWrn%" ^
396 /fileloggerparameters2:ErrorsOnly;LogFile="%__BuildErr%" ^
397 /consoleloggerparameters:Summary ^
398 /verbosity:minimal
399
400 set __msbuildArgs=%* %__msbuildCommonArgs% %__msbuildLogArgs%
401
402 @REM The next line will overwrite the existing log file, if any.
403 echo %__MsgPrefix%%_msbuildexe% %__msbuildArgs%
404 echo Invoking: %_msbuildexe% %__msbuildArgs% > "%__BuildLog%"
405
406 %_msbuildexe% %__msbuildArgs%
407 if errorlevel 1 (
408     echo %__MsgPrefix%Error: msbuild failed. Refer to the log files for details:
409     echo     %__BuildLog%
410     echo     %__BuildWrn%
411     echo     %__BuildErr%
412     exit /b 1
413 )
414
415 exit /b 0
416
417 REM =========================================================================================
418 REM ===
419 REM === Set various environment variables, based on arguments to this script, before invoking the tests.
420 REM ===
421 REM =========================================================================================
422
423 :SetTestEnvironment
424
425 :: Long GC tests take about 10 minutes per test on average, so
426 :: they often bump up against the default 10 minute timeout.
427 :: 20 minutes is more than enough time for a test to complete successfully.
428 if defined __LongGCTests (
429     echo %__MsgPrefix%Running Long GC tests, extending timeout to 20 minutes
430     set __TestTimeout=1200000
431     set RunningLongGCTests=1
432 )
433
434 :: GCSimulator tests can take up to an hour to complete. They are run twice a week in the
435 :: CI, so it's fine if they take a long time.
436 if defined __GCSimulatorTests (
437     echo %__MsgPrefix%Running GCSimulator tests, extending timeout to one hour
438     set __TestTimeout=3600000
439     set RunningGCSimulatorTests=1
440 )
441
442 if defined __JitDisasm (
443     if defined __DoCrossgen (
444         echo %__MsgPrefix%Running jit disasm on framework and test assemblies
445     )
446     if not defined __DoCrossgen (
447        echo %__MsgPrefix%Running jit disasm on test assemblies only
448     )
449     set RunningJitDisasm=1
450 )
451
452 if defined __IlasmRoundTrip (
453     echo %__MsgPrefix%Running Ilasm round trip
454     set RunningIlasmRoundTrip=1
455 )
456
457 exit /b 0
458
459 REM =========================================================================================
460 REM ===
461 REM === Generate the "layout" directory in CORE_ROOT; download dependencies.
462 REM ===
463 REM =========================================================================================
464
465 :ResolveDependencies
466 set __BuildLogRootName=Tests_GenerateRuntimeLayout
467 call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true 
468 if errorlevel 1 (
469     echo %__MsgPrefix%Test Dependency Resolution Failed
470     exit /b 1
471 )
472 echo %__MsgPrefix%Created the runtime layout with all dependencies in %CORE_ROOT%
473
474 exit /b 0
475
476 REM =========================================================================================
477 REM ===
478 REM === Display a help message describing how to use this script.
479 REM ===
480 REM =========================================================================================
481
482 :Usage
483 @REM NOTE: The caret character is used to escape meta-characters known to the CMD shell. This character does
484 @REM NOTE: not appear in output. Thus, while it might look like in lines below that the "-" are not aligned,
485 @REM NOTE: they are in the output (and please keep them aligned).
486 echo.
487 echo Usage:
488 echo   %0 [options] [^<CORE_ROOT^>]
489 echo.
490 echo where:
491 echo.
492 echo./? -? /h -h /help -help   - View this message.
493 echo ^<build_architecture^>      - Specifies build architecture: x64, x86, arm, or arm64 ^(default: x64^).
494 echo ^<build_type^>              - Specifies build type: Debug, Release, or Checked ^(default: Debug^).
495 echo VSVersion ^<vs_version^>    - VS2015 or VS2017 ^(default: VS2017^).
496 echo TestEnv ^<test_env_script^> - Run a custom script before every test to set custom test environment settings.
497 echo AgainstPackages           - This indicates that we are running tests that were built against packages.
498 echo GenerateLayoutOnly        - If specified will not run the tests and will only create the Runtime Dependency Layout
499 echo sequential                - Run tests sequentially (no parallelism).
500 echo crossgen                  - Precompile ^(crossgen^) the managed assemblies in CORE_ROOT before running the tests.
501 echo crossgenaltjit ^<altjit^>   - Precompile ^(crossgen^) the managed assemblies in CORE_ROOT before running the tests, using the given altjit.
502 echo link ^<ILlink^>             - Runs the tests after linking via the IL linker ^<ILlink^>.
503 echo RunCrossgenTests          - Runs ReadytoRun tests
504 echo jitstress ^<n^>             - Runs the tests with COMPlus_JitStress=n
505 echo jitstressregs ^<n^>         - Runs the tests with COMPlus_JitStressRegs=n
506 echo jitminopts                - Runs the tests with COMPlus_JITMinOpts=1
507 echo jitforcerelocs            - Runs the tests with COMPlus_ForceRelocs=1
508 echo jitdisasm                 - Runs jit-dasm on the tests
509 echo ilasmroundtrip            - Runs ilasm round trip on the tests
510 echo longgc                    - Run the long-running GC tests
511 echo gcsimulator               - Run the GC Simulator tests
512 echo gcstresslevel ^<n^>         - Runs the tests with COMPlus_GCStress=n. n=0 means no GC Stress. Otherwise, n is a bitmask of the following:
513 echo                               1: GC on all allocations and 'easy' places
514 echo                               2: GC on transitions to preemptive GC
515 echo                               4: GC on every allowable JITed instruction
516 echo                               8: GC on every allowable NGEN instruction
517 echo                              16: GC only on a unique stack trace
518 echo tieredcompilation         - Run the tests with COMPlus_TieredCompilation=1
519 echo gcname ^<name^>             - Runs the tests with COMPlus_GCName=name
520 echo timeout ^<n^>               - Sets the per-test timeout in milliseconds ^(default is 10 minutes = 10 * 60 * 1000 = 600000^).
521 echo                             Note: some options override this ^(gcstresslevel, longgc, gcsimulator^).
522 echo msbuildargs ^<args...^>     - Pass all subsequent args directly to msbuild invocations.
523 echo ^<CORE_ROOT^>               - Path to the runtime to test ^(if specified^).
524 echo.
525 echo Note that arguments are not case-sensitive.
526 echo.
527 echo Examples:
528 echo   %0 x86 checked
529 echo   %0 x64 checked GenerateLayoutOnly
530 echo   %0 x64 release
531 exit /b 1
532
533 :NoVS
534 echo Visual Studio 2015 or 2017 ^(Community is free^) is a prerequisite to build this repository.
535 echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
536 exit /b 1