@@ -54,6 +54,7 @@ if /i "%1" == "Exclude" (set __Exclude=%2&shift&shift&goto Arg_Loop)
54
54
if /i " %1 " == " Exclude0" (set __Exclude0=%2 & shift& shift& goto Arg_Loop)
55
55
if /i " %1 " == " TestEnv" (set __TestEnv=%2 & shift& shift& goto Arg_Loop)
56
56
if /i " %1 " == " sequential" (set __BuildSequential=1& shift& goto Arg_Loop)
57
+ if /i " %1 " == " GenerateLayoutOnly" (set __GenerateLayoutOnly=1& set __SkipWrapperGeneration=true& shift& goto Arg_Loop)
57
58
58
59
if /i not " %1 " == " msbuildargs" goto SkipMsbuildArgs
59
60
:: All the rest of the args will be collected and passed directly to msbuild.
@@ -65,6 +66,7 @@ goto CollectMsbuildArgs
65
66
:SkipMsbuildArgs
66
67
67
68
set CORE_ROOT = %1
69
+ echo %__MsgPrefix% CORE_ROOT is initially set to: " %CORE_ROOT% "
68
70
shift
69
71
:ArgsDone
70
72
@@ -126,27 +128,17 @@ if not defined __BuildSequential (
126
128
set __msbuildCommonArgs = %__msbuildCommonArgs% /maxcpucount
127
129
)
128
130
129
- if not defined CORE_ROOT (
130
- set noCore_RootSet = true
131
- set " CORE_ROOT = %__BinDir% "
132
- )
131
+ if defined CORE_ROOT goto SkipCoreRootSetup
133
132
134
- :: Check if the test Binaries are built
135
- if not exist %XunitTestBinBase% (
136
- echo %__MsgPrefix% Error: Ensure the Test Binaries are built and are present at %XunitTestBinBase% .
137
- echo %__MsgPrefix% Run " buildtest.cmd %__BuildArch% %__BuildType% " to build the tests first.
138
- exit /b 1
139
- )
133
+ set " CORE_ROOT = %XunitTestBinBase% \Tests\Core_Root "
134
+ echo %__MsgPrefix% Using Default CORE_ROOT as %CORE_ROOT%
135
+ echo %__MsgPrefix% Copying Built binaries from %__BinDir% to %CORE_ROOT%
136
+ if exist " %CORE_ROOT% " rd /s /q " %CORE_ROOT% "
137
+ md " %CORE_ROOT% "
138
+ xcopy /s " %__BinDir% " " %CORE_ROOT% "
140
139
141
- if " %CORE_ROOT% " == " " (
142
- echo %__MsgPrefix% Error: Ensure you have done a successful build of the Product and Run - runtest BuildArch BuildType {path to product binaries}.
143
- exit /b 1
144
- )
140
+ :SkipCoreRootSetup
145
141
146
- if not exist %CORE_ROOT% \coreclr.dll (
147
- echo %__MsgPrefix% Error: Ensure you have done a successful build of the Product and %CORE_ROOT% contains runtime binaries.
148
- exit /b 1
149
- )
150
142
151
143
if defined __Exclude (if not exist %__Exclude% echo %__MsgPrefix% Error: Exclusion .targets file not found && exit /b 1)
152
144
if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix% Error: Test Environment script not found && exit /b 1)
@@ -155,39 +147,37 @@ REM These log files are created automatically by the test run process. Q: what d
155
147
set __TestRunHtmlLog = %__LogsDir% \TestRun_%__BuildOS% __%__BuildArch% __%__BuildType% .html
156
148
set __TestRunXmlLog = %__LogsDir% \TestRun_%__BuildOS% __%__BuildArch% __%__BuildType% .xml
157
149
158
- echo %__MsgPrefix% CORE_ROOT that will be used is: %CORE_ROOT%
159
- echo %__MsgPrefix% Starting the test run ...
160
150
161
151
if " %__SkipWrapperGeneration% " == " true" goto SkipWrapperGeneration
162
152
163
153
set __BuildLogRootName = Tests_XunitWrapper
164
- call :msbuild " %__ProjectFilesDir% \runtest.proj" /p:NoRun =true
154
+ call :msbuild " %__ProjectFilesDir% \runtest.proj" /p:BuildWrappers =true
165
155
if errorlevel 1 exit /b 1
166
156
167
157
:SkipWrapperGeneration
168
158
169
- if not " %noCore_RootSet% " == " true " goto SkipCoreRootSetup
159
+ call : ResolveDependecies
170
160
171
- set " CORE_ROOT = %XunitTestBinBase% \Tests\Core_Root"
172
- echo %__MsgPrefix% Using Default CORE_ROOT as %CORE_ROOT%
173
- echo %__MsgPrefix% Copying Built binaries from %__BinDir% to %CORE_ROOT%
174
- if exist " %CORE_ROOT% " rd /s /q " %CORE_ROOT% "
175
- md " %CORE_ROOT% "
176
- xcopy /s " %__BinDir% " " %CORE_ROOT% "
161
+ if defined __GenerateLayoutOnly (
162
+ exit /b 1
163
+ )
177
164
178
- :SkipCoreRootSetup
165
+ if not exist %CORE_ROOT% \coreclr.dll (
166
+ echo %__MsgPrefix% Error: Ensure you have done a successful build of the Product and %CORE_ROOT% contains runtime binaries.
167
+ exit /b 1
168
+ )
179
169
180
- :: Pull down dependent packages needed for testing
181
- setlocal
182
- if defined __TestEnv call %__TestEnv%
183
- if defined COMPlus_GCStress set __Result = true
184
- endlocal & set __IsGCTest = %__Result%
185
- if " %__IsGCTest% " == " true" (
186
- call tests\setup-runtime-dependencies.cmd /outputdir %CORE_ROOT%
170
+ :: Check if the test Binaries are built
171
+ if not exist %XunitTestBinBase% (
172
+ echo %__MsgPrefix% Error: Ensure the Test Binaries are built and are present at %XunitTestBinBase% .
173
+ echo %__MsgPrefix% Run " buildtest.cmd %__BuildArch% %__BuildType% " to build the tests first.
174
+ exit /b 1
187
175
)
176
+ echo %__MsgPrefix% CORE_ROOT that will be used is: %CORE_ROOT%
177
+ echo %__MsgPrefix% Starting the test run ...
188
178
189
179
set __BuildLogRootName = TestRunResults
190
- call :msbuild " %__ProjectFilesDir% \runtest.proj" /p:NoBuild =true /clp:showcommandline
180
+ call :msbuild " %__ProjectFilesDir% \runtest.proj" /p:Runtests =true /clp:showcommandline
191
181
192
182
if errorlevel 1 (
193
183
echo Test Run failed. Refer to the following:
@@ -252,6 +242,29 @@ if errorlevel 1 (
252
242
253
243
exit /b 0
254
244
245
+ :ResolveDependecies:
246
+
247
+ if " %CORE_ROOT% " == " " (
248
+ echo %__MsgPrefix% Error: Ensure you have done a successful build of the Product and Run - runtest BuildArch BuildType {path to product binaries}.
249
+ exit /b 1
250
+ )
251
+ :: Pull down dependent packages needed for testing
252
+ setlocal
253
+ if defined __TestEnv call %__TestEnv%
254
+ if defined COMPlus_GCStress set __Result = true
255
+ endlocal & set __IsGCTest = %__Result%
256
+ if " %__IsGCTest% " == " true" (
257
+ call tests\setup-runtime-dependencies.cmd /outputdir %CORE_ROOT%
258
+ )
259
+ call :msbuild " %__ProjectFilesDir% \runtest.proj" /p:GeneraRuntimeLayout=true
260
+ echo %__MsgPrefix% Created the runtime layout with all dependencies in:%CORE_ROOT%
261
+ exit /b 0
262
+
263
+ if errorlevel 1 (
264
+ echo Test Depenedevy Resolution Failed
265
+ exit /b 1
266
+ )
267
+
255
268
:Usage
256
269
echo .
257
270
echo Usage:
@@ -267,6 +280,7 @@ echo Set to "" to disable default exclusion file.
267
280
echo Exclude- Optional parameter - this will exclude individual tests from running, specified by ExcludeList ItemGroup in an .targets file.
268
281
echo TestEnv- Optional parameter - this will run a custom script to set custom test environment settings.
269
282
echo VSVersion- Optional parameter - VS2013 or VS2015 ^ (default: VS2015^ )
283
+ echo GenerateLayoutOnly - If specified will not run the tests and will only create the Runtime Dependency Layout
270
284
echo CORE_ROOT The path to the runtime
271
285
exit /b 1
272
286
0 commit comments