|
Jon Test
C++ Unit Test Tool. Not for production -- sample code only
|
Singleton that collects all TEST_SUITE()s, to run on demand. More...
#include <TestRunner.h>

Public Types | |
| typedef std::vector< std::string > | TestNames |
| List of Test Names as: "<suite>" or "<suite>:<case>". | |
Public Member Functions | |
| void | add (const char *const name, TestSuiteInterface *const suite) |
| Add the suite by name. | |
| bool | isValid (const std::string &test) const |
| Determine if test can be run as one of: a valid Test Suite, or Test Suite:Test Case. | |
| void | listTestSuites (std::ostream &out) const |
| List available Test Suites to out. | |
| void | listTestCases (std::ostream &out) const |
| List available Test Cases to out. | |
| Count | run (Logger &logger) const |
| Run all tests that have been add()ed. | |
| Count | run (Logger &logger, const TestNames &tests) const |
| Run the specified tests. | |
Static Public Member Functions | |
| static TestRunner & | get () |
| Get the singleton. | |
Private Member Functions | |
| TestRunner ()=default | |
Private Attributes | |
| std::map< std::string, TestSuiteInterface * > | suites |
| Mapping of test suite name to test suite. | |
Singleton that collects all TEST_SUITE()s, to run on demand.
Definition at line 19 of file TestRunner.h.
| typedef std::vector<std::string> JonTest::TestRunner::TestNames |
List of Test Names as: "<suite>" or "<suite>:<case>".
Definition at line 30 of file TestRunner.h.
|
privatedefault |
Add the suite by name.
| name | Name of suite |
| suite | Test Suite |
Definition at line 60 of file TestRunner.cpp.
|
static |
Get the singleton.
Definition at line 54 of file TestRunner.cpp.
Determine if test can be run as one of: a valid Test Suite, or Test Suite:Test Case.
Definition at line 69 of file TestRunner.cpp.
| void JonTest::TestRunner::listTestCases | ( | std::ostream & | out | ) | const |
| void JonTest::TestRunner::listTestSuites | ( | std::ostream & | out | ) | const |
Run all tests that have been add()ed.
<
| logger | To report status to |
Definition at line 142 of file TestRunner.cpp.
Run the specified tests.
Any element of tests that fails isValid(test) will be reported as an error and test failure.
| logger | To report status to |
| tests | To run |
Definition at line 158 of file TestRunner.cpp.
|
private |
Mapping of test suite name to test suite.
Definition at line 23 of file TestRunner.h.