Peano
|
#include <TreeTestCaseCollection.h>
Public Member Functions | |
TreeTestCaseCollection (const std::string &testCaseCollectionName="", bool deleteTestCases=true, bool writeToLog=true) | |
Creates a test case collection. | |
virtual | ~TreeTestCaseCollection () |
Destructor. | |
virtual void | run () |
Runs all test cases assigned. | |
virtual void | run (const std::string &prefix) |
Runs all test cases assigned. | |
void | addTestCase (const std::string &fullQualifiedPath, TestCase *testCase) |
Adds a new test case. | |
void | addTestCase (TestCase *testCase) |
Same as above, but fully qualified test case name is extracted from passed object. | |
Public Member Functions inherited from tarch::tests::TestCase | |
TestCase (const std::string &testCaseName) | |
Constructor. | |
virtual | ~TestCase () |
Destructor. | |
int | getNumberOfErrors () const |
std::string | getTestCaseName () const |
Static Private Member Functions | |
static bool | isNameWithoutHierarchy (const std::string &testCaseName) |
static std::string | getFirstIdentifierInHierarchy (const std::string &testCaseName) |
static std::string | getRemainingPathWithoutIdentifier (const std::string &testCaseName) |
Private Attributes | |
std::list< TestCase * > | _testCases |
Sequence of test cases that are executes on a run() call. | |
std::map< std::string, TreeTestCaseCollection * > | _subTests |
bool | _writeToLog |
Tells the collection wheather to log a progression bar. | |
bool | _deleteTestCases |
Tells whether the testcases contained should be deleted uppon destruction of this object. | |
Static Private Attributes | |
static tarch::logging::Log | _log |
Log interface the class writes to. | |
Additional Inherited Members | |
Protected Member Functions inherited from tarch::tests::TestCase | |
TestCase ()=delete | |
Protected Attributes inherited from tarch::tests::TestCase | |
const std::string | _testCaseName |
Name of the test case. | |
int | _errors |
Error counter. | |
bool | _error |
Indicate within macro if one specific validation failed. | |
tarch::tests::TreeTestCaseCollection::TreeTestCaseCollection | ( | const std::string & | testCaseCollectionName = "", |
bool | deleteTestCases = true, | ||
bool | writeToLog = true ) |
Creates a test case collection.
testCaseCollectionName | Name of the test case collection. May not contain ::. If you pass in the empty string "", it is a mere container. It still runs all sub test cases, but it does not dump any progress info on this particular package: Usually you get a.b.c ... ok a.b ... ok a ... pass (no local tests)If a is "", then no message is written. |
Definition at line 11 of file TreeTestCaseCollection.cpp.
References assertion3, and isNameWithoutHierarchy().
|
virtual |
Destructor.
Definition at line 19 of file TreeTestCaseCollection.cpp.
void tarch::tests::TreeTestCaseCollection::addTestCase | ( | const std::string & | fullQualifiedPath, |
TestCase * | testCase ) |
Adds a new test case.
Although you pass a pointer, you are still responsible for the instance management.
You have to specify in the constructor of a TestCaseCollection whether it should delete testcases contained on construction.
@Note: default is set to false (i.e. no destruction)
Definition at line 128 of file TreeTestCaseCollection.cpp.
Referenced by exahype2::getUnitTests(), peano4::getUnitTests(), tarch::getUnitTests(), toolbox::blockstructured::getUnitTests(), toolbox::particles::assignmentchecks::getUnitTests(), toolbox::particles::getUnitTests(), and main().
Same as above, but fully qualified test case name is extracted from passed object.
Definition at line 123 of file TreeTestCaseCollection.cpp.
References tarch::tests::TestCase::getTestCaseName().
|
staticprivate |
Definition at line 38 of file TreeTestCaseCollection.cpp.
References assertion2.
|
staticprivate |
Definition at line 47 of file TreeTestCaseCollection.cpp.
References assertion.
|
staticprivate |
Definition at line 33 of file TreeTestCaseCollection.cpp.
Referenced by TreeTestCaseCollection().
|
virtual |
Runs all test cases assigned.
Implements tarch::tests::TestCase.
Definition at line 56 of file TreeTestCaseCollection.cpp.
Referenced by main().
|
virtual |
Runs all test cases assigned.
Definition at line 61 of file TreeTestCaseCollection.cpp.
References tarch::tests::TestCase::getNumberOfErrors(), logInfo, and tarch::tests::TestCase::run().
|
private |
Tells whether the testcases contained should be deleted uppon destruction of this object.
Definition at line 46 of file TreeTestCaseCollection.h.
|
staticprivate |
Log interface the class writes to.
Definition at line 41 of file TreeTestCaseCollection.h.
|
private |
Definition at line 31 of file TreeTestCaseCollection.h.
|
private |
Sequence of test cases that are executes on a run() call.
The class is not responsible for destroying them.
Definition at line 30 of file TreeTestCaseCollection.h.
|
private |
Tells the collection wheather to log a progression bar.
Definition at line 36 of file TreeTestCaseCollection.h.