diff options
author | Pat Gavlin <pgavlin@gmail.com> | 2017-03-16 11:49:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-16 11:49:26 -0700 |
commit | 0d02d3bc5cab6ea40c4c431cbbcc7e14a5332835 (patch) | |
tree | 7690b6bc973e1d4c2e9e7c8810b92fb05fff03fd /tests/runtest.cmd | |
parent | 7d8e1382eea401386890bc38065fa9b8ef76141e (diff) | |
parent | 6f30002fc917cdacd4d0565f05ded920ab17f830 (diff) | |
download | coreclr-0d02d3bc5cab6ea40c4c431cbbcc7e14a5332835.tar.gz coreclr-0d02d3bc5cab6ea40c4c431cbbcc7e14a5332835.tar.bz2 coreclr-0d02d3bc5cab6ea40c4c431cbbcc7e14a5332835.zip |
Merge pull request #10214 from pgavlin/TimeoutCrashDumps
Take crash dumps for timed-out tests.
Diffstat (limited to 'tests/runtest.cmd')
-rw-r--r-- | tests/runtest.cmd | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/runtest.cmd b/tests/runtest.cmd index aa95f890df..d7f5713abd 100644 --- a/tests/runtest.cmd +++ b/tests/runtest.cmd @@ -44,6 +44,7 @@ set __LongGCTests= set __GCSimulatorTests= set __AgainstPackages= set __JitDisasm= +set __CollectDumps= :Arg_Loop if "%1" == "" goto ArgsDone @@ -84,6 +85,7 @@ if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift 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" == "collectdumps" (set __CollectDumps=true&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. @@ -207,6 +209,23 @@ if not exist %XunitTestBinBase% ( echo %__MsgPrefix%Run "buildtest.cmd %__BuildArch% %__BuildType%" to build the tests first. exit /b 1 ) + +if "%__CollectDumps%"=="true" ( + :: Install dumpling + set "__DumplingHelperPath=%__ProjectDir%\..\Tools\DumplingHelper.py" + python "!__DumplingHelperPath!" install_dumpling + + :: Create the crash dump folder if necessary + set "__CrashDumpFolder=%tmp%\CoreCLRTestCrashDumps" + if not exist "!__CrashDumpFolder!" ( + mkdir "!__CrashDumpFolder!" + ) + + :: Grab the current time before execution begins. This will be used to determine which crash dumps + :: will be uploaded. + for /f "delims=" %%a in ('python !__DumplingHelperPath! get_timestamp') do @set __StartTime=%%a +) + echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT% echo %__MsgPrefix%Starting the test run ... @@ -215,6 +234,10 @@ del %CORE_ROOT%\mscorlib.ni.dll set __BuildLogRootName=TestRunResults call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:Runtests=true /clp:showcommandline +if "%__CollectDumps%"=="true" ( + python "%__DumplingHelperPath%" collect_dump %errorlevel% "%__CrashDumpFolder%" %__StartTime% "CoreCLR_Tests" +) + if errorlevel 1 ( echo Test Run failed. Refer to the following: echo Html report: %__TestRunHtmlLog% |