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

A singleton object containing all test suites. More...

#include <utpp.h>

Public Member Functions

void Add (const std::string &suite, const TestSuite::Inserter *inf)
 
int Run (const std::string &suite, Reporter &reporter, int max_time_ms)
 
int RunAll (Reporter &reporter, int max_time_ms)
 
void Enable (const std::string &suite, bool enable=true)
 

Static Public Member Functions

static SuitesListGetSuitesList ()
 

Detailed Description

A singleton object containing all test suites.

Member Function Documentation

◆ Add()

void UnitTest::SuitesList::Add ( const std::string & suite_name,
const TestSuite::Inserter * inf )
inline

Add a test to a suite

Parameters
suite_namename of suite that will contain the test
inftest information

If a suite with that name does not exist, it is created now.

◆ Enable()

void UnitTest::SuitesList::Enable ( const std::string & suite,
bool enable = true )
inline

Changes the enabled state of a suite. A suite that is not enabled will not be run.

Parameters
suitename of suite to be enabled or disabled
enablesuite state

◆ GetSuitesList()

SuitesList & UnitTest::SuitesList::GetSuitesList ( )
inlinestatic

Accesses the singleton object.

Returns
The one and only SuitesList object

◆ Run()

int UnitTest::SuitesList::Run ( const std::string & suite_name,
Reporter & reporter,
int max_time_ms )
inline

Run tests in a suite

Parameters
suite_namename of the suite to run
reportertest reporter to be used for results
max_time_msglobal time constraint in milliseconds
Returns
number of tests that failed or -1 if there is no such suite

◆ RunAll()

int UnitTest::SuitesList::RunAll ( Reporter & reporter,
int max_time_ms )
inline

Run tests in all suites

Parameters
reportertest reporter to be used for results
max_time_msglobal time constraint in milliseconds
Returns
total number of failed tests

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