Generic hardware access library
|
A class to perform automated testing of classes. More...
#include <TestMaster.hh>
Public Member Functions | |
TestMaster (std::ostream &os=std::cout) | |
void | registerTester (TesterInterface &newTester) |
Register a class with testcode with the TestMaster. | |
bool | doTest () throw (HardwareAccessException) |
Excecute a test with all registered objects. | |
void | printShortReport () |
Print the name of the test and if the test was successfull or not. | |
void | printLongReport () |
Print a long description of the test and if is was successfull. | |
Private Attributes | |
std::ostream & | os_ |
std::list< TesterInterface * > | testerList_ |
std::map< TesterInterface *, bool > | resultMap_ |
bool | testDone_ |
A class to perform automated testing of classes.
The TestMaster can be used to perform automatic testing of software classes. The testcode for a software class must be implemented in a class which inherits from the TesterInterface. TesterInterfaces can be registered with teh TestMaster, all registered classes can be tested and the result of the test can be reported. In the HAL this is used to do tests on newly written classes.
Definition at line 33 of file TestMaster.hh.
HAL::TestMaster::TestMaster | ( | std::ostream & | os = std::cout | ) |
Definition at line 3 of file TestMaster.cc.
bool HAL::TestMaster::doTest | ( | ) | throw (HardwareAccessException) |
Excecute a test with all registered objects.
This method calls the execute() method of all registered TesterInterfaces.
Definition at line 12 of file TestMaster.cc.
void HAL::TestMaster::printLongReport | ( | ) |
Print a long description of the test and if is was successfull.
Definition at line 44 of file TestMaster.cc.
void HAL::TestMaster::printShortReport | ( | ) |
Print the name of the test and if the test was successfull or not.
Definition at line 33 of file TestMaster.cc.
void HAL::TestMaster::registerTester | ( | HAL::TesterInterface & | newTester | ) |
Register a class with testcode with the TestMaster.
Definition at line 8 of file TestMaster.cc.
std::ostream& HAL::TestMaster::os_ [private] |
Definition at line 61 of file TestMaster.hh.
std::map< TesterInterface*, bool > HAL::TestMaster::resultMap_ [private] |
Definition at line 63 of file TestMaster.hh.
bool HAL::TestMaster::testDone_ [private] |
Definition at line 64 of file TestMaster.hh.
std::list< TesterInterface* > HAL::TestMaster::testerList_ [private] |
Definition at line 62 of file TestMaster.hh.