From 3e67b1ef6801f146c0d7463cab316bf8053469f2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Apr 2015 17:51:30 +0200 Subject: [PATCH] Fix the unit test suite exit code in case of failure. Return the program exit code from the (overridden) OnRun(), not OnExit(), doing it from the latter didn't work since many years. The failures in the GUI tests will be detected by buildbot now. --- tests/test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test.cpp b/tests/test.cpp index f9afd65ad6..abd3bba7e9 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -336,13 +336,15 @@ public: event.Skip(); } -#else // !wxUSE_GUI + virtual int OnRun() { - m_exitcode = RunTests(); + if ( TestAppBase::OnRun() != 0 ) + m_exitcode = EXIT_FAILURE; + return m_exitcode; } -#endif // wxUSE_GUI/!wxUSE_GUI +#endif // wxUSE_GUI private: void List(Test *test, const string& parent = "") const; @@ -715,7 +717,7 @@ int TestApp::OnExit() delete GetTopWindow(); #endif // wxUSE_GUI - return m_exitcode; + return TestAppBase::OnExit(); } // List the tests