A singleton object containing all test suites.
More...
#include <utpp.h>
|
void | Add (const std::string &suite, const TestSuite::Inserter *inf) |
|
int | Run (const std::string &suite, Reporter &reporter, std::chrono::milliseconds max_time) |
|
int | RunAll (Reporter &reporter, std::chrono::milliseconds max_time) |
|
void | Enable (const std::string &suite, bool enable=true) |
|
A singleton object containing all test suites.
◆ Add()
void UnitTest::SuitesList::Add |
( |
const std::string & | suite_name, |
|
|
const TestSuite::Inserter * | inf ) |
|
inline |
Add a test to a suite
- Parameters
-
suite_name | name of suite that will contain the test |
inf | test 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
-
suite | name of suite to be enabled or disabled |
enable | suite 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, |
|
|
std::chrono::milliseconds | max_time ) |
|
inline |
Run tests in a suite
- Parameters
-
suite_name | name of the suite to run |
reporter | test reporter to be used for results |
max_time | global 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, |
|
|
std::chrono::milliseconds | max_time ) |
|
inline |
Run tests in all suites
- Parameters
-
reporter | test reporter to be used for results |
max_time | global time constraint in milliseconds |
- Returns
- total number of failed tests
The documentation for this class was generated from the following file: