>From 8572946f416049785194397280d010beeac0333f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Dec 2014 15:35:48 +0100 Subject: [PATCH 1/2] Guard against unexpected modal dialogs in the unattended test. Fail the test non-interactively if any such dialog is about to be shown, as they are unexpected and showing them would prevent the test from running in unattended mode. --- main_wx_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main_wx_test.cpp b/main_wx_test.cpp index 53a89bc..ddc9537 100644 --- a/main_wx_test.cpp +++ b/main_wx_test.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -761,6 +762,13 @@ void SkeletonTest::RunTheTests() } } + // Any dialog shown during the tests should be accounted for and dismissed + // before it gets to this outer hook by the testing hook expecting it, so + // this hook should never be invoked and we install it to ensure that it + // prevents any unexpected modal dialogs from being shown if they do + // happen, this is important for the test to really run unattended. + wxTestingModalHook expect_no_dialogs; + mainWin->SetFocus(); wxLogMessage("NOTE: starting the test suite"); -- 2.1.0