diff options
Diffstat (limited to 'engines/testbed')
-rw-r--r-- | engines/testbed/testsuite.cpp | 11 | ||||
-rw-r--r-- | engines/testbed/testsuite.h | 5 |
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: /** |