2009-03-21 08:28:52 -04:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
REM Runs wxWidgets CppUnit tests
|
|
|
|
REM This script is used to return the correct return value to the caller
|
|
|
|
REM which is required by Buildbot to recognize failures.
|
2009-03-23 10:57:10 -04:00
|
|
|
REM Note that in DOS error level is not the return code of the previous
|
|
|
|
REM command; it is for (some!) built-in DOS commands like FIND but
|
|
|
|
REM in general it's not. Thus to get the return code of the test utility
|
|
|
|
REM we need some hack; see the guide:
|
|
|
|
REM http://www.infionline.net/~wtnewton/batch/batguide.html
|
|
|
|
REM for general info about DOS batch files.
|
|
|
|
|
|
|
|
REM Author: Francesco Montorsi
|
2009-03-21 08:28:52 -04:00
|
|
|
|
2009-03-22 17:07:51 -04:00
|
|
|
rem set the path for running the tests if they use DLL build of wx
|
2009-03-22 18:08:19 -04:00
|
|
|
for /d %%x in ("..\lib\*_dll") do @set PATH=%%x;%PATH%
|
2009-03-22 17:07:51 -04:00
|
|
|
|
2009-03-21 08:28:52 -04:00
|
|
|
set failure=0
|
|
|
|
|
|
|
|
for /d %%x in (*) do @(
|
|
|
|
if exist %%x\test.exe (
|
2013-05-14 07:07:12 -04:00
|
|
|
echo.
|
|
|
|
echo ========================================================================
|
|
|
|
echo Running non-GUI unit test
|
|
|
|
echo ========================================================================
|
|
|
|
echo.
|
2013-05-12 16:34:40 -04:00
|
|
|
%%x\test.exe -t >tmp
|
2009-03-23 10:57:10 -04:00
|
|
|
|
|
|
|
REM show the output of the test in the buildbot log:
|
|
|
|
type tmp
|
|
|
|
|
|
|
|
REM hack to understand if the tests succeeded or not
|
|
|
|
REM (failure=1 is set if "OK" does not appear in the test output)
|
|
|
|
type tmp | find "OK" >NUL
|
|
|
|
if ERRORLEVEL 1 set failure=1
|
2009-03-23 06:01:13 -04:00
|
|
|
|
|
|
|
REM separe the output of the test we just executed from the next one
|
|
|
|
echo.
|
|
|
|
echo ========================================================================
|
2013-05-14 07:07:12 -04:00
|
|
|
echo Non-GUI test done
|
2009-03-23 06:01:13 -04:00
|
|
|
echo ========================================================================
|
|
|
|
echo.
|
2009-03-21 08:28:52 -04:00
|
|
|
)
|
2009-03-23 06:01:13 -04:00
|
|
|
|
2009-03-21 08:28:52 -04:00
|
|
|
if exist %%x\test_gui.exe (
|
2013-05-14 07:07:12 -04:00
|
|
|
echo.
|
|
|
|
echo ========================================================================
|
|
|
|
echo Running GUI unit test
|
|
|
|
echo ========================================================================
|
|
|
|
echo.
|
2013-05-12 16:34:40 -04:00
|
|
|
%%x\test_gui.exe -t >tmp
|
2009-03-23 10:57:10 -04:00
|
|
|
|
|
|
|
REM show the output of the test in the buildbot log:
|
|
|
|
type tmp
|
|
|
|
|
|
|
|
REM hack to understand if the tests succeeded or not
|
|
|
|
REM (failure=1 is set if "OK" does not appear in the test output)
|
|
|
|
type tmp | find "OK" >NUL
|
|
|
|
if ERRORLEVEL 1 set failure=1
|
2013-05-14 07:07:12 -04:00
|
|
|
|
|
|
|
echo.
|
|
|
|
echo ========================================================================
|
|
|
|
echo GUI test done
|
|
|
|
echo ========================================================================
|
|
|
|
echo.
|
2009-03-21 08:28:52 -04:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
REM exit with code 1 if any of the test failed
|
2009-03-23 10:57:10 -04:00
|
|
|
del tmp
|
|
|
|
if %failure% EQU 1 (
|
|
|
|
echo.
|
|
|
|
echo One or more test failed
|
|
|
|
echo.
|
|
|
|
exit 1
|
|
|
|
)
|
2009-03-21 08:28:52 -04:00
|
|
|
|
|
|
|
REM remove the failure env var:
|
|
|
|
set failure=
|
|
|
|
|
|
|
|
REM exit with code 0 (all tests passed successfully)
|
2009-03-23 06:01:13 -04:00
|
|
|
exit 0
|