aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed/fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/testbed/fs.cpp')
-rw-r--r--engines/testbed/fs.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp
index 6bd67022ee..7cae7ef6c1 100644
--- a/engines/testbed/fs.cpp
+++ b/engines/testbed/fs.cpp
@@ -149,21 +149,23 @@ bool FStests::testWriteFile() {
FSTestSuite::FSTestSuite() {
- addTest("ReadingFile", &FStests::testReadFile, false);
- addTest("WritingFile", &FStests::testWriteFile, false);
-}
-
-void FSTestSuite::enable(bool flag) {
+ // FS tests depend on Game Data files.
+ // If those are not found. Disable this testsuite.
const Common::String &path = ConfMan.get("path");
Common::FSNode gameRoot(path);
Common::FSNode gameIdentificationFile = gameRoot.getChild("TESTBED");
if (!gameIdentificationFile.exists()) {
logPrintf("WARNING! : Game Data not found. Skipping FS tests\n");
+ _isGameDataFound = false;
Testsuite::enable(false);
- return;
}
- Testsuite::enable(flag);
+ addTest("ReadingFile", &FStests::testReadFile, false);
+ addTest("WritingFile", &FStests::testWriteFile, false);
+}
+
+void FSTestSuite::enable(bool flag) {
+ Testsuite::enable(_isGameDataFound & flag);
}
} // End of namespace Testbed