Peano
Loading...
Searching...
No Matches
tarch::tests::TestCaseCollection Class Reference

Contains a sequence of tests which have to be executed sequentially. More...

#include <TestCaseCollection.h>

Inheritance diagram for tarch::tests::TestCaseCollection:
Collaboration diagram for tarch::tests::TestCaseCollection:

Public Member Functions

 TestCaseCollection (const std::string &testCaseCollectionName, bool deleteTestCases=true, bool writeToLog=true)
 Creates a test case collection.
 
virtual ~TestCaseCollection ()
 Destructor.
 
virtual void run ()
 Runs all test cases assigned.
 
void addTestCase (TestCase *testCase)
 Adds a new test case.
 
- Public Member Functions inherited from tarch::tests::TestCase
 TestCase (const std::string &testCaseName)
 Constructor.
 
virtual ~TestCase ()
 Destructor.
 
int getNumberOfErrors () const
 
std::string getTestCaseName () const
 

Private Member Functions

 TestCaseCollection ()
 

Private Attributes

std::list< TestCase * > _testCases
 Sequence of test cases that are executes on a run() call.
 
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.
 

Detailed Description

Contains a sequence of tests which have to be executed sequentially.

The object manages a sequence of references. The user is responsible for creating and destroying the test case instances.

Author
Tobias Weinzierl
Version
Revision
1.7

Definition at line 29 of file TestCaseCollection.h.

Constructor & Destructor Documentation

◆ TestCaseCollection() [1/2]

tarch::tests::TestCaseCollection::TestCaseCollection ( )
private

Definition at line 7 of file TestCaseCollection.cpp.

◆ TestCaseCollection() [2/2]

tarch::tests::TestCaseCollection::TestCaseCollection ( const std::string & testCaseCollectionName,
bool deleteTestCases = true,
bool writeToLog = true )

Creates a test case collection.

Parameters
testCaseCollectionNameName of the test case collection.

Definition at line 12 of file TestCaseCollection.cpp.

◆ ~TestCaseCollection()

tarch::tests::TestCaseCollection::~TestCaseCollection ( )
virtual

Destructor.

Definition at line 19 of file TestCaseCollection.cpp.

Member Function Documentation

◆ addTestCase()

void tarch::tests::TestCaseCollection::addTestCase ( 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 test cases contained on construction.

Definition at line 58 of file TestCaseCollection.cpp.

◆ run()

void tarch::tests::TestCaseCollection::run ( )
virtual

Runs all test cases assigned.

Implements tarch::tests::TestCase.

Definition at line 29 of file TestCaseCollection.cpp.

References tarch::tests::TestCase::getNumberOfErrors(), logInfo, logTraceInWith1Argument, logTraceOutWith2Arguments, and tarch::tests::TestCase::run().

Here is the call graph for this function:

Field Documentation

◆ _deleteTestCases

bool tarch::tests::TestCaseCollection::_deleteTestCases
private

Tells whether the testcases contained should be deleted uppon destruction of this object.

Definition at line 50 of file TestCaseCollection.h.

◆ _log

tarch::logging::Log tarch::tests::TestCaseCollection::_log
staticprivate

Log interface the class writes to.

Definition at line 45 of file TestCaseCollection.h.

◆ _testCases

std::list<TestCase*> tarch::tests::TestCaseCollection::_testCases
private

Sequence of test cases that are executes on a run() call.

The class is not responsible for destroying them.

Definition at line 35 of file TestCaseCollection.h.

◆ _writeToLog

bool tarch::tests::TestCaseCollection::_writeToLog
private

Tells the collection wheather to log a progression bar.

Definition at line 40 of file TestCaseCollection.h.


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