blob: 76b81430e1f5e3a88cf540c5efc1b41302bba9ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
@if not defined __echo @echo off
setlocal EnableDelayedExpansion
:: Set the default arguments
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT
:: Default to highest Visual Studio version available
set __VSVersion=vs2017
set __VSProductVersion=150
:: Define a prefix for most output progress messages that come from this script. That makes
:: it easier to see where these are coming from. Note that there is a trailing space here.
set __MsgPrefix=RUNTEST:
set __ProjectDir=%~dp0
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__RootBinDir=%__ProjectDir%\..\bin"
set "__LogsDir=%__RootBinDir%\Logs"
:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage
if /i "%1" == "-?" goto Usage
if /i "%1" == "/h" goto Usage
if /i "%1" == "-h" goto Usage
if /i "%1" == "/help" goto Usage
if /i "%1" == "-help" goto Usage
if /i "%1" == "x64" (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop)
if /i "%1" == "x86" (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop)
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
if /i "%1" == "LogsDir" (set __LogsDir=%2&shift&shift&goto Arg_Loop)
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
set CORE_ROOT=%1
echo %__MsgPrefix%CORE_ROOT is initially set to: "%CORE_ROOT%"
shift
:ArgsDone
set "__TestWorkingDir=%CoreRT_TestRoot\CoreFX%"
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
if not exist %__LogsDir% md %__LogsDir%
:: Check presence of VS
if not defined VS%__VSProductVersion%COMNTOOLS goto NoVS
set __VSToolsRoot=!VS%__VSProductVersion%COMNTOOLS!
if %__VSToolsRoot:~-1%==\ set "__VSToolsRoot=%__VSToolsRoot:~0,-1%"
:: Set the environment for the build- VS cmd prompt
echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat"
call "%__VSToolsRoot%\VsDevCmd.bat"
if not defined VSINSTALLDIR (
echo %__MsgPrefix%Error: runtest.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
exit /b 1
)
if not defined FXCustomTestLauncher (
echo The CoreFX test launcher is not defined
exit /b 1
)
set SAVED_ERROR_LEVEL=0
:: Iterate through unzipped CoreFX tests
for /D %%i in ("%XunitTestBinBase%\*" ) do (
set TestFolderName=%%i
set TestFileName=%%~nxi
echo %FXCustomTestLauncher% !TestFolderName! !TestFileName!
call %FXCustomTestLauncher% !TestFolderName! !TestFileName!
set TestExitCode=!errorlevel!
if !TestExitCode! neq 0 (
echo Test !TestFileName! failed with !TestExitCode!
set SAVED_ERROR_LEVEL=!TestExitCode!
)
)
exit /b !SAVED_ERROR_LEVEL!
:Usage
echo.
echo Usage:
echo %0 BuildArch BuildType
echo where:
echo.
echo./? -? /h -h /help -help: view this message.
echo BuildArch- Optional parameter - x64 or x86 ^(default: x64^).
echo BuildType- Optional parameter - Debug, Release, or Checked ^(default: Debug^).
exit /b 1
:NoVS
echo Visual Studio 2017 ^(Community is free^) is a prerequisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1
|