1 @rem Licensed to the .NET Foundation under one or more agreements.
2 @rem The .NET Foundation licenses this file to you under the MIT license.
3 @rem See the LICENSE file in the project root for more information.
8 rem Set defaults for the file extension, architecture and configuration
12 set TEST_CONFIG=Release
18 set CORECLR_OVERLAY=%CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root
19 set RUNLOG=%CORECLR_REPO%\bin\Logs\perfrun.log
21 if NOT EXIST %CORECLR_OVERLAY% (
22 echo Can't find test overlay directory '%CORECLR_OVERLAY%'
23 echo Please build and run Release CoreCLR tests
27 @echo --- setting up sandbox
29 if exist sandbox rd /s /q sandbox
30 if exist sandbox echo ERROR: Failed to remove the sandbox folder& exit /b 1
31 if not exist sandbox mkdir sandbox
32 if not exist sandbox echo ERROR: Failed to create the sandbox folder& exit /b 1
35 @rem stage stuff we need
38 xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0040\tools\* . > %RUNLOG%
39 xcopy /sy %CORECLR_REPO%\packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0040\tools\* . >> %RUNLOG%
40 xcopy /sy %CORECLR_REPO%\packages\xunit.console.netcore\1.0.2-prerelease-00177\runtimes\any\native\* . >> %RUNLOG%
41 xcopy /sy %CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root\* . >> %RUNLOG%
43 @rem find and stage the tests
44 for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT%) do (
48 @rem optionally upload results to benchview
49 if not [%BENCHVIEW_PATH%] == [] (
50 py "%BENCHVIEW_PATH%\submission.py" measurement.json ^
51 --build ..\build.json ^
52 --machine-data ..\machinedata.json ^
53 --metadata ..\submission-metadata.json ^
56 --config-name "%TEST_CONFIG%" ^
57 --config Configuration "%TEST_CONFIG%" ^
58 --config OS "Windows_NT" ^
59 --arch "%TEST_ARCH%" ^
60 --machinepool "PerfSnake"
61 py "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
68 set PERFOUT=perf-%BENCHNAME%
69 set XMLOUT=%PERFOUT%-summary.xml
71 echo --- Running %BENCHNAME%
73 xcopy /s %1 . >> %RUNLOG%
75 set CORE_ROOT=%CORECLR_REPO%\sandbox
77 xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out
79 xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out
81 @rem optionally generate results for benchview
82 if not [%BENCHVIEW_PATH%] == [] (
83 py "%BENCHVIEW_PATH%\measurement.py" xunit "perf-%BENCHNAME%.xml" --better desc --drop-first-value --append
84 REM Save off the results to the root directory for recovery later in Jenkins
85 xcopy perf-%BENCHNAME%*.xml %CORECLR_REPO%\
86 xcopy perf-%BENCHNAME%*.etl %CORECLR_REPO%\
88 type %XMLOUT% | findstr "test name"
89 type %XMLOUT% | findstr Duration
90 type %XMLOUT% | findstr InstRetired
96 IF /I [%1] == [-testBinLoc] (
97 set CORECLR_PERF=%CORECLR_REPO%\%2
102 IF /I [%1] == [-runtype] (
108 IF /I [%1] == [-library] (
109 set TEST_FILE_EXT=dll
113 IF /I [%1] == [-uploadtobenchview] (
114 set BENCHVIEW_PATH=%2
119 IF /I [%1] == [-arch] (
125 IF /I [%1] == [-configuration] (
134 if /I [%1] == [-help] (
138 if [%CORECLR_PERF%] == [] (
145 echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-uploadToBenchview] ^<path_to_benchview_tools^> [-runtype] ^<rolling^|private^>
147 echo For the path to the tests you can pass a parent directory and the script will grovel for
148 echo all tests in subdirectories and run them.
149 echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
150 echo Architecture defaults to x64 and configuration defaults to release.
151 echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
152 echo set we will upload the results of the tests to the coreclr container in benchviewupload.
153 echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for