oos::test_suite Class Reference

The container for all unit tests. More...

#include <test_suite.hpp>

Inherits oos::singleton< test_suite >.

Public Member Functions

void init (int argc, char *argv[])
 Initialize test_suite. More...
 
void register_unit (unit_test *utest)
 Register a new test_unit object. More...
 
void run ()
 Executes the test_suite. More...
 
void run (const std::string &unit)
 Executes a specific test_unit. More...
 
void run (const std::string &unit, const std::string &test)
 Executes a single test of a test_unit. More...
 

Friends

class singleton< test_suite >
 

Additional Inherited Members

- Public Types inherited from oos::singleton< test_suite >
typedef test_suite value_type
 
- Static Public Member Functions inherited from oos::singleton< test_suite >
static value_typeinstance ()
 Access the instance of the class. More...
 

Detailed Description

The container for all unit tests.

The test_suite class is the container for all test_unit classes. It is a singleton, so only one instance exists. It can execute all test_units or a specific test_unit. It also provides function listing all test_unit classes and their tests.

Member Function Documentation

void oos::test_suite::init ( int  argc,
char *  argv[] 
)

Initialize test_suite.

Reads, parses and initializes the test_suite.

Parameters
argcNumber of arguments.
argvList of arguments.
void oos::test_suite::register_unit ( unit_test utest)

Register a new test_unit object.

Registers a new test_unit object identified by the given name.

Parameters
utesttest_unit object.
void oos::test_suite::run ( )

Executes the test_suite.

Executes all test unit classes or the command given via init.

void oos::test_suite::run ( const std::string &  unit)

Executes a specific test_unit.

Executes the test_unit with the given name. If there is no test_unit object with such a name a message is diplayed.

Parameters
unitThe name of the test_unit object to execute.
void oos::test_suite::run ( const std::string &  unit,
const std::string &  test 
)

Executes a single test of a test_unit.

Executes a single test of a test_unit object, identified by the name of the test and the name of the test_unit object. If test couldn't be found a message is displayed.

Parameters
unitName of the test_unit object.
testName of the test to execute.

The documentation for this class was generated from the following file:
  • unit/test_suite.hpp