[Scummvm-git-logs] scummvm master -> 8dedbd6e62f36fd822e7dadc54fedc888ee5e372

sev- sev at scummvm.org
Sat Jun 13 14:29:24 UTC 2020


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3bfd87d88a TESTBED: Create testsuite list at separate static method
3f10dbeac6 TESTBED: Move code with side-effects away from testsuite constructor
2df0675fbf TESTBED: Fix return-to-launcher SIGSEGV bug
24c34a1fe8 TESTBED: Give achievements for completed testsuites
8dedbd6e62 TESTBED: Add missing files for FStests::testReadFile


Commit: 3bfd87d88a6383550e3fc36f49e41e241dac4ae2
    https://github.com/scummvm/scummvm/commit/3bfd87d88a6383550e3fc36f49e41e241dac4ae2
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2020-06-13T16:29:17+02:00

Commit Message:
TESTBED: Create testsuite list at separate static method

Changed paths:
    engines/testbed/testbed.cpp
    engines/testbed/testbed.h


diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 3216a85a80..a05f0f259b 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -122,46 +122,50 @@ TestbedEngine::TestbedEngine(OSystem *syst)
 	DebugMan.addDebugChannel(kTestbedEngineDebug, "Debug", "Engine-specific debug statements");
 	DebugMan.enableDebugChannel("LOG");
 
+	pushTestsuites(_testsuiteList);
+}
+
+void TestbedEngine::pushTestsuites(Common::Array<Testsuite *> &testsuiteList) {
 	// Initialize testsuites here
 	Testsuite *ts;
 	// GFX
 	ts = new GFXTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// FS
 	ts = new FSTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// Savegames
 	ts = new SaveGameTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// Misc.
 	ts = new MiscTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// Events
 	ts = new EventTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// Sound
 	ts = new SoundSubsystemTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 	// Midi
 	ts = new MidiTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 #ifdef USE_TTS
 	 // TextToSpeech
 	 ts = new SpeechTestSuite();
-	 _testsuiteList.push_back(ts);
+	 testsuiteList.push_back(ts);
 #endif
 #if defined(USE_CLOUD) && defined(USE_LIBCURL)
 	// Cloud
 	ts = new CloudTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 #endif
 #ifdef USE_SDL_NET
 	// Webserver
 	ts = new WebserverTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 #endif
 	ts = new EncodingTestSuite();
-	_testsuiteList.push_back(ts);
+	testsuiteList.push_back(ts);
 }
 
 TestbedEngine::~TestbedEngine() {
diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h
index 04c6bbfe3d..64b60e5ed1 100644
--- a/engines/testbed/testbed.h
+++ b/engines/testbed/testbed.h
@@ -47,6 +47,11 @@ public:
 
 	Common::Error run() override;
 
+	/**
+	 * Invokes configured testsuites.
+	 */
+	static void pushTestsuites(Common::Array<Testsuite *> &testsuiteList);
+
 	/**
 	 * Invokes configured testsuites.
 	 */


Commit: 3f10dbeac6c36fa8ca503900b404ddb618c6830e
    https://github.com/scummvm/scummvm/commit/3f10dbeac6c36fa8ca503900b404ddb618c6830e
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2020-06-13T16:29:17+02:00

Commit Message:
TESTBED: Move code with side-effects away from testsuite constructor

Changed paths:
    engines/testbed/graphics.cpp
    engines/testbed/graphics.h
    engines/testbed/testsuite.cpp
    engines/testbed/testsuite.h


diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 9fa06de9b6..6690c87067 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -40,15 +40,6 @@ namespace Testbed {
 byte GFXTestSuite::_palette[256 * 3] = {0, 0, 0, 255, 255, 255, 255, 255, 255};
 
 GFXTestSuite::GFXTestSuite() {
-	// Initialize color palettes
-	// The fourth field is for alpha channel which is unused
-	// Assuming 8bpp as of now
-	g_system->getPaletteManager()->setPalette(_palette, 0, 3);
-
-	// Init Mouse Palette (White-black-yellow)
-	GFXtests::initMousePalette();
-	GFXtests::initMouseCursor();
-
 	// Add tests here
 
 	// Blitting buffer on screen
@@ -79,6 +70,17 @@ GFXTestSuite::GFXTestSuite() {
 	//addTest("Pixel Formats", &GFXtests::pixelFormats);
 }
 
+void GFXTestSuite::prepare() {
+	// Initialize color palettes
+	// The fourth field is for alpha channel which is unused
+	// Assuming 8bpp as of now
+	g_system->getPaletteManager()->setPalette(_palette, 0, 3);
+
+	// Init Mouse Palette (White-black-yellow)
+	GFXtests::initMousePalette();
+	GFXtests::initMouseCursor();
+}
+
 void GFXTestSuite::setCustomColor(uint r, uint g, uint b) {
 	_palette[6] = r;
 	_palette[7] = g;
diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h
index 15622e4aeb..404870b6b0 100644
--- a/engines/testbed/graphics.h
+++ b/engines/testbed/graphics.h
@@ -75,6 +75,7 @@ public:
 	const char *getDescription() const override {
 		return "Graphics Subsystem";
 	}
+	void prepare() override;
 	static void setCustomColor(uint r, uint g, uint b);
 
 private:
diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp
index 2098ede477..817b70ede3 100644
--- a/engines/testbed/testsuite.cpp
+++ b/engines/testbed/testsuite.cpp
@@ -287,6 +287,8 @@ void Testsuite::execute() {
 	if (!numEnabledTests)
 		return;
 
+	prepare();
+
 	for (Common::Array<Test *>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
 		if (!(*i)->enabled) {
 			logPrintf("Info! Skipping Test: %s, Skipped by configuration.\n", ((*i)->featureName).c_str());
diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h
index 4f2a23c8bd..a2c34928fe 100644
--- a/engines/testbed/testsuite.h
+++ b/engines/testbed/testsuite.h
@@ -134,6 +134,11 @@ public:
 	 */
 	void addTest(const Common::String &name, InvokingFunction f, bool isInteractive = true);
 
+	/**
+	 * Testsuite state preparation code, like tweaking mouse cursors should go there
+	 */
+	virtual void prepare() {}
+
 	/**
 	 * The driver function for the testsuite
 	 * All code should go in here.


Commit: 2df0675fbf77b23dd52188e2ce223f76426eea31
    https://github.com/scummvm/scummvm/commit/2df0675fbf77b23dd52188e2ce223f76426eea31
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2020-06-13T16:29:17+02:00

Commit Message:
TESTBED: Fix return-to-launcher SIGSEGV bug

Changed paths:
    engines/testbed/config-params.cpp


diff --git a/engines/testbed/config-params.cpp b/engines/testbed/config-params.cpp
index 1aa97168c1..313f84882e 100644
--- a/engines/testbed/config-params.cpp
+++ b/engines/testbed/config-params.cpp
@@ -69,6 +69,7 @@ bool ConfigParams::isRerunRequired() {
 void ConfigParams::deleteWriteStream() {
 	if (_ws) {
 		delete _ws;
+		_ws = 0;
 	}
 }
 


Commit: 24c34a1fe88c70af45236b9ca5477d41e28c1fab
    https://github.com/scummvm/scummvm/commit/24c34a1fe88c70af45236b9ca5477d41e28c1fab
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2020-06-13T16:29:17+02:00

Commit Message:
TESTBED: Give achievements for completed testsuites

Changed paths:
    engines/testbed/detection.cpp
    engines/testbed/testbed.cpp
    engines/testbed/testbed.h


diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index f31eecb955..94feb6aea1 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -26,6 +26,7 @@
 #include "base/plugins.h"
 
 #include "testbed/testbed.h"
+#include "testbed/testsuite.h"
 
 static const PlainGameDescriptor testbed_setting[] = {
 	{ "testbed", "Testbed: The Backend Testing Framework" },
@@ -69,6 +70,24 @@ public:
 		return true;
 	}
 
+	const Common::AchievementsInfo getAchievementsInfo(const Common::String &target) const override {
+		Common::AchievementsInfo result;
+		result.platform = Common::UNK_ACHIEVEMENTS;
+		result.appId = "testbed";
+		Common::AchievementDescription final = {"EVERYTHINGWORKS", true, "Everything works!", "Completed all available testsuites"};
+		result.descriptions.push_back(final);
+
+		Common::Array<Testbed::Testsuite *> testsuiteList;
+		Testbed::TestbedEngine::pushTestsuites(testsuiteList);
+		for (Common::Array<Testbed::Testsuite *>::const_iterator i = testsuiteList.begin(); i != testsuiteList.end(); ++i) {
+			Common::AchievementDescription it = {(*i)->getName(), false, (*i)->getDescription(), 0};
+			result.descriptions.push_back(it);
+			delete (*i);
+		}
+
+		return result;
+	}
+	
 	bool hasFeature(MetaEngineFeature f) const override {
 		return false;
 	}
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index a05f0f259b..39a053d935 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/achievements.h"
 #include "common/debug-channels.h"
 #include "common/scummsys.h"
 #include "common/archive.h"
@@ -196,13 +197,30 @@ void TestbedEngine::invokeTestsuites(TestbedConfigManager &cfMan) {
 			Testsuite::updateStats("Testsuite", (*iter)->getName(), count++, numSuitesEnabled, pt);
 			(*iter)->execute();
 		}
+		if ((*iter)->getNumTests() == (*iter)->getNumTestsPassed()) {
+			AchMan.setAchievement((*iter)->getName(), (*iter)->getDescription());
+			checkForAllAchievements();
+		}
 	}
 }
 
+void TestbedEngine::checkForAllAchievements() {
+	Common::Array<Testsuite *>::const_iterator iter;
+	for (iter = _testsuiteList.begin(); iter != _testsuiteList.end(); iter++) {
+		if (!AchMan.isAchieved((*iter)->getName())) {
+			return;
+		}
+	}
+	AchMan.setAchievement("EVERYTHINGWORKS", "Everything works!");
+}
+
 Common::Error TestbedEngine::run() {
 	// Initialize graphics using following:
 	initGraphics(320, 200);
 
+	// Initialize achievements manager
+	AchMan.setActiveDomain(Common::UNK_ACHIEVEMENTS, "testbed");
+
 	// As of now we are using GUI::MessageDialog for interaction, Test if it works.
 	// interactive mode could also be modified by a config parameter "non-interactive=1"
 	// TODO: Implement that
diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h
index 64b60e5ed1..8f05568cca 100644
--- a/engines/testbed/testbed.h
+++ b/engines/testbed/testbed.h
@@ -60,6 +60,7 @@ public:
 	bool hasFeature(EngineFeature f) const override;
 
 private:
+	void checkForAllAchievements();
 	Common::Array<Testsuite *> _testsuiteList;
 };
 


Commit: 8dedbd6e62f36fd822e7dadc54fedc888ee5e372
    https://github.com/scummvm/scummvm/commit/8dedbd6e62f36fd822e7dadc54fedc888ee5e372
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2020-06-13T16:29:17+02:00

Commit Message:
TESTBED: Add missing files for FStests::testReadFile

Changed paths:
  A dists/engine-data/testbed-audiocd-files/TEST3/FILE.txt
  A dists/engine-data/testbed-audiocd-files/Test2/File.txt
  A dists/engine-data/testbed-audiocd-files/tEST4/fILe.txt
  A dists/engine-data/testbed-audiocd-files/test1/file.txt
  A dists/engine-data/testbed-audiocd-files/test5/file


diff --git a/dists/engine-data/testbed-audiocd-files/TEST3/FILE.txt b/dists/engine-data/testbed-audiocd-files/TEST3/FILE.txt
new file mode 100644
index 0000000000..5ef648a885
--- /dev/null
+++ b/dists/engine-data/testbed-audiocd-files/TEST3/FILE.txt
@@ -0,0 +1 @@
+It works!
\ No newline at end of file
diff --git a/dists/engine-data/testbed-audiocd-files/Test2/File.txt b/dists/engine-data/testbed-audiocd-files/Test2/File.txt
new file mode 100644
index 0000000000..5ef648a885
--- /dev/null
+++ b/dists/engine-data/testbed-audiocd-files/Test2/File.txt
@@ -0,0 +1 @@
+It works!
\ No newline at end of file
diff --git a/dists/engine-data/testbed-audiocd-files/tEST4/fILe.txt b/dists/engine-data/testbed-audiocd-files/tEST4/fILe.txt
new file mode 100644
index 0000000000..5ef648a885
--- /dev/null
+++ b/dists/engine-data/testbed-audiocd-files/tEST4/fILe.txt
@@ -0,0 +1 @@
+It works!
\ No newline at end of file
diff --git a/dists/engine-data/testbed-audiocd-files/test1/file.txt b/dists/engine-data/testbed-audiocd-files/test1/file.txt
new file mode 100644
index 0000000000..5ef648a885
--- /dev/null
+++ b/dists/engine-data/testbed-audiocd-files/test1/file.txt
@@ -0,0 +1 @@
+It works!
\ No newline at end of file
diff --git a/dists/engine-data/testbed-audiocd-files/test5/file b/dists/engine-data/testbed-audiocd-files/test5/file
new file mode 100644
index 0000000000..5ef648a885
--- /dev/null
+++ b/dists/engine-data/testbed-audiocd-files/test5/file
@@ -0,0 +1 @@
+It works!
\ No newline at end of file




More information about the Scummvm-git-logs mailing list