forked from microsoft/Vipr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cmd
35 lines (27 loc) · 1.14 KB
/
test.cmd
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
@echo off
setlocal
:: Check prerequisites
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see https://github.com/Microsoft/vipr/wiki/Developer%%20Guide for test instructions. && exit /b 2
:: Log test command line
set _testprefix=echo
set _testpostfix=^> "%~dp0test.log"
call :test %*
:: Test
set _testprefix=
set _testpostfix=
call :test %*
goto :AfterTest
:test
%_testprefix% %_msbuildexe% "%~dp0test.proj" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0test.log";Append %* %_testpostfix%
set TESTERRORLEVEL=%ERRORLEVEL%
goto :eof
:AfterTest
echo.
:: Pull the test summary from the log file
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%~dp0test.log"
echo Test Exit Code = %TESTERRORLEVEL%
exit /b %TESTERRORLEVEL%