ScummVM API documentation
Testbed::Testsuite Class Referenceabstract

#include <testsuite.h>

Inheritance diagram for Testbed::Testsuite:
Testbed::CloudTestSuite Testbed::EventTestSuite Testbed::FSTestSuite Testbed::GFXTestSuite Testbed::MidiTestSuite Testbed::MiscTestSuite Testbed::NetworkingTestSuite Testbed::SaveGameTestSuite Testbed::SoundSubsystemTestSuite Testbed::SpeechTestSuite Testbed::VideoDecoderTestSuite Testbed::WebserverTestSuite Testbed::XXXTestSuite

Public Member Functions

int getNumTests () const
 
int getNumTestsPassed () const
 
int getNumTestsSkipped () const
 
int getNumTestsFailed () const
 
void genReport () const
 
bool isEnabled () const
 
virtual void enable (bool flag)
 
bool enableTest (const Common::String &testName, bool enable)
 
void reset ()
 
void addTest (const Common::String &name, InvokingFunction f, bool isInteractive=true)
 
virtual void prepare ()
 
virtual void execute ()
 
virtual const char * getName () const =0
 
virtual const char * getDescription () const =0
 
const Common::Array< Test * > & getTestList ()
 
int getNumTestsEnabled ()
 

Static Public Member Functions

static bool handleInteractiveInput (const Common::String &textToDisplay, const char *opt1="Yes", const char *opt2="No", OptionSelected result=kOptionLeft)
 
static void displayMessage (const Common::String &textToDisplay, const char *defaultButton="OK")
 
static Common::Rect writeOnScreen (const Common::String &textToDisplay, const Common::Point &pt, bool flag=false)
 
static void clearScreen (const Common::Rect &rect)
 
static void clearEntireScreen ()
 
static void clearScreen ()
 
static void clearScreen (bool flag)
 
static uint parseEvents ()
 
static void logPrintf (MSVC_PRINTF const char *s,...) GCC_PRINTF(1
 
static void static void logDetailedPrintf (MSVC_PRINTF const char *s,...) GCC_PRINTF(1
 
static void static void static Common::Point getDisplayRegionCoordinates ()
 
static uint getLineSeparation ()
 
static void updateStats (const char *prefix, const char *info, uint numTests, uint testNum, Common::Point pt)
 

Protected Attributes

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
 

Detailed Description

The basic Testsuite class All the other testsuites would inherit it and override its virtual methods

Member Function Documentation

◆ handleInteractiveInput()

static bool Testbed::Testsuite::handleInteractiveInput ( const Common::String textToDisplay,
const char *  opt1 = "Yes",
const char *  opt2 = "No",
OptionSelected  result = kOptionLeft 
)
static

Prompts for User Input in form of "Yes" or "No" for interactive tests e.g: "Is this like you expect?" "Yes" or "No"

Parameters
textToDisplayDisplay text
Returns
true if "Yes" false otherwise

◆ addTest()

void Testbed::Testsuite::addTest ( const Common::String name,
InvokingFunction  f,
bool  isInteractive = true 
)

Adds a test to the list of tests to be executed

Parameters
namethe string description of the test, for display purposes
fpointer to the function that invokes this test
isInteractivedecides if the test is to be executed in interactive mode/ default true

◆ prepare()

virtual void Testbed::Testsuite::prepare ( )
inlinevirtual

Testsuite state preparation code, like tweaking mouse cursors should go there

Reimplemented in Testbed::GFXTestSuite.

◆ execute()

virtual void Testbed::Testsuite::execute ( )
virtual

The driver function for the testsuite All code should go in here.

◆ getDisplayRegionCoordinates()

static void static void static Common::Point Testbed::Testsuite::getDisplayRegionCoordinates ( )
inlinestatic

Display region is in the bottom. Probably 1/4th of the game screen. It contains: 1) Information about executing testsuite. 2) Total progress within this testsuite. 3) Total overall progress in the number of testsuites


The documentation for this class was generated from the following file: