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
66 kWriteRGBColors = (1 << 0),
67 kWriteDrawFrame = (1 << 1)
70 typedef TestExitStatus (*InvokingFunction)();
100 int getNumTests()
const {
return _testsToExecute.size(); }
101 int getNumTestsPassed()
const {
return _numTestsPassed; }
102 int getNumTestsSkipped()
const {
return _numTestsSkipped; }
103 int getNumTestsFailed()
const {
return _numTestsExecuted - _numTestsPassed; }
104 void genReport()
const;
105 bool isEnabled()
const {
return _isTsEnabled; }
106 virtual void enable(
bool flag) {
119 static bool handleInteractiveInput(
const Common::String &textToDisplay,
const char *opt1 =
"Yes",
const char *opt2 =
"No", OptionSelected result = kOptionLeft);
121 static void displayMessage(
const Common::String &textToDisplay,
const char *defaultButton =
"OK");
124 static void clearEntireScreen() {
130 static void clearScreen();
131 static void clearScreen(
bool flag);
151 virtual void execute();
152 static uint parseEvents();
154 virtual const char *getName()
const = 0;
155 virtual const char *getDescription()
const = 0;
157 static void logPrintf(MSVC_PRINTF
const char *s, ...)
GCC_PRINTF(1, 2);
158 static void logDetailedPrintf(MSVC_PRINTF
const char *s, ...)
GCC_PRINTF(1, 2);
174 pt.
y -= (
FontMan.getFontByUsage(ConfParams.getCurrentFontUsageType())->getFontHeight() * 3 + 15);
178 static uint getLineSeparation() {
179 return FontMan.getFontByUsage(ConfParams.getCurrentFontUsageType())->getFontHeight() + 5;
182 static void updateStats(
const char *prefix,
const char *info, uint numTests, uint testNum,
Common::Point pt);
184 int getNumTestsEnabled();
190 int _numTestsSkipped;
203 #endif // TESTBED_TESTSUITE_H
#define FontMan
Definition: fontman.h:135
bool enabled
Decides whether or not this test is to be executed.
Definition: testsuite.h:85
InvokingFunction driver
Pointer to the function that will invoke this feature test.
Definition: testsuite.h:84
Definition: testsuite.h:76
int _numTestsPassed
Number of tests passed.
Definition: testsuite.h:188
virtual int16 getHeight()=0
virtual void prepare()
Definition: testsuite.h:145
Definition: testsuite.h:96
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:87
const Common::String featureName
Name of feature to be tested.
Definition: testsuite.h:83
virtual int16 getWidth()=0
static void static void static Common::Point getDisplayRegionCoordinates()
Definition: testsuite.h:169
int _numTestsExecuted
Number of tests executed.
Definition: testsuite.h:189
Common::Array< Test * > _testsToExecute
List of tests to be executed.
Definition: testsuite.h:187
bool passed
Collects and stores result of this feature test.
Definition: testsuite.h:86