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
69 set PERFOUT=perf-%BENCHNAME%
70 set XMLOUT=%PERFOUT%-summary.xml
72 echo --- Running %BENCHNAME%
74 @rem copy benchmark and any input files
76 xcopy /s %1 . >> %RUNLOG%
77 xcopy /s %BENCHDIR%*.txt . >> %RUNLOG%
79 set CORE_ROOT=%CORECLR_REPO%\sandbox
81 xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out
83 xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out
85 @rem optionally generate results for benchview
86 if not [%BENCHVIEW_PATH%] == [] (
87 py "%BENCHVIEW_PATH%\measurement.py" xunit "perf-%BENCHNAME%.xml" --better desc --drop-first-value --append
88 REM Save off the results to the root directory for recovery later in Jenkins
89 xcopy perf-%BENCHNAME%*.xml %CORECLR_REPO%\
90 xcopy perf-%BENCHNAME%*.etl %CORECLR_REPO%\
92 type %XMLOUT% | findstr "test name"
93 type %XMLOUT% | findstr Duration
94 type %XMLOUT% | findstr InstRetired
100 IF /I [%1] == [-testBinLoc] (
101 set CORECLR_PERF=%CORECLR_REPO%\%2
106 IF /I [%1] == [-runtype] (
112 IF /I [%1] == [-library] (
113 set TEST_FILE_EXT=dll
117 IF /I [%1] == [-uploadtobenchview] (
118 set BENCHVIEW_PATH=%2
123 IF /I [%1] == [-arch] (
129 IF /I [%1] == [-configuration] (
138 if /I [%1] == [-help] (
142 if [%CORECLR_PERF%] == [] (
149 echo run-xunit-perf.cmd -testBinLoc ^<path_to_tests^> [-library] [-arch] ^<x86^|x64^> [-configuration] ^<Release^|Debug^> [-uploadToBenchview] ^<path_to_benchview_tools^> [-runtype] ^<rolling^|private^>
151 echo For the path to the tests you can pass a parent directory and the script will grovel for
152 echo all tests in subdirectories and run them.
153 echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
154 echo Architecture defaults to x64 and configuration defaults to release.
155 echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
156 echo set we will upload the results of the tests to the coreclr container in benchviewupload.
157 echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for