]>
Commit | Line | Data |
---|---|---|
1dd8319a FM |
1 | @echo off |
2 | ||
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. | |
7749be12 FM |
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. | |
12 | ||
13 | REM Author: Francesco Montorsi | |
1dd8319a | 14 | |
ddaf7a11 | 15 | rem set the path for running the tests if they use DLL build of wx |
5c5e59f8 | 16 | for /d %%x in ("..\lib\*_dll") do @set PATH=%%x;%PATH% |
ddaf7a11 | 17 | |
1dd8319a FM |
18 | set failure=0 |
19 | ||
20 | for /d %%x in (*) do @( | |
21 | if exist %%x\test.exe ( | |
3717eeaf VZ |
22 | echo. |
23 | echo ======================================================================== | |
24 | echo Running non-GUI unit test | |
25 | echo ======================================================================== | |
26 | echo. | |
1cb4d74f | 27 | %%x\test.exe -t >tmp |
7749be12 FM |
28 | |
29 | REM show the output of the test in the buildbot log: | |
30 | type tmp | |
31 | ||
32 | REM hack to understand if the tests succeeded or not | |
33 | REM (failure=1 is set if "OK" does not appear in the test output) | |
34 | type tmp | find "OK" >NUL | |
35 | if ERRORLEVEL 1 set failure=1 | |
8405285c FM |
36 | |
37 | REM separe the output of the test we just executed from the next one | |
38 | echo. | |
8405285c | 39 | echo ======================================================================== |
3717eeaf | 40 | echo Non-GUI test done |
8405285c FM |
41 | echo ======================================================================== |
42 | echo. | |
1dd8319a | 43 | ) |
8405285c | 44 | |
1dd8319a | 45 | if exist %%x\test_gui.exe ( |
3717eeaf VZ |
46 | echo. |
47 | echo ======================================================================== | |
48 | echo Running GUI unit test | |
49 | echo ======================================================================== | |
50 | echo. | |
1cb4d74f | 51 | %%x\test_gui.exe -t >tmp |
7749be12 FM |
52 | |
53 | REM show the output of the test in the buildbot log: | |
54 | type tmp | |
55 | ||
56 | REM hack to understand if the tests succeeded or not | |
57 | REM (failure=1 is set if "OK" does not appear in the test output) | |
58 | type tmp | find "OK" >NUL | |
59 | if ERRORLEVEL 1 set failure=1 | |
3717eeaf VZ |
60 | |
61 | echo. | |
62 | echo ======================================================================== | |
63 | echo GUI test done | |
64 | echo ======================================================================== | |
65 | echo. | |
1dd8319a FM |
66 | ) |
67 | ) | |
68 | ||
69 | REM exit with code 1 if any of the test failed | |
7749be12 FM |
70 | del tmp |
71 | if %failure% EQU 1 ( | |
72 | echo. | |
73 | echo One or more test failed | |
74 | echo. | |
75 | exit 1 | |
76 | ) | |
1dd8319a FM |
77 | |
78 | REM remove the failure env var: | |
79 | set failure= | |
80 | ||
81 | REM exit with code 0 (all tests passed successfully) | |
8405285c | 82 | exit 0 |