DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
The test manager singleton manages the list of available test cases and executes them. More...
Public Member Functions | |
OFTestTest & | currentTest () |
void | addTest (OFTestTest *test) |
Register a test with this test manager. More... | |
int | runTests (const OFList< OFTestTest * > &tests, const char *module) |
Run a list of test cases. More... | |
int | run (int argc, char *argv[], const char *module) |
Handle the given arguments and run the requested test case. More... | |
Static Public Member Functions | |
static OFTestManager & | instance () |
Private Member Functions | |
OFTestManager () | |
Private constructor, this is a singleton! | |
OFTestManager (const OFTestManager &obj) | |
Private undefined copy constructor. | |
OFTestManager & | operator= (const OFTestManager &obj) |
Private undefined assignment operator. | |
OFBool | buildTestsToRun (OFCommandLine &cmd, OFList< OFTestTest * > &tests) const |
Build a list of tests which should be executed from the command line. More... | |
OFBool | testMatches (const OFTestTest *test, const OFString &str) const |
Test if the test name matches the given name. More... | |
Private Attributes | |
OFList< OFTestTest * > | tests_ |
List of tests. Statically allocated, so don't have to be freed. | |
OFTestTest * | curTest_ |
Currently running test. | |
OFBool | exhaustive_ |
Should slow tests be run, too? | |
The test manager singleton manages the list of available test cases and executes them.
|
inline |
Register a test with this test manager.
test | the test to register |
References OFList< T >::push_back(), and tests_.
|
inlineprivate |
Build a list of tests which should be executed from the command line.
cmd | command line arguments which should be parsed |
tests | will be set to the list of tests to run |
References OFList< T >::begin(), OFTestTest::EF_Slow, OFList< T >::end(), OFList< T >::erase(), exhaustive_, OFCommandLine::getParam(), OFCommandLine::getParamCount(), OFList< T >::push_back(), testMatches(), and tests_.
Referenced by run().
|
inline |
References curTest_.
|
inlinestatic |
|
inline |
Handle the given arguments and run the requested test case.
This function should be used for implementing main().
argc | number of arguments |
argv | list of arguments |
module | name of the module that we are testing for |
References OFLog::addOptions(), OFCommandLine::AF_Exclusive, OFList< T >::begin(), buildTestsToRun(), OFString::c_str(), OFLog::configureFromCommandLine(), OFList< T >::empty(), OFList< T >::end(), exhaustive_, OFLogger::FATAL_LOG_LEVEL, OFFIS_DCMTK_RELEASEDATE, OFFIS_DCMTK_VERSION, OFCmdParam::PM_MultiOptional, runTests(), OFCommandLine::setParamColumn(), and OFList< T >::size().
|
inline |
Run a list of test cases.
The results will be printed on the console.
tests | tests to execute |
References OFList< T >::begin(), curTest_, OFList< T >::empty(), OFList< T >::end(), and OFList< T >::size().
Referenced by run().
|
inlineprivate |
Test if the test name matches the given name.
This function supports '?' and '*' for wildcards. However, '*' can only be used at the end of string.
test | test to check against |
str | the string describing the tests |
References OFString::c_str(), and OFTestTest::getTestName().
Referenced by buildTestsToRun().