aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed
diff options
context:
space:
mode:
authorNeeraj Kumar2010-07-02 07:51:44 +0000
committerNeeraj Kumar2010-07-02 07:51:44 +0000
commit5457144f130c5483dc804e61adecb6e3bab426c0 (patch)
tree9bed724b65badf17c9980545ce73161f1dc52615 /engines/testbed
parent9a4bd4220fa000159cb300b2f66301b7150d0bd7 (diff)
downloadscummvm-rg350-5457144f130c5483dc804e61adecb6e3bab426c0.tar.gz
scummvm-rg350-5457144f130c5483dc804e61adecb6e3bab426c0.tar.bz2
scummvm-rg350-5457144f130c5483dc804e61adecb6e3bab426c0.zip
added processing of quit event
svn-id: r50590
Diffstat (limited to 'engines/testbed')
-rw-r--r--engines/testbed/testsuite.cpp11
-rw-r--r--engines/testbed/testsuite.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp
index e1e39dbfeb..8e5c1a2d80 100644
--- a/engines/testbed/testsuite.cpp
+++ b/engines/testbed/testsuite.cpp
@@ -42,6 +42,7 @@ bool Testsuite::isSessionInteractive = true;
Common::String Testsuite::_logDirectory = "";
Common::String Testsuite::_logFilename = "";
Common::WriteStream *Testsuite::_ws = 0;
+bool Testsuite::toQuit = false;
void Testsuite::setLogDir(const char *dirname) {
_logDirectory = dirname;
@@ -208,6 +209,11 @@ void Testsuite::addTest(const Common::String &name, InvokingFunction f, bool isI
}
void Testsuite::execute() {
+ // Do nothing if meant to exit
+ if (toQuit) {
+ return;
+ }
+
for (Common::Array<Test*>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
if((*i)->isInteractive && !isSessionInteractive) {
logPrintf("Info! Skipping Test: %s, non-interactive environment is selected\n", ((*i)->featureName).c_str());
@@ -221,6 +227,11 @@ void Testsuite::execute() {
} else {
logPrintf("Result: Failed\n");
}
+ // Check if user wants to quit
+ if (Engine::shouldQuit()) {
+ toQuit = true;
+ return;
+ }
}
genReport();
}
diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h
index 10a673bde6..84d99edc00 100644
--- a/engines/testbed/testsuite.h
+++ b/engines/testbed/testsuite.h
@@ -139,6 +139,11 @@ public:
* Used by various tests to respond accordingly
*/
static bool isSessionInteractive;
+
+ /**
+ * Used from the code to decide if the engine needs to exit
+ */
+ static bool toQuit;
private:
/**