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.
This commit is contained in:
Vadim Zeitlin
2015-04-12 17:51:30 +02:00
parent e8d969244e
commit 3e67b1ef68

View File

@@ -336,13 +336,15 @@ public:
event.Skip(); event.Skip();
} }
#else // !wxUSE_GUI
virtual int OnRun() virtual int OnRun()
{ {
m_exitcode = RunTests(); if ( TestAppBase::OnRun() != 0 )
m_exitcode = EXIT_FAILURE;
return m_exitcode; return m_exitcode;
} }
#endif // wxUSE_GUI/!wxUSE_GUI #endif // wxUSE_GUI
private: private:
void List(Test *test, const string& parent = "") const; void List(Test *test, const string& parent = "") const;
@@ -715,7 +717,7 @@ int TestApp::OnExit()
delete GetTopWindow(); delete GetTopWindow();
#endif // wxUSE_GUI #endif // wxUSE_GUI
return m_exitcode; return TestAppBase::OnExit();
} }
// List the tests // List the tests