3 REM Runs wxWidgets CppUnit tests
4 REM This script is used to return the correct return value to the caller
5 REM which is required by Buildbot to recognize failures.
6 REM Note that in DOS error level is not the return code of the previous
7 REM command; it is for (some!) built-in DOS commands like FIND but
8 REM in general it's not. Thus to get the return code of the test utility
9 REM we need some hack; see the guide:
10 REM http://www.infionline.net/~wtnewton/batch/batguide.html
11 REM for general info about DOS batch files.
13 REM Author: Francesco Montorsi
16 rem set the path for running the tests if they use DLL build of wx
17 for /d
%%x in
("..\lib\*_dll") do @
set PATH=%%x
;%PATH%
21 for /d
%%x in
(*) do @
(
22 if exist %%x
\test.exe
(
24 echo ========================================================================
25 echo Running non
-GUI unit test
26 echo ========================================================================
30 REM show the output of the test in the buildbot log
:
33 REM hack to understand
if the tests succeeded or
not
34 REM
(failure
=1 is
set if "OK" does
not appear in the test output
)
35 type tmp |
find "OK" >NUL
36 if ERRORLEVEL 1 set failure
=1
38 REM separe the output of the test we just executed from the next one
40 echo ========================================================================
41 echo Non
-GUI test done
42 echo ========================================================================
46 if exist %%x
\test_gui.exe
(
48 echo ========================================================================
49 echo Running GUI unit test
50 echo ========================================================================
52 %%x
\test_gui.exe
-t
>tmp
54 REM show the output of the test in the buildbot log
:
57 REM hack to understand
if the tests succeeded or
not
58 REM
(failure
=1 is
set if "OK" does
not appear in the test output
)
59 type tmp |
find "OK" >NUL
60 if ERRORLEVEL 1 set failure
=1
63 echo ========================================================================
65 echo ========================================================================
70 REM exit with code 1 if any of the test failed
74 echo One or more test failed
79 REM remove the failure env var:
82 REM exit with code 0 (all tests passed successfully)