[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5210] Return success when unit test succeeds
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5210] Return success when unit test succeeds |
Date: |
Mon, 20 Jun 2011 16:13:39 +0000 |
Revision: 5210
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5210
Author: chicares
Date: 2011-06-20 16:13:39 +0000 (Mon, 20 Jun 2011)
Log Message:
-----------
Return success when unit test succeeds
Modified Paths:
--------------
skeleton/trunk/main_wx.cpp
Modified: skeleton/trunk/main_wx.cpp
===================================================================
--- skeleton/trunk/main_wx.cpp 2011-06-16 11:19:28 UTC (rev 5209)
+++ skeleton/trunk/main_wx.cpp 2011-06-20 16:13:39 UTC (rev 5210)
@@ -430,55 +430,23 @@
if(run_unit_tests_and_exit_immediately_)
{
MvcTest(frame_, 0).Test();
- // The wx documentation for OnInit() says "Return true to
- // continue processing, false to exit the application
- // immediately." Then, however, upon exit, MinGW gdb displays
- // this message:
- // warning: [timestamp]: Debug:
- // In file ../../src/msw/app.cpp at line 447:
- // 'UnregisterClass(no redraw MDI parent frame)' failed
- // with error 0x00000584 (class still has open windows.).
- //
- // The wx documentation for OnExit() says "Note that it is not
- // called at all if OnInit failed." Experimentally, try
- // calling it explicitly, even though that seems weird.
-// OnExit();
- // That doesn't help: the same message is displayed.
-// wxApp::OnExit();
- // Same outcome again.
- //
- // This doesn't prevent that message either:
-// ExitMainLoop();
- // But the wx documentation for ExitMainLoop() says "You
- // should normally exit the main loop (and the application)
- // by deleting the top window.
-// delete GetTopWindow();
- // That does seem to work, but explicitly to delete a window
- // managed by wx seems strange. And the wx documentation says
- // "When deleting a frame or dialog, use Destroy rather than
- // delete", so instead try:
-// GetTopWindow()->Destroy();
- // That seems to work as well. However, the wx documentation
- // elsewhere suggests using Close() instead: "The advantage of
- // using Close instead of Destroy is that it will call any
- // clean-up code defined by the EVT_CLOSE handler; for example
- // it may close a document contained in a window after first
- // asking the user whether the work should be saved.
- GetTopWindow()->Close();
- // That seems to work as well, and seems best of all according
- // to the wx documentation.
-
- return false;
}
+ else
+ {
+ wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, wxID_ABOUT);
+ wxPostEvent(frame_, event);
+ }
- wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, wxID_ABOUT);
- wxPostEvent(frame_, event);
-
return true;
}
int Skeleton::OnRun()
{
+ if(run_unit_tests_and_exit_immediately_)
+ {
+ return EXIT_SUCCESS;
+ }
+
int result = EXIT_FAILURE;
try
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5210] Return success when unit test succeeds,
Greg Chicares <=