From 2d7875c9268f61aee195cac60f86db5a04681fc9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Apr 2015 18:21:47 +0200 Subject: [PATCH] Restore OnRun() in the non-GUI unit test suite. Commit 3e67b1ef6801f146c0d7463cab316bf8053469f2 broke the test suite in non-GUI case, we still need to override OnRun() then to run the tests. Also make it more clear that m_exitcode is only used in the GUI case. --- tests/test.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test.cpp b/tests/test.cpp index abd3bba7e9..97d12d75ec 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -344,7 +344,12 @@ public: return m_exitcode; } -#endif // wxUSE_GUI +#else // !wxUSE_GUI + virtual int OnRun() + { + return RunTests(); + } +#endif // wxUSE_GUI/!wxUSE_GUI private: void List(Test *test, const string& parent = "") const; @@ -375,8 +380,10 @@ private: FilterEventFunc m_filterEventFunc; ProcessEventFunc m_processEventFunc; +#if wxUSE_GUI // the program exit code int m_exitcode; +#endif // wxUSE_GUI }; IMPLEMENT_APP_NO_MAIN(TestApp) @@ -512,7 +519,9 @@ TestApp::TestApp() m_locale = NULL; +#if wxUSE_GUI m_exitcode = EXIT_SUCCESS; +#endif // wxUSE_GUI } // Init