-
Notifications
You must be signed in to change notification settings - Fork 32
/
BuildAndTest.bat.in
76 lines (62 loc) · 1.89 KB
/
BuildAndTest.bat.in
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
@ECHO off
SET ORIGPATH=%PATH%
SET BUILD_TYPE=Release
REM Parse arguments
SET COMMAND=%0
SET TEST_MODE=%1
SHIFT
:loop
IF NOT "%1"=="" (
IF "%1"=="--test" (
SET INDIVIDUAL_TEST=%2
SHIFT
)
IF "%1"=="--track" (
SET TEST_TRACK=--track %2
SHIFT
)
SHIFT
GOTO :loop
)
REM Skip build step if continuous or individual mode
REM Skip clean build step if not nightly mode
if "%TEST_MODE%" == "-C" goto cleansuccess
if "%TEST_MODE%" == "-I" goto cleansuccess
if "%TEST_MODE%" == "" goto cleansuccess
if "%TEST_MODE%" == "-E" goto cleansuccess
ECHO Clean...
"${CMAKE_MAKE_PROGRAM}" ALL_BUILD.vcxproj /p:Configuration=Release /target:clean
IF ERRORLEVEL 1 GOTO buildfail
:cleansuccess
rem ---------------------------------------
if "%TEST_MODE%" == "" goto experimental
if "%TEST_MODE%" == "-E" goto experimental
if "%TEST_MODE%" == "-N" goto nightly
if "%TEST_MODE%" == "-C" goto continuous
if "%TEST_MODE%" == "-I" goto individual
:experimental
"${CMAKE_CTEST_COMMAND}" -C %BUILD_TYPE% -D Experimental --output-on-failure %TEST_TRACK%
goto success
:nightly
@REM Clean before the nightly build to enforce all build warnings appear on all nightly dashboard submissions
"${CMAKE_CTEST_COMMAND}" -C %BUILD_TYPE% -D Nightly %TEST_TRACK%
goto success
:continuous
"${CMAKE_CTEST_COMMAND}" -C %BUILD_TYPE% -D Continuous %TEST_TRACK%
@REM Wait for some time before continue to allow checking the results of the executions
timeout /t 15
goto success
:individual
@REM Run individual tests with regexp search
@REM Display the list of tests
"${CMAKE_CTEST_COMMAND}" -C %BUILD_TYPE% -R "%INDIVIDUAL_TEST" -N
@REM Run selected tests
"${CMAKE_CTEST_COMMAND}" -C %BUILD_TYPE% -R "%INDIVIDUAL_TEST" -V
goto success
:success
SET PATH=%ORIGPATH%
exit /b 0
:buildfail
ECHO Failed to build PlusLib
SET PATH=%ORIGPATH%
exit /b 1