5
5
@ setlocal
6
6
@ echo off
7
7
8
- set HERE = %CD%
8
+ rem Set defaults for the file extension, architecture and configuration
9
9
set CORECLR_REPO = %CD%
10
- set CORECLR_OVERLAY = %CORECLR_REPO% \bin\tests\Windows_NT.x64.Release\Tests\Core_Root
11
- set CORECLR_PERF = %CORECLR_REPO% \bin\tests\Windows_NT.x64.Release\Jit\Performance\CodeQuality
12
- set RUNLOG = %HERE% \bin\Logs\perfrun.log
10
+ set TEST_FILE_EXT = exe
11
+ set TEST_ARCH = x64
12
+ set TEST_CONFIG = Release
13
+
14
+ goto :ARGLOOP
15
+
16
+ :SETUP
17
+
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
13
20
14
21
if NOT EXIST %CORECLR_OVERLAY% (
15
22
echo Can't find test overlay directory '%CORECLR_OVERLAY% '
16
23
echo Please build and run Release CoreCLR tests
17
24
exit /B 1
18
25
)
19
26
20
- :SETUP
21
-
22
27
@ echo --- setting up sandbox
23
28
24
29
rd /s /q sandbox
@@ -28,35 +33,113 @@ pushd sandbox
28
33
@ rem stage stuff we need
29
34
30
35
@ rem xunit and perf
31
- xcopy /sy %CORECLR_REPO% \packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0035 \tools\* . > %RUNLOG%
32
- xcopy /sy %CORECLR_REPO% \packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0035 \tools\* . > %RUNLOG%
33
- xcopy /sy %CORECLR_REPO% \packages\xunit.console.netcore\1.0.2-prerelease-00101 \runtimes\any\native\* . > %RUNLOG%
34
- xcopy /sy %CORECLR_REPO% \bin\tests\Windows_NT.x64.Release \Tests\Core_Root\* . > %RUNLOG%
36
+ xcopy /sy %CORECLR_REPO% \packages\Microsoft.DotNet.xunit.performance.runner.Windows\1.0.0-alpha-build0040 \tools\* . > %RUNLOG%
37
+ xcopy /sy %CORECLR_REPO% \packages\Microsoft.DotNet.xunit.performance.analysis\1.0.0-alpha-build0040 \tools\* . > > %RUNLOG%
38
+ xcopy /sy %CORECLR_REPO% \packages\xunit.console.netcore\1.0.2-prerelease-00177 \runtimes\any\native\* . > > %RUNLOG%
39
+ xcopy /sy %CORECLR_REPO% \bin\tests\Windows_NT.%TEST_ARCH% . %TEST_CONFIG% \Tests\Core_Root\* . > > %RUNLOG%
35
40
36
41
@ rem find and stage the tests
37
-
38
- for /R %CORECLR_PERF% %%T in (*.exe) do (
42
+ for /R %CORECLR_PERF% %%T in (*.%TEST_FILE_EXT% ) do (
39
43
call :DOIT %%T
40
44
)
41
45
42
46
goto :EOF
43
47
44
48
:DOIT
45
-
46
49
set BENCHNAME = %~n1
47
50
set PERFOUT = perf-%BENCHNAME%
48
51
set XMLOUT = %PERFOUT% -summary.xml
49
52
50
53
echo --- Running %BENCHNAME%
51
54
52
- xcopy /s %1 . > %RUNLOG%
55
+ xcopy /s %1 . >> %RUNLOG%
53
56
54
- set CORE_ROOT = %HERE % \sandbox
57
+ set CORE_ROOT = %CORECLR_REPO % \sandbox
55
58
56
- xunit.performance.run.exe %BENCHNAME% .exe -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME% .out
59
+ xunit.performance.run.exe %BENCHNAME% .%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME% .out
57
60
58
61
xunit.performance.analysis.exe %PERFOUT% .xml -xml %XMLOUT% > %BENCHNAME% -analysis.out
59
62
60
- type %XMLOUT% | findstr " test name"
61
- type %XMLOUT% | findstr Duration
62
- type %XMLOUT% | findstr InstRetired
63
+ @ rem optionally upload results to benchview
64
+ if not [%BENCHVIEW_PATH% ] == [] (
65
+ py %BENCHVIEW_PATH% \measurement.py xunit perf-Perflab.xml --better desc --drop-first-value
66
+ py %BENCHVIEW_PATH% \submission.py measurement.json ^
67
+ --build ..\build.json ^
68
+ --machine-data ..\machinedata.json ^
69
+ --metadata ..\submission-metadata.json ^
70
+ --group " CoreCLR" ^
71
+ --type " %RUN_TYPE% " ^
72
+ --config-name " %TEST_CONFIG% " ^
73
+ --config Configuration " %TEST_CONFIG% " ^
74
+ --config OS " Windows_NT" ^
75
+ --arch " %TEST_ARCH% " ^
76
+ --machinepool " PerfSnake"
77
+ py %BENCHVIEW_PATH% \upload.py submission.json --container coreclr
78
+ ) else (
79
+ type %XMLOUT% | findstr " test name"
80
+ type %XMLOUT% | findstr Duration
81
+ type %XMLOUT% | findstr InstRetired
82
+ )
83
+
84
+ goto :EOF
85
+
86
+ :ARGLOOP
87
+ IF /I [%1 ] == [-testBinLoc] (
88
+ set CORECLR_PERF = %CORECLR_REPO% \%2
89
+ shift
90
+ shift
91
+ goto :ARGLOOP
92
+ )
93
+ IF /I [%1 ] == [-runtype] (
94
+ set RUN_TYPE = %2
95
+ shift
96
+ shift
97
+ goto :ARGLOOP
98
+ )
99
+ IF /I [%1 ] == [-library] (
100
+ set TEST_FILE_EXT = dll
101
+ shift
102
+ goto :ARGLOOP
103
+ )
104
+ IF /I [%1 ] == [-uploadtobenchview] (
105
+ set BENCHVIEW_PATH = %2
106
+ shift
107
+ shift
108
+ goto :ARGLOOP
109
+ )
110
+ IF /I [%1 ] == [-arch] (
111
+ set TEST_ARCH = %2
112
+ shift
113
+ shift
114
+ goto :ARGLOOP
115
+ )
116
+ IF /I [%1 ] == [-configuration] (
117
+ set TEST_CONFIG = %2
118
+ shift
119
+ shift
120
+ goto :ARGLOOP
121
+ )
122
+ if /I [%1 ] == [-?] (
123
+ goto :USAGE
124
+ )
125
+ if /I [%1 ] == [-help] (
126
+ goto :USAGE
127
+ )
128
+
129
+ if [%CORECLR_PERF% ] == [] (
130
+ goto :USAGE
131
+ )
132
+
133
+ goto :SETUP
134
+
135
+ :USAGE
136
+ echo run-xunit-perf.cmd -testBinLoc ^ < path_to_tests^ > [-library] [-arch] ^ < x86^ |x64^ > [-configuration] ^ < Release^ |Debug^ > [-uploadToBenchview] ^ < path_to_benchview_tools^ > [-runtype] ^ < rolling^ |private^ >
137
+
138
+ echo For the path to the tests you can pass a parent directory and the script will grovel for
139
+ echo all tests in subdirectories and run them.
140
+ echo The library flag denotes whether the tests are build as libraries (.dll) or an executable (.exe)
141
+ echo Architecture defaults to x64 and configuration defaults to release.
142
+ echo -uploadtoBenchview is used to specify a path to the Benchview tooling and when this flag is
143
+ echo set we will upload the results of the tests to the coreclr container in benchviewupload.
144
+ echo Runtype sets the runtype that we upload to Benchview, rolling for regular runs, and private for
145
+ echo PRs.
0 commit comments