From 1dd8319ab9a5a3ccf69329f098a5d9018504c15f Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sat, 21 Mar 2009 12:28:52 +0000 Subject: [PATCH] revert 59680; implement proper fix for wxMSW test failure detection git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/buildbot/config/include/defs.xml | 9 +-------- tests/runtests.bat | 28 ++++++++++++++++++++++++++ tests/test.cpp | 4 ++-- 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 tests/runtests.bat diff --git a/build/buildbot/config/include/defs.xml b/build/buildbot/config/include/defs.xml index 8a68746b51..544b5366ab 100644 --- a/build/buildbot/config/include/defs.xml +++ b/build/buildbot/config/include/defs.xml @@ -356,17 +356,10 @@ - -cd tests && -(for /d %x in (..\lib\*_dll) do @PATH=%x;%PATH%) && -(for /d %x in (*) do @if exist %x\test.exe %x\test) && -(for /d %x in (*) do @if exist %x\test_gui.exe %x\test_gui) +cd tests && runtests.bat diff --git a/tests/runtests.bat b/tests/runtests.bat new file mode 100644 index 0000000000..d6c747187e --- /dev/null +++ b/tests/runtests.bat @@ -0,0 +1,28 @@ +@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. +REM $Id$ + +set failure=0 + +for /d %%x in (*) do @( + if exist %%x\test.exe ( + %%x\test.exe + if %errorlevel% GEQ 1 set failure=1 + ) + if exist %%x\test_gui.exe ( + %%x\test_gui.exe + if %errorlevel% GEQ 1 set failure=1 + ) +) + +REM exit with code 1 if any of the test failed +if %failure% EQU 1 exit 1 + +REM remove the failure env var: +set failure= + +REM exit with code 0 (all tests passed successfully) +exit 0 diff --git a/tests/test.cpp b/tests/test.cpp index f0c34e5526..afc4ad2ab5 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -255,7 +255,7 @@ int TestApp::OnRun() } if ( m_list ) - return 0; + return EXIT_SUCCESS; runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), cout)); @@ -279,7 +279,7 @@ int TestApp::OnRun() if ( m_detail || m_timing ) runner.eventManager().addListener(&detailListener); - return runner.run("", false, true, !verbose) ? 0 : 1; + return runner.run("", false, true, !verbose) ? EXIT_SUCCESS : EXIT_FAILURE; } int TestApp::OnExit() -- 2.47.2