]> git.saurik.com Git - wxWidgets.git/blame - tests/runtests.bat
Make wxMSW wxSpinCtrl "not enough space" messages more helpful.
[wxWidgets.git] / tests / runtests.bat
CommitLineData
1dd8319a
FM
1@echo off
2
3REM Runs wxWidgets CppUnit tests
4REM This script is used to return the correct return value to the caller
5REM which is required by Buildbot to recognize failures.
7749be12
FM
6REM Note that in DOS error level is not the return code of the previous
7REM command; it is for (some!) built-in DOS commands like FIND but
8REM in general it's not. Thus to get the return code of the test utility
9REM we need some hack; see the guide:
10REM http://www.infionline.net/~wtnewton/batch/batguide.html
11REM for general info about DOS batch files.
12
13REM Author: Francesco Montorsi
1dd8319a
FM
14REM $Id$
15
ddaf7a11 16rem set the path for running the tests if they use DLL build of wx
5c5e59f8 17for /d %%x in ("..\lib\*_dll") do @set PATH=%%x;%PATH%
ddaf7a11 18
1dd8319a
FM
19set failure=0
20
21for /d %%x in (*) do @(
22 if exist %%x\test.exe (
3717eeaf
VZ
23 echo.
24 echo ========================================================================
25 echo Running non-GUI unit test
26 echo ========================================================================
27 echo.
1cb4d74f 28 %%x\test.exe -t >tmp
7749be12
FM
29
30 REM show the output of the test in the buildbot log:
31 type tmp
32
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
8405285c
FM
37
38 REM separe the output of the test we just executed from the next one
39 echo.
8405285c 40 echo ========================================================================
3717eeaf 41 echo Non-GUI test done
8405285c
FM
42 echo ========================================================================
43 echo.
1dd8319a 44 )
8405285c 45
1dd8319a 46 if exist %%x\test_gui.exe (
3717eeaf
VZ
47 echo.
48 echo ========================================================================
49 echo Running GUI unit test
50 echo ========================================================================
51 echo.
1cb4d74f 52 %%x\test_gui.exe -t >tmp
7749be12
FM
53
54 REM show the output of the test in the buildbot log:
55 type tmp
56
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
3717eeaf
VZ
61
62 echo.
63 echo ========================================================================
64 echo GUI test done
65 echo ========================================================================
66 echo.
1dd8319a
FM
67 )
68)
69
70REM exit with code 1 if any of the test failed
7749be12
FM
71del tmp
72if %failure% EQU 1 (
73 echo.
74 echo One or more test failed
75 echo.
76 exit 1
77)
1dd8319a
FM
78
79REM remove the failure env var:
80set failure=
81
82REM exit with code 0 (all tests passed successfully)
8405285c 83exit 0