UTPP
Loading...
Searching...
No Matches
UnitTest::TestSuite Class Reference

#include <utpp.h>

Classes

class  Inserter
 Constructor of this objects inserts the test in suite. More...
 

Public Member Functions

 TestSuite (const std::string &name)
 
void Add (const Inserter *inf)
 
bool IsEnabled () const
 Returns true if suite is enabled.
 
void Enable (bool on_off)
 Enables or disables this suite.
 
int RunTests (Reporter &reporter, int max_runtime_ms)
 

Public Attributes

std::string name
 Suite name.
 

Detailed Description

A set of test cases that are run together.

A suite maintains a container with information about all tests included in the suite.

Member Function Documentation

◆ Add()

void UnitTest::TestSuite::Add ( const Inserter * inf)
inline

Add a new test information to test_list

Parameters
infPointer to Inserter information that will be added to the container

Note that the container keeps the pointer itself and that could create lifetime issues. However this is not a problem in normal usage as inserter objects are statically created by the TEST... macros.

◆ RunTests()

int UnitTest::TestSuite::RunTests ( Reporter & rep,
int maxtime )
inline

Run all tests in suite

Parameters
repReporter object to be used
maxtimemaximum run time for each test
Returns
number of failed tests

Iterate through all test information objects doing the following:

Establish reporter as CurrentReporter and suite as CurrentSuite

Inform reporter that suite has started

Setup the test context

Run test

Tear down test context

Repeat for all tests

At the end invoke reporter SuiteFinish function


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