forked from sakura-editor/sakura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-tests.bat
44 lines (36 loc) · 962 Bytes
/
run-tests.bat
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
@echo off
set platform=%1
set configuration=%2
set TEST_LAUNCHED=0
set ERROR_RESULT=0
if defined APPVEYOR (
set FILTER_BAT=%~dp0test_result_filter_tell_AppVeyor.bat
)
set BUILDDIR=build\%platform%
set BINARY_DIR=%~dp0%BUILDDIR%\unittests\%platform%\%configuration%
pushd %BINARY_DIR%
for /r %%i in (tests*.exe) do (
set TEST_LAUNCHED=1
call :RunTest %%i %%i-googletest-%platform%-%configuration%.xml || set ERROR_RESULT=1
)
popd
if "%TEST_LAUNCHED%" == "0" (
@echo ERROR: no tests are available.
exit /b 1
)
if "%ERROR_RESULT%" == "1" (
@echo ERROR
exit /b 1
)
exit /b 0
:RunTest
set EXEPATH=%1
set XMLPATH=%2
if defined FILTER_BAT (
@echo %EXEPATH% --gtest_output=xml:%XMLPATH% ^| "%FILTER_BAT%"
%EXEPATH% --gtest_output=xml:%XMLPATH% | "%FILTER_BAT%" || set TEMP_RESULT=1
) else (
@echo %EXEPATH% --gtest_output=xml:%XMLPATH%
%EXEPATH% --gtest_output=xml:%XMLPATH% || set TEMP_RESULT=1
)
exit /b %TEMP_RESULT%