22 #ifndef TESTBED_TESTSUITE_H 23 #define TESTBED_TESTSUITE_H 25 #include "common/array.h" 26 #include "common/rect.h" 27 #include "common/scummsys.h" 28 #include "common/system.h" 29 #include "common/str.h" 30 #include "graphics/font.h" 32 #include "graphics/fontman.h" 34 #include "testbed/config-params.h" 55 kEventHandlingTime = 50
64 typedef TestExitStatus (*InvokingFunction)();
94 int getNumTests()
const {
return _testsToExecute.size(); }
95 int getNumTestsPassed()
const {
return _numTestsPassed; }
96 int getNumTestsSkipped()
const {
return _numTestsSkipped; }
97 int getNumTestsFailed()
const {
return _numTestsExecuted - _numTestsPassed; }
98 void genReport()
const;
99 bool isEnabled()
const {
return _isTsEnabled; }
100 virtual void enable(
bool flag) {
113 static bool handleInteractiveInput(
const Common::String &textToDisplay,
const char *opt1 =
"Yes",
const char *opt2 =
"No", OptionSelected result = kOptionLeft);
115 static void displayMessage(
const Common::String &textToDisplay,
const char *defaultButton =
"OK");
118 static void clearEntireScreen() {
124 static void clearScreen();
125 static void clearScreen(
bool flag);
145 virtual void execute();
146 static uint parseEvents();
148 virtual const char *getName()
const = 0;
149 virtual const char *getDescription()
const = 0;
151 static void logPrintf(MSVC_PRINTF
const char *s, ...)
GCC_PRINTF(1, 2);
152 static void logDetailedPrintf(MSVC_PRINTF
const char *s, ...)
GCC_PRINTF(1, 2);
168 pt.
y -= (
FontMan.getFontByUsage(ConfParams.getCurrentFontUsageType())->getFontHeight() * 3 + 15);
172 static uint getLineSeparation() {
173 return FontMan.getFontByUsage(ConfParams.getCurrentFontUsageType())->getFontHeight() + 5;
176 static void updateStats(
const char *prefix,
const char *info, uint numTests, uint testNum,
Common::Point pt);
178 int getNumTestsEnabled();
184 int _numTestsSkipped;
197 #endif // TESTBED_TESTSUITE_H
#define FontMan
Definition: fontman.h:127
bool enabled
Decides whether or not this test is to be executed.
Definition: testsuite.h:79
InvokingFunction driver
Pointer to the function that will invoke this feature test.
Definition: testsuite.h:78
Definition: testsuite.h:70
int _numTestsPassed
Number of tests passed.
Definition: testsuite.h:182
virtual int16 getHeight()=0
virtual void prepare()
Definition: testsuite.h:139
Definition: testsuite.h:90
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
bool isInteractive
Decides if the test is interactive or not, An interactive testsuite may have non-interactive tests...
Definition: testsuite.h:81
const Common::String featureName
Name of feature to be tested.
Definition: testsuite.h:77
virtual int16 getWidth()=0
static void static void static Common::Point getDisplayRegionCoordinates()
Definition: testsuite.h:163
int _numTestsExecuted
Number of tests executed.
Definition: testsuite.h:183
Common::Array< Test * > _testsToExecute
List of tests to be executed.
Definition: testsuite.h:181
int16 y
Definition: rect.h:47
bool passed
Collects and stores result of this feature test.
Definition: testsuite.h:80