]> git.saurik.com Git - wxWidgets.git/commitdiff
revert 59680; implement proper fix for wxMSW test failure detection
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 21 Mar 2009 12:28:52 +0000 (12:28 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 21 Mar 2009 12:28:52 +0000 (12:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/buildbot/config/include/defs.xml
tests/runtests.bat [new file with mode: 0644]
tests/test.cpp

index 8a68746b513c475e1c8031612ae646f41c7377ef..544b5366abefa1873d92c45e8d6c7742839316d9 100644 (file)
     </test>
 </xsl:template>
 
-<!--
-    We need to add something to the wxWidgets sources to run the tests with a
-    simple command so that these aren't necessary.
--->
 <xsl:template name="run-tests-win">
     <xsl:param name="options"/>
 <normalize-space>
-cd tests &amp;&amp;
-(for /d %x in (..\lib\*_dll) do @PATH=%x;%PATH%) &amp;&amp;
-(for /d %x in (*) do @if exist %x\test.exe %x\test) &amp;&amp;
-(for /d %x in (*) do @if exist %x\test_gui.exe %x\test_gui)
+cd tests &amp;&amp; runtests.bat
 </normalize-space>
 </xsl:template>
 
diff --git a/tests/runtests.bat b/tests/runtests.bat
new file mode 100644 (file)
index 0000000..d6c7471
--- /dev/null
@@ -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
index f0c34e5526e4907438617be7a27406bc8bfd294e..afc4ad2ab546e746bf25ff38f4fa4950dc6d2de9 100644 (file)
@@ -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()