#include <UnitTest.h>
Output of the UnitTester is directed (for now) to stderr as a Tcl list:
{ "testname" { {1 firstTest P} {2 secondTest F} {3 thirdTest I} } {2 1 1 1} }
Definition at line 82 of file UnitTest.h.
Public Member Functions | |
UnitTester (std::string name) | |
virtual | ~UnitTester () |
int | run_tests (int argc, const char *argv[]) |
void | print_tcl_header () |
void | print_tcl_tail () |
void | print_header () |
void | print_results () |
Protected Member Functions | |
virtual void | add_tests ()=0 |
Override this to add your tests. | |
void | add (UnitTest *unit) |
Add a unit test to the suite. | |
Private Types | |
typedef std::vector< UnitTest * > | UnitTestList |
Private Attributes | |
std::string | name_ |
UnitTestList | tests_ |
int | passed_ |
int | failed_ |
int | input_ |
typedef std::vector<UnitTest*> oasys::UnitTester::UnitTestList [private] |
Definition at line 83 of file UnitTest.h.
oasys::UnitTester::UnitTester | ( | std::string | name | ) | [inline] |
Definition at line 86 of file UnitTest.h.
virtual oasys::UnitTester::~UnitTester | ( | ) | [inline, virtual] |
Definition at line 91 of file UnitTest.h.
int oasys::UnitTester::run_tests | ( | int | argc, | |
const char * | argv[] | |||
) | [inline] |
Definition at line 93 of file UnitTest.h.
References add_tests(), failed_, oasys::FatalSignals::init(), oasys::Log::init(), input_, oasys::LOG_NOTICE, name_, passed_, print_header(), print_results(), print_tcl_header(), print_tcl_tail(), oasys::str2level(), tests_, oasys::UNIT_TEST_FAILED, oasys::UNIT_TEST_INPUT, and oasys::UNIT_TEST_PASSED.
void oasys::UnitTester::print_tcl_header | ( | ) | [inline] |
void oasys::UnitTester::print_tcl_tail | ( | ) | [inline] |
Definition at line 212 of file UnitTest.h.
References failed_, input_, passed_, and tests_.
Referenced by run_tests().
void oasys::UnitTester::print_header | ( | ) | [inline] |
void oasys::UnitTester::print_results | ( | ) | [inline] |
Definition at line 220 of file UnitTest.h.
References failed_, name_, and passed_.
Referenced by run_tests().
virtual void oasys::UnitTester::add_tests | ( | ) | [protected, pure virtual] |
void oasys::UnitTester::add | ( | UnitTest * | unit | ) | [inline, protected] |
std::string oasys::UnitTester::name_ [private] |
Definition at line 244 of file UnitTest.h.
Referenced by print_header(), print_results(), print_tcl_header(), and run_tests().
UnitTestList oasys::UnitTester::tests_ [private] |
int oasys::UnitTester::passed_ [private] |
Definition at line 247 of file UnitTest.h.
Referenced by print_results(), print_tcl_tail(), and run_tests().
int oasys::UnitTester::failed_ [private] |
Definition at line 248 of file UnitTest.h.
Referenced by print_results(), print_tcl_tail(), and run_tests().
int oasys::UnitTester::input_ [private] |