[Scummvm-cvs-logs] SF.net SVN: scummvm:[51945] scummvm/branches/gsoc2010-testbed/engines/ testbed

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Mon Aug 9 22:10:53 CEST 2010


Revision: 51945
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51945&view=rev
Author:   sud03r
Date:     2010-08-09 20:10:53 +0000 (Mon, 09 Aug 2010)

Log Message:
-----------
TESTBED: Some refinemnts related to skipping tests and display in GUI

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/config.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/config.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/config.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/config.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/config.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -151,12 +151,12 @@
 	_yOffset += h;
 }
 
-void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, Common::Array<Common::String> &strArray, uint yPadding) {
+void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, Common::Array<Common::String> &strArray, GUI::ListWidget::ColorList *colors, uint yPadding) {
 	_yOffset += yPadding;
 	GUI::ListWidget *list = new GUI::ListWidget(this, x, y, w, h);
 	list->setEditable(false);
 	list->setNumberingMode(GUI::kListNumberingOff);
-	list->setList(strArray);
+	list->setList(strArray, colors);
 	_yOffset += h;
 }
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/config.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/config.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/config.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -122,7 +122,7 @@
 	void addButton(uint w, uint h, const Common::String name, uint32 cmd, uint xOffset = 0, uint yPadding = 8);
 	void addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd);
 	void addText(uint w, uint h, const Common::String text, Graphics::TextAlign textAlign, uint xOffset, uint yPadding = 8);
-	void addList(uint x, uint y, uint w, uint h, Common::Array<Common::String> &strArray, uint yPadding = 8);
+	void addList(uint x, uint y, uint w, uint h, Common::Array<Common::String> &strArray, GUI::ListWidget::ColorList *colors = 0, uint yPadding = 8);
 protected:
 	Common::Array<GUI::ButtonWidget *> _buttonArray;
 	uint _xOffset;

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -116,7 +116,7 @@
 	return Common::Rect(right - width, 0, right, height);
 }
 
-bool EventTests::mouseEvents() {
+TestExitStatus EventTests::mouseEvents() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing Mouse events.\n "
@@ -125,7 +125,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : keyboard events\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	Common::EventManager *eventMan = g_system->getEventManager();
@@ -140,7 +140,7 @@
 	Common::Rect finishZone = drawFinishZone();
 
 	bool quitLoop = false;
-	bool passed = true;
+	TestExitStatus passed = kTestPassed;
 	// handle all mouse events
 	Common::Event event;
 	while (!quitLoop) {
@@ -211,17 +211,17 @@
 	// Verify results now!
 	if (Testsuite::handleInteractiveInput("Were mouse clicks L/R/M buttons identfied?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Mouse clicks (L/R/M buttons) failed");
-		passed = false;
+		passed = kTestFailed;
 	}
 	if (Testsuite::handleInteractiveInput("Were mouse wheel movements identified?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Mouse wheel movements failed");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	return passed;
 }
 
-bool EventTests::kbdEvents() {
+TestExitStatus EventTests::kbdEvents() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing keyboard events.\n "
@@ -230,7 +230,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : keyboard events\n");
-		return true;
+		return kTestSkipped;
 	}
 
 
@@ -248,18 +248,18 @@
 		rect = Testsuite::writeOnScreen(text, pt);
 	}
 
-	bool passed = true;
+	TestExitStatus passed = kTestPassed;
 
 	if (Testsuite::handleInteractiveInput("Was the word you entered same as that displayed on screen?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Keyboard Events failed");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	Testsuite::clearScreen();
 	return passed;
 }
 
-bool EventTests::showMainMenu() {
+TestExitStatus EventTests::showMainMenu() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing Main Menu events.\n "
@@ -268,18 +268,18 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Main Menu\n");
-		return true;
+		return kTestSkipped;
 	}
 	Common::EventManager *eventMan = g_system->getEventManager();
 	Common::Event mainMenuEvent;
 	mainMenuEvent.type = Common::EVENT_MAINMENU;
 	eventMan->pushEvent(mainMenuEvent);
 
-	bool passed = true;
+	TestExitStatus passed = kTestPassed;
 
 	if (Testsuite::handleInteractiveInput("Were you able to see a main menu widget?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Event MAINMENU failed");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	return passed;

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -35,9 +35,9 @@
 char keystrokeToChar();
 Common::Rect drawFinishZone();
 // will contain function declarations for Event tests
-bool mouseEvents();
-bool kbdEvents();
-bool showMainMenu();
+TestExitStatus mouseEvents();
+TestExitStatus kbdEvents();
+TestExitStatus showMainMenu();
 // add more here
 
 } // End of namespace EventTests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -63,14 +63,14 @@
 	return true;
 }
 
-bool FStests::testReadFile() {
+TestExitStatus FStests::testReadFile() {
 	const Common::String &path = ConfMan.get("path");
 	Common::FSDirectory gameRoot(path);
 	int numFailed = 0;
 
 	if (!gameRoot.getFSNode().exists() || !gameRoot.getFSNode().isDirectory()) {
 		Testsuite::logDetailedPrintf("game Path should be an existing directory");
-		return false;
+		 return kTestFailed;
 	}
 
 	const char *dirList[] = {"test1" ,"Test2", "TEST3" , "tEST4", "test5"};
@@ -83,7 +83,7 @@
 
 		if (!directory) {
 			Testsuite::logDetailedPrintf("Failed to open directory %s during FS tests\n", dirName.c_str());
-			return false;
+			 return kTestFailed;
 		}
 
 		if (!readDataFromFile(directory, fileName.c_str())) {
@@ -98,7 +98,7 @@
 		
 		if (!directory) {
 			Testsuite::logDetailedPrintf("Failed to open directory %s during FS tests\n", dirName.c_str());
-			return false;
+			 return kTestFailed;
 		}
 		
 		if (!readDataFromFile(directory, fileName.c_str())) {
@@ -113,7 +113,7 @@
 		
 		if (!directory) {
 			Testsuite::logDetailedPrintf("Failed to open directory %s during FS tests\n", dirName.c_str());
-			return false;
+			 return kTestFailed;
 		}
 		
 		if (!readDataFromFile(directory, fileName.c_str())) {
@@ -124,19 +124,23 @@
 	}
 
 	Testsuite::logDetailedPrintf("Failed %d out of 15\n", numFailed);
-	return false;
+	if (numFailed) {
+		return kTestFailed;
+	} else {
+		return kTestPassed;
+	}
 }
 
 /**
  * This test creates a file testbed.out, writes a sample data and confirms if
  * it is same by reading the file again.
  */
-bool FStests::testWriteFile() {
+TestExitStatus FStests::testWriteFile() {
 	const Common::String &path = ConfMan.get("path");
 	Common::FSNode gameRoot(path);
 	if (!gameRoot.exists()) {
 		Testsuite::logPrintf("Couldn't open the game data directory %s", path.c_str());
-		return false;
+		 return kTestFailed;
 	}
 
 	Common::FSNode fileToWrite = gameRoot.getChild("testbed.out");
@@ -145,7 +149,7 @@
 
 	if (!ws) {
 		Testsuite::logDetailedPrintf("Can't open writable file in game data dir\n");
-		return false;
+		 return kTestFailed;
 	}
 
 	ws->writeString("ScummVM Rocks!");
@@ -155,7 +159,7 @@
 	Common::SeekableReadStream *rs = fileToWrite.createReadStream();
 	if (!rs) {
 		Testsuite::logDetailedPrintf("Can't open recently written file testbed.out in game data dir\n");
-		return false;
+		 return kTestFailed;
 	}
 	Common::String readFromFile = rs->readLine();
 	delete rs;
@@ -163,10 +167,10 @@
 	if (readFromFile.equals("ScummVM Rocks!")) {
 		// All good
 		Testsuite::logDetailedPrintf("Data written and read correctly\n");
-		return true;
+		 return kTestPassed;
 	}
 
-	return false;
+	 return kTestFailed;
 }
 
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/fs.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -41,9 +41,9 @@
 bool readDataFromFile(Common::FSDirectory *directory, const char *file);
 
 // will contain function declarations for FS tests
-bool testReadFile();
-bool testWriteFile();
-bool testOpeningSaveFile();
+TestExitStatus testReadFile();
+TestExitStatus testWriteFile();
+TestExitStatus testOpeningSaveFile();
 // add more here
 
 } // End of namespace FStests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -397,7 +397,7 @@
 /**
  * Tests the fullscreen mode by: toggling between fullscreen and windowed mode
  */
-bool GFXtests::fullScreenMode() {
+TestExitStatus GFXtests::fullScreenMode() {
 	Testsuite::clearScreen();
 	Common::String info = "Fullscreen test. Here you should expect a toggle between windowed and fullscreen states depending "
 	"upon your initial state.";
@@ -407,12 +407,12 @@
 	
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : FullScreenMode\n");
-		return true;
+		return kTestSkipped;
 	}
 
 	bool isFeaturePresent;
 	bool isFeatureEnabled;
-	bool passed = true;
+	TestExitStatus passed = kTestPassed;
 	Common::String prompt;
 	OptionSelected shouldSelect;
 
@@ -435,7 +435,7 @@
 
 		if (!Testsuite::handleInteractiveInput(prompt, "Fullscreen", "Windowed", shouldSelect)) {
 			// User selected incorrect current state
-			passed = false;
+			passed = kTestFailed;
 			Testsuite::logDetailedPrintf("g_system->getFeatureState() failed\n");
 		}
 
@@ -453,7 +453,7 @@
 
 		if (!Testsuite::handleInteractiveInput(prompt, "Fullscreen", "Windowed", shouldSelect)) {
 			// User selected incorrect mode
-			passed = false;
+			passed = kTestFailed;
 			Testsuite::logDetailedPrintf("g_system->setFeatureState() failed\n");
 		}
 
@@ -468,7 +468,7 @@
 		if (!Testsuite::handleInteractiveInput(prompt, "Yes, it is", "Nopes", shouldSelect)) {
 			// User selected incorrect mode
 			Testsuite::logDetailedPrintf("switching back to initial state failed\n");
-			passed = false;
+			passed = kTestFailed;
 		}
 
 	} else {
@@ -481,7 +481,7 @@
 /**
  * Tests the aspect ratio correction by: drawing an ellipse, when corrected the ellipse should render to a circle
  */
-bool GFXtests::aspectRatio() {
+TestExitStatus GFXtests::aspectRatio() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Aspect Ratio Correction test. If aspect ratio correction is enabled you should expect a circle on screen,"
@@ -489,14 +489,14 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Aspect Ratio\n");
-		return true;
+		return kTestSkipped;
 	}
 	// Draw an ellipse on the screen
 	drawEllipse(80, 160, 72, 60);
 
 	bool isFeaturePresent;
 	bool isFeatureEnabled;
-	bool passed;
+	TestExitStatus passed = kTestPassed;
 	Common::String prompt;
 	OptionSelected shouldSelect;
 
@@ -510,7 +510,7 @@
 		prompt = " What does the curve on screen appears to you ?";
 		if (!Testsuite::handleInteractiveInput(prompt, "Circle", "Ellipse", shouldSelect)) {
 			// User selected incorrect option
-			passed = false;
+			passed = kTestFailed;
 			Testsuite::logDetailedPrintf("Aspect Ratio Correction failed\n");
 		}
 
@@ -524,7 +524,7 @@
 		prompt = " What does the curve on screen appears to you ?";
 		if (!Testsuite::handleInteractiveInput(prompt, "Circle", "Ellipse", shouldSelect)) {
 			// User selected incorrect option
-			passed = false;
+			passed = kTestFailed;
 			Testsuite::logDetailedPrintf("Aspect Ratio Correction failed\n");
 		}
 
@@ -540,7 +540,7 @@
 	if (Testsuite::handleInteractiveInput("This should definetely be your initial state?", "Yes, it is", "Nopes", kOptionRight)) {
 		// User selected incorrect mode
 		Testsuite::logDetailedPrintf("Switching back to initial state failed\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	return passed;
@@ -550,7 +550,7 @@
  * Tests Palettized cursors.
  * Method: Create a yellow colored cursor, should be able to move it. Once you click test terminates
  */
-bool GFXtests::palettizedCursors() {
+TestExitStatus GFXtests::palettizedCursors() {
 
 	Testsuite::clearScreen();
 	Common::String info = "Palettized Cursors test.\n "
@@ -562,17 +562,17 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Palettized Cursors\n");
-		return true;
+		return kTestSkipped;
 	}
 	
-	bool passed = true;
+	TestExitStatus passed = kTestPassed;
 
 	// Testing with cursor Palette
 	setupMouseLoop();
 	
 	if (Testsuite::handleInteractiveInput("Which color did the cursor appeared to you?", "Yellow", "Any other", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Couldn't use cursor palette for rendering cursor\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	// Testing with game Palette
@@ -581,11 +581,11 @@
 
 	if (Testsuite::handleInteractiveInput("Which color did the cursor appeared to you?", "Red", "Any other", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Couldn't use Game palette for rendering cursor\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	if (!Testsuite::handleInteractiveInput("Did test run as was described?")) {
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	// re-enable cursor palette
@@ -599,7 +599,7 @@
  * Tests automated mouse movements. "Warp" functionality provided by the backend.
  */
 
-bool GFXtests::mouseMovements() {
+TestExitStatus GFXtests::mouseMovements() {
 	Testsuite::clearScreen();
 	// Make mouse visible
 	CursorMan.showMouse(true);
@@ -610,7 +610,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Mouse Movements\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	// Draw Rectangle
@@ -636,10 +636,10 @@
 	CursorMan.showMouse(false);
 
 	if (Testsuite::handleInteractiveInput("Was the cursor symmetrically contained in the rectangle at (100, 100)?", "Yes", "No", kOptionRight)) {
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
 
@@ -648,7 +648,7 @@
  * This basically blits the screen by the contents of its buffer.
  *
  */
-bool GFXtests::copyRectToScreen() {
+TestExitStatus GFXtests::copyRectToScreen() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing Blitting a Bitmap to screen.\n"
@@ -656,7 +656,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Blitting Bitmap\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	GFXTestSuite::setCustomColor(255, 255, 0);
@@ -671,17 +671,17 @@
 	g_system->delayMillis(1000);
 
 	if (Testsuite::handleInteractiveInput("Did you see yellow rectangle?", "Yes", "No", kOptionRight)) {
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
 /**
  * Testing feature : Iconifying window
  * It is expected the screen minimizes when this feature is enabled
  */
-bool GFXtests::iconifyWindow() {
+TestExitStatus GFXtests::iconifyWindow() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing Iconify Window mode.\n If the feature is supported by the backend, "
@@ -689,7 +689,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Iconifying window\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	Common::Point pt(0, 100);
@@ -719,16 +719,16 @@
 	}
 
 	if (Testsuite::handleInteractiveInput("Did you see window minimized?", "Yes", "No", kOptionRight)) {
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
 /**
  * Testing feature: Scaled cursors
  */
-bool GFXtests::scaledCursors() {
+TestExitStatus GFXtests::scaledCursors() {
 
 	Testsuite::clearScreen();
 	Common::String info = "Testing : Scaled cursors\n"
@@ -738,7 +738,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Scaled Cursors\n");
-		return true;
+		return kTestSkipped;
 	}
 
 	int maxLimit = 1000;
@@ -771,7 +771,7 @@
 			Testsuite::clearScreen();
 		} else {
 			Testsuite::logDetailedPrintf("Switching to graphics mode %s failed\n", gfxMode->name);
-			return false;
+			return kTestFailed;
 		}
 		gfxMode++;
 		maxLimit--;
@@ -785,22 +785,22 @@
 
 	if (gfxError != OSystem::kTransactionSuccess || !isGFXModeSet) {
 		Testsuite::logDetailedPrintf("Switcing to initial state failed\n");
-		return false;
+		return kTestFailed;
 	}
 
 	// Done with cursors, Make them invisible, any other test may enable and use it.
 	CursorMan.showMouse(false);
-	return true;
+	return kTestPassed;
 }
 
-bool GFXtests::shakingEffect() {
+TestExitStatus GFXtests::shakingEffect() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Shaking test. You should expect the graphics(text/bars etc) drawn on the screen to shake!";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Shaking Effect\n");
-		return true;
+		return kTestSkipped;
 	}
 
 	Common::Point pt(0, 100);
@@ -816,12 +816,12 @@
 
 	if (Testsuite::handleInteractiveInput("Did the Shaking test worked as you were expecting?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Shaking Effect didn't worked");
-		return false;
+		return kTestFailed;
 	}
-	return true;
+	return kTestPassed;
 }
 
-bool GFXtests::focusRectangle() {
+TestExitStatus GFXtests::focusRectangle() {
 	
 	Testsuite::clearScreen();
 	Common::String info = "Testing : Setting and hiding Focus \n"
@@ -829,7 +829,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : focus Rectangle\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont));
@@ -867,16 +867,16 @@
 		Testsuite::logDetailedPrintf("Focus Rectangle feature doesn't works. Check platform.\n");
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool GFXtests::overlayGraphics() {
+TestExitStatus GFXtests::overlayGraphics() {
 	Testsuite::clearScreen();
 	Common::String info = "Overlay Graphics. You should expect to see a green colored rectangle on the screen";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Overlay Graphics\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	Graphics::PixelFormat pf = g_system->getOverlayFormat();
@@ -899,13 +899,13 @@
 
 	if (Testsuite::handleInteractiveInput("Did you see a green overlayed rectangle?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Overlay Rectangle feature doesn't works\n");
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool GFXtests::paletteRotation() {
+TestExitStatus GFXtests::paletteRotation() {
 	
 	Common::String info = "Palette rotation. Here we draw a full 256 colored rainbow and then rotate it.\n"
 						"Note that the screen graphics change without having to draw anything.\n"
@@ -913,7 +913,7 @@
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : palette Rotation\n");
-		return true;
+		return kTestSkipped;
 	}
 	Common::Point pt(0, 10);
 	Testsuite::clearEntireScreen();
@@ -981,40 +981,40 @@
 	Testsuite::clearScreen();
 
 	if(Testsuite::handleInteractiveInput("Did you saw a rotation in colors of rectangles displayed on screen?", "Yes", "No", kOptionRight)) {
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool GFXtests::cursorTrails() {
+TestExitStatus GFXtests::cursorTrails() {
 	Common::String info = "With some shake offset the cursor was known to leave trails in the GUI\n"
 						"Here we set some offset and ask user to check for mouse trails, \n"
 						"the test is passed when there are no trails";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Cursor Trails\n");
-		return true;
+		return kTestSkipped;
 	}
-	bool passed = false;
+	TestExitStatus passed = kTestFailed;
 	g_system->setShakePos(25);
 	g_system->updateScreen();
 	if (Testsuite::handleInteractiveInput("Does the cursor leaves trails while moving?", "Yes", "No", kOptionRight)) {
-		passed = true;
+		passed = kTestPassed;
 	}
 	g_system->setShakePos(0);
 	g_system->updateScreen();
 	return passed;
 }
 
-bool GFXtests::pixelFormats() {
+TestExitStatus GFXtests::pixelFormats() {
 	Testsuite::clearScreen();
 	Common::String info = "Testing pixel formats. Here we iterate over all the supported pixel formats and display some colors using them\n"
 		"This may take long, especially if the backend supports many pixel formats";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
-		Testsuite::logPrintf("Info! Skipping test : focus Rectangle\n");
-		return true;
+		Testsuite::logPrintf("Info! Skipping test : Pixel Formats\n");
+		return kTestSkipped;
 	}
 
 	Common::List<Graphics::PixelFormat> pfList = g_system->getSupportedFormats();
@@ -1055,7 +1055,6 @@
 
 		Common::Point pt(0, 170);
 		Common::String msg;
-		// XXX: Can use snprintf?
 		msg = Common::String::printf("Testing Pixel Formats, %d of %d", numFormatsTested, pfList.size());
 		Testsuite::writeOnScreen(msg, pt, true);
 
@@ -1093,10 +1092,10 @@
 
 	if (numFailed) {
 		Testsuite::logDetailedPrintf("Pixel Format test: Failed : %d, Passed : %d, Ignored %d\n",numFailed, numPassed, numFormatsTested - (numPassed + numFailed));
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
 } // End of namespace Testbed

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/graphics.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -40,19 +40,19 @@
 Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1);
 
 // will contain function declarations for GFX tests
-bool cursorTrails();
-bool fullScreenMode();
-bool aspectRatio();
-bool palettizedCursors();
-bool mouseMovements();
-bool copyRectToScreen();
-bool iconifyWindow();
-bool scaledCursors();
-bool shakingEffect();
-bool focusRectangle();
-bool overlayGraphics();
-bool paletteRotation();
-bool pixelFormats();
+TestExitStatus cursorTrails();
+TestExitStatus fullScreenMode();
+TestExitStatus aspectRatio();
+TestExitStatus palettizedCursors();
+TestExitStatus mouseMovements();
+TestExitStatus copyRectToScreen();
+TestExitStatus iconifyWindow();
+TestExitStatus scaledCursors();
+TestExitStatus shakingEffect();
+TestExitStatus focusRectangle();
+TestExitStatus overlayGraphics();
+TestExitStatus paletteRotation();
+TestExitStatus pixelFormats();
 // add more here
 
 } // End of namespace GFXtests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -66,12 +66,12 @@
 	g_system->getTimerManager()->removeTimerProc(criticalSection);
 }
 
-bool MiscTests::testDateTime() {
+TestExitStatus MiscTests::testDateTime() {
 	
 	if (Testsuite::isSessionInteractive) {
 		if (Testsuite::handleInteractiveInput("Testing the date time API implementation", "Continue", "Skip", kOptionRight)) {
 			Testsuite::logPrintf("Info! Date time tests skipped by the user.\n");
-			return true;
+			return kTestSkipped;
 		}
 		
 		Testsuite::writeOnScreen("Verifying Date-Time...", Common::Point(0, 100));
@@ -87,7 +87,7 @@
 		// Directly verify date
 		dateTimeNow = "We expect the current date time to be " + dateTimeNow;
 		if (Testsuite::handleInteractiveInput(dateTimeNow, "Correct!", "Wrong", kOptionRight)) {
-			return false;
+			return kTestFailed;
 		}
 	}
 
@@ -105,32 +105,32 @@
 		if (t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year) {
 			// Ignore lag due to processing time
 			if (t1.tm_sec + 2 == t2.tm_sec) {
-				return true;
+				return kTestPassed;
 			}
 		}
 	}
-	return false;
+	return kTestFailed;
 }
 
-bool MiscTests::testTimers() {
+TestExitStatus MiscTests::testTimers() {
 	static int valToModify = 0;
 	if (g_system->getTimerManager()->installTimerProc(timerCallback, 100000, &valToModify)) {
 		g_system->delayMillis(150);
 		g_system->getTimerManager()->removeTimerProc(timerCallback);
 
 		if (999 == valToModify) {
-			return true;
+			return kTestPassed;
 		}
 	}
-	return false;
+	return kTestFailed;
 }
 
-bool MiscTests::testMutexes() {
+TestExitStatus MiscTests::testMutexes() {
 	
 	if (Testsuite::isSessionInteractive) {
 		if (Testsuite::handleInteractiveInput("Testing the Mutual Exclusion API implementation", "Continue", "Skip", kOptionRight)) {
 			Testsuite::logPrintf("Info! Mutex tests skipped by the user.\n");
-			return true;
+			return kTestSkipped;
 		}
 		Testsuite::writeOnScreen("Installing mutex", Common::Point(0, 100));
 	}
@@ -157,10 +157,10 @@
 	g_system->deleteMutex(sv.mutex);
 
 	if (sv.resultSoFar && 6 == sv.second) {
-		return true;
+		return kTestPassed;
 	}
 
-	return false;
+	return kTestFailed;
 }
 
 MiscTestSuite::MiscTestSuite() {

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -48,9 +48,9 @@
 void criticalSection(void *arg);
 
 // will contain function declarations for Misc tests
-bool testDateTime();
-bool testTimers();
-bool testMutexes();
+TestExitStatus testDateTime();
+TestExitStatus testTimers();
+TestExitStatus testMutexes();
 // add more here
 
 } // End of namespace MiscTests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -67,29 +67,29 @@
 	return false;
 }
 
-bool SaveGametests::testSaveLoadState() {
+TestExitStatus SaveGametests::testSaveLoadState() {
 	// create a savefile with "ScummVM Rocks!" written on it
 	if (!writeDataToFile("tBedSavefile.0", "ScummVM Rocks!")) {
 		Testsuite::logDetailedPrintf("Writing data to savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
 	// Verify if it contains the same data
 	if (!readAndVerifyData("tBedSavefile.0", "ScummVM Rocks!")) {
 		Testsuite::logDetailedPrintf("Reading data from savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool SaveGametests::testRemovingSavefile() {
+TestExitStatus SaveGametests::testRemovingSavefile() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 
 	// Create a dummy savefile
 	if (!writeDataToFile("tBedSavefileToRemove.0", "Dummy Savefile!")) {
 		Testsuite::logDetailedPrintf("Writing data to savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
 	// Remove it
@@ -100,18 +100,18 @@
 	if (loadFile) {
 		// Removing failed
 		Testsuite::logDetailedPrintf("Removing savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool SaveGametests::testRenamingSavefile() {
+TestExitStatus SaveGametests::testRenamingSavefile() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	// Open a file for renaming
 	if (!writeDataToFile("tBedSomeWeirdName.0", "Rename me!")) {
 		Testsuite::logDetailedPrintf("Writing data to savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
 	// Rename it
@@ -120,13 +120,13 @@
 	// Verify if it contains the same data
 	if (!readAndVerifyData("tBedSomeCoolName.0", "Rename me!")) {
 		Testsuite::logDetailedPrintf("Renaming savefile failed\n");
-		return false;
+		return kTestFailed;
 	}
 
-	return true;
+	return kTestPassed;
 }
 
-bool SaveGametests::testListingSavefile() {
+TestExitStatus SaveGametests::testListingSavefile() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	saveFileMan->clearError();
 
@@ -141,7 +141,7 @@
 	if (error != Common::kNoError) {
 		// Abort. Some Error in writing files
 		Testsuite::logDetailedPrintf("Error while creating savefiles: %s\n", Common::errorToString(error));
-		return false;
+		return kTestFailed;
 	}
 
 	Common::StringArray savefileList = saveFileMan->listSavefiles("tBedSavefileToList.?");
@@ -156,20 +156,20 @@
 				if (savefileList.size() == j) {
 					// A match for this name not found
 					Testsuite::logDetailedPrintf("Listed Names don't match\n");
-					return false;
+					return kTestFailed;
 				}
 			}
 		}
-		return true;
+		return kTestPassed;
 	} else {
 		Testsuite::logDetailedPrintf("listing Savefiles failed!\n");
-		return false;
+		return kTestFailed;
 	}
 
-	return false;
+	return kTestFailed;
 }
 
-bool SaveGametests::testErrorMessages() {
+TestExitStatus SaveGametests::testErrorMessages() {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	saveFileMan->clearError();
 
@@ -180,12 +180,12 @@
 	if (error == Common::kNoError) {
 		// blunder! how come?
 		Testsuite::logDetailedPrintf("SaveFileMan.getError() failed\n");
-		return false;
+		return kTestFailed;
 	}
 	// Can't actually predict whether which error, kInvalidPath or kPathDoesNotExist or some other?
-	// So just return true if some error
+	// So just return kTestPassed if some error
 	Testsuite::logDetailedPrintf("getError returned : %s\n", saveFileMan->getErrorDesc().c_str());
-	return true;
+	return kTestPassed;
 }
 
 SaveGameTestSuite::SaveGameTestSuite() {

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/savegame.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -35,11 +35,11 @@
 bool writeDataToFile(const char *fileName, const char *msg);
 bool readAndVerifyData(const char *fileName, const char *expected);
 // will contain function declarations for SaveGame tests
-bool testSaveLoadState();
-bool testRemovingSavefile();
-bool testRenamingSavefile();
-bool testListingSavefile();
-bool testErrorMessages();
+TestExitStatus testSaveLoadState();
+TestExitStatus testRemovingSavefile();
+TestExitStatus testRenamingSavefile();
+TestExitStatus testListingSavefile();
+TestExitStatus testErrorMessages();
 // add more here
 
 } // End of namespace SaveGametests

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -110,15 +110,15 @@
 	}
 }
 
-bool SoundSubsystem::playBeeps() {
+TestExitStatus SoundSubsystem::playBeeps() {
 	Testsuite::clearScreen();
-	bool passed = true; 
+	TestExitStatus passed = kTestPassed; 
 	Common::String info = "Testing Sound Output by generating beeps\n"
 	"You should hear a left beep followed by a right beep\n";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Play Beeps\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	Audio::PCSpeaker *speaker = new Audio::PCSpeaker();
@@ -135,7 +135,7 @@
 	
 	if (Testsuite::handleInteractiveInput("Were you able to hear the left beep?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Error! Left Beep couldn't be detected : Error with Mixer::setChannelBalance()\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 	
 	// Right Beep
@@ -147,41 +147,41 @@
 	
 	if (Testsuite::handleInteractiveInput("Were you able to hear the right beep?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Error! Right Beep couldn't be detected : Error with Mixer::setChannelBalance()\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 	return passed;
 }
 
-bool SoundSubsystem::mixSounds() {
+TestExitStatus SoundSubsystem::mixSounds() {
 	Testsuite::clearScreen();
-	bool passed = true; 
+	TestExitStatus passed = kTestPassed; 
 	Common::String info = "Testing Mixer Output by generating multichannel sound output using PC speaker emulator.\n"
 	"The mixer should be able to play them simultaneously\n";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : Mix Sounds\n");
-		return true;
+		return kTestSkipped;
 	}
 
 	SoundSubsystemDialog sDialog;
 	sDialog.runModal();
 	if (Testsuite::handleInteractiveInput("Was the mixer able to simultaneously play multiple channels?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Error! Multiple channels couldn't be played : Error with Mixer Class\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 	return passed;
 }
 
-bool SoundSubsystem::audiocdOutput() {
+TestExitStatus SoundSubsystem::audiocdOutput() {
 	Testsuite::clearScreen();
-	bool passed = true; 
+	TestExitStatus passed = kTestPassed; 
 	Common::String info = "Testing AudioCD API implementation.\n"
 	"Here we have four tracks, we play them in order i.e 1-2-3-last.\n"
 	"The user should verify if the tracks were run in correct order or not.";
 
 	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
 		Testsuite::logPrintf("Info! Skipping test : AudioCD API\n");
-		return true;
+		return kTestSkipped;
 	}
 	
 	Common::Point pt(0, 100);
@@ -204,14 +204,23 @@
 	Testsuite::clearScreen();
 	if (Testsuite::handleInteractiveInput("Were all the tracks played in order i.e 1-2-3-last ?", "Yes", "No", kOptionRight)) {
 		Testsuite::logPrintf("Error! Error in AudioCD.play() or probably sound files were not detected, try -d1 (debuglevel 1)\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 	
 	return passed;
 }
 
-bool SoundSubsystem::sampleRates() {
-	bool passed = true;
+TestExitStatus SoundSubsystem::sampleRates() {
+	
+	Common::String info = "Testing Multiple Sample Rates.\n"
+						  "Here we try to play sounds at three different sample rates.";
+
+	if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
+		Testsuite::logPrintf("Info! Skipping test : Sample Rates\n");
+		return kTestSkipped;
+	}
+	
+	TestExitStatus passed = kTestPassed;
 	Audio::Mixer *mixer = g_system->getMixer();
 
 	Audio::PCSpeaker *s1 = new Audio::PCSpeaker();
@@ -248,7 +257,7 @@
 	Testsuite::clearScreen();
 	if (Testsuite::handleInteractiveInput("Was the mixer able to play beeps with variable sample rates?", "Yes", "No", kOptionRight)) {
 		Testsuite::logDetailedPrintf("Error! Error with variable sample rates\n");
-		passed = false;
+		passed = kTestFailed;
 	}
 
 	return passed;

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -46,10 +46,10 @@
 // Helper functions for SoundSubsystem tests
 
 // will contain function declarations for SoundSubsystem tests
-bool playBeeps();
-bool mixSounds();
-bool audiocdOutput();
-bool sampleRates();
+TestExitStatus playBeeps();
+TestExitStatus mixSounds();
+TestExitStatus audiocdOutput();
+TestExitStatus sampleRates();
 }
 
 class SoundSubsystemTestSuite : public Testsuite {

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -38,33 +38,43 @@
 
 namespace Testbed {
 
+// Initialize static member for TestbedExitDialog
+bool TestbedExitDialog::_rerun = false;
+
 void TestbedExitDialog::init() {
 	_xOffset = 25;
 	_yOffset = 0;
 	Common::String text = "Thank you for using ScummVM testbed! Here are yor summarized results:";
 	addText(450, 20, text, Graphics::kTextAlignCenter, _xOffset, 15);
 	Common::Array<Common::String> strArray;
+	GUI::ListWidget::ColorList colors;
 	
 	for (Common::Array<Testsuite *>::const_iterator i = _testsuiteList.begin(); i != _testsuiteList.end(); ++i) {
-		strArray.push_back(Common::String::printf("%s    (%d/%d tests failed)", (*i)->getName(), (*i)->getNumTestsFailed(), 
-		(*i)->getNumTestsEnabled()));
+		strArray.push_back(Common::String::printf("%s :", (*i)->getDescription()));
+		colors.push_back(GUI::ThemeEngine::kFontColorNormal);
+		if ((*i)->isEnabled()) {
+			strArray.push_back(Common::String::printf("Passed: %d  Failed: %d Skipped: %d", (*i)->getNumTestsPassed(), (*i)->getNumTestsFailed(), (*i)->getNumTestsSkipped()));
+		} else {
+			strArray.push_back("Skipped");
+		}
+		colors.push_back(GUI::ThemeEngine::kFontColorAlternate);
 	}
 	
-	addList(0, _yOffset, 500, 200, strArray);
+	addList(0, _yOffset, 500, 200, strArray, &colors);
 	text = "More Details can be viewed in the Log file : " + Testsuite::getLogFile();
 	addText(450, 20, text, Graphics::kTextAlignLeft, 0, 0);
 	text = "Directory : " + Testsuite::getLogDir();
 	addText(500, 20, text, Graphics::kTextAlignLeft, 0, 0);
 	_yOffset += 5;
-	addButtonXY(_xOffset + 80, _yOffset, 120, 20, "Rerun Tests", kCmdRerunTestbed);
-	addButtonXY(_xOffset + 240, _yOffset, 60, 20, "Close", GUI::kCloseCmd);
+	addButtonXY(_xOffset + 80, _yOffset, 120, 24, "Rerun test suite", kCmdRerunTestbed);
+	addButtonXY(_xOffset + 240, _yOffset, 60, 24, "Close", GUI::kCloseCmd);
 }
 
 void TestbedExitDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
 	switch (cmd) {
 	case kCmdRerunTestbed :
 		_rerun = true;
-		GUI::Dialog::close();
+		cmd = GUI::kCloseCmd;
 	default:
 		GUI::Dialog::handleCommand(sender, cmd, data);
 	}
@@ -144,8 +154,7 @@
 
 	TestbedConfigManager cfMan(_testsuiteList, "testbed.config");
 	
-	// Keep running if rerun requested 
-	TestbedExitDialog tbDialog(_testsuiteList);
+	// Keep running if rerun requested
 
 	do {
 		Testsuite::clearEntireScreen();
@@ -158,10 +167,11 @@
 		}
 		
 		invokeTestsuites(cfMan);
+		TestbedExitDialog tbDialog(_testsuiteList);
 		tbDialog.init();
 		tbDialog.run();
 
-	} while (tbDialog.rerunRequired());
+	} while (TestbedExitDialog::rerunRequired());
 	
 	return Common::kNoError;
 }

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -62,13 +62,13 @@
 
 class TestbedExitDialog : public TestbedInteractionDialog {
 public:
-	TestbedExitDialog(Common::Array<Testsuite *> &testsuiteList) : TestbedInteractionDialog(80, 60, 500, 320), _rerun(false), 
+	TestbedExitDialog(Common::Array<Testsuite *> &testsuiteList) : TestbedInteractionDialog(80, 40, 500, 330),
 	_testsuiteList(testsuiteList) {}
 	~TestbedExitDialog() {}
 	void init();
 	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 	void run() { runModal(); }
-	bool rerunRequired() {
+	static bool rerunRequired() {
 		if (_rerun) {
 			_rerun = false;
 			return true;
@@ -76,7 +76,7 @@
 		return false;
 	}
 private:
-	bool _rerun;
+	static bool _rerun;
 	Common::Array<Testsuite *> &_testsuiteList;
 };
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.cpp	2010-08-09 20:10:53 UTC (rev 51945)
@@ -121,6 +121,7 @@
 Testsuite::Testsuite() {
 	_numTestsPassed = 0;
 	_numTestsExecuted = 0;
+	_numTestsSkipped = 0;
 	// Initially all testsuites are enabled, disable them by calling enableTestSuite(name, false)
 	_isTsEnabled = true;
 	// Set custom color for progress bar
@@ -148,6 +149,7 @@
 	logPrintf("Subsystem: %s ", getName());
 	logPrintf("(Tests Executed: %d)\n", _numTestsExecuted);
 	logPrintf("Passed: %d ", _numTestsPassed);
+	logPrintf("Skipped: %d ", _numTestsSkipped);
 	logPrintf("Failed: %d\n", getNumTestsFailed());
 	logPrintf("\n");
 }
@@ -333,29 +335,33 @@
 	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());
+			_numTestsSkipped++;
 			continue;	
 		}
 
-		if (toQuit == kSkipNext) {
-			logPrintf("Info! Skipping Test: %s, Skipped by user.\n", ((*i)->featureName).c_str());
-			toQuit = kLoopNormal;
-			continue;
-		}
-
 		if((*i)->isInteractive && !isSessionInteractive) {
 			logPrintf("Info! Skipping Test: %s, non-interactive environment is selected\n", ((*i)->featureName).c_str());
+			_numTestsSkipped++;
 			continue;
 		}
 
 		logPrintf("Info! Executing Test: %s\n", ((*i)->featureName).c_str());
 		updateStats("Test", ((*i)->featureName).c_str(), count++, numEnabledTests, pt);
-		_numTestsExecuted++;
-		if ((*i)->driver()) {
+
+		// Run the test and capture exit status.
+		TestExitStatus eStatus = (*i)->driver();
+		if (kTestPassed == eStatus) {
 			logPrintf("Result: Passed\n");
+			_numTestsExecuted++;
 			_numTestsPassed++;
+		} else if (kTestSkipped == eStatus){
+			logPrintf("Result: Skipped\n");
+			_numTestsSkipped++;
 		} else {
+			_numTestsExecuted++;
 			logPrintf("Result: Failed\n");
 		}
+
 		updateStats("Test", ((*i)->featureName).c_str(), count, numEnabledTests, pt);
 		// TODO: Display a screen here to user with details of upcoming test, he can skip it or Quit or RTL
 		// Check if user wants to quit/RTL/Skip next test by parsing events.

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-08-09 19:41:21 UTC (rev 51944)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testsuite.h	2010-08-09 20:10:53 UTC (rev 51945)
@@ -53,8 +53,14 @@
 	kEventHandlingTime = 50
 };
 
-typedef bool (*InvokingFunction)();
+enum TestExitStatus {
+	kTestPassed = 0,
+	kTestSkipped,
+	kTestFailed
+};
 
+typedef TestExitStatus (*InvokingFunction)();
+
 /**
  * This represents a feature to be tested
  */
@@ -85,6 +91,7 @@
 	virtual ~Testsuite();
 	int getNumTests() const { return _testsToExecute.size(); }
 	int getNumTestsPassed() const { return _numTestsPassed; }
+	int getNumTestsSkipped() const { return _numTestsSkipped; }
 	int getNumTestsFailed() const { return _numTestsExecuted - _numTestsPassed; }
 	void genReport() const;
 	bool isEnabled() const { return _isTsEnabled; }
@@ -180,6 +187,7 @@
 	Common::Array<Test *> _testsToExecute;			///< List of tests to be executed
 	int		    _numTestsPassed;					///< Number of tests passed
 	int			_numTestsExecuted;					///< Number of tests executed
+	int			_numTestsSkipped;
 	bool		_isTsEnabled;
 
 public:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list