MOAB: Mesh Oriented datABase  (version 5.2.1)
MBMesquite::TestRunner Class Reference

A class the runs cppunit tests, outputs results in an organized manner. More...

#include <MesquiteTestRunner.hpp>

Public Member Functions

 TestRunner ()
virtual ~TestRunner ()
void add_test (CppUnit::Test *test)
virtual bool run (const std::string &name_of_run, std::ostream &out_stream=std::cout)

Protected Member Functions

void delete_all_tests ()
const std::string running_test_prefix ()
void indent ()
virtual void startSuite (CppUnit::TestSuite *suite)
virtual void startTest (CppUnit::Test *test)
virtual void addFailure (const CppUnit::TestFailure &failure)
virtual void endTest (CppUnit::Test *test)
virtual void endSuite (CppUnit::TestSuite *suite)
void push_timer (Mesquite::Timer *timer)
MBMesquite::Timerpop_timer ()

Private Attributes

std::vector< CppUnit::Test * > mTests
std::stack< Mesquite::Timer * > mTimers
std::stack< int > failureCounters
std::vector< std::string > failedTestNames
std::ostream * mOut
CppUnit::TestResult * myResult
unsigned int indentLevel
unsigned int numSuccesses
unsigned int numFailures
unsigned int numExceptions

Static Private Attributes

static const unsigned char INDENT_SIZE

Detailed Description

A class the runs cppunit tests, outputs results in an organized manner.

The test runner manages the life cycle of the added tests.

Here is an example of use:

 MBMesquite::TestRunner runner;
 runner.addTest( ExampleTestCase::suite() );
 runner.run( "Darryl's Test Run" );    // Run all tests and wait

Definition at line 56 of file MesquiteTestRunner.hpp.


Constructor & Destructor Documentation

virtual MBMesquite::TestRunner::~TestRunner ( ) [virtual]

Member Function Documentation

void MBMesquite::TestRunner::add_test ( CppUnit::Test *  test)
virtual void MBMesquite::TestRunner::addFailure ( const CppUnit::TestFailure &  failure) [protected, virtual]
virtual void MBMesquite::TestRunner::endSuite ( CppUnit::TestSuite *  suite) [protected, virtual]
virtual void MBMesquite::TestRunner::endTest ( CppUnit::Test *  test) [protected, virtual]
void MBMesquite::TestRunner::indent ( ) [inline, protected]
void MBMesquite::TestRunner::push_timer ( Mesquite::Timer *  timer) [inline, protected]
virtual bool MBMesquite::TestRunner::run ( const std::string &  name_of_run,
std::ostream &  out_stream = std::cout 
) [virtual]
const std::string MBMesquite::TestRunner::running_test_prefix ( ) [protected]
virtual void MBMesquite::TestRunner::startSuite ( CppUnit::TestSuite *  suite) [protected, virtual]
virtual void MBMesquite::TestRunner::startTest ( CppUnit::Test *  test) [protected, virtual]

Member Data Documentation

std::vector< std::string > MBMesquite::TestRunner::failedTestNames [private]

Definition at line 85 of file MesquiteTestRunner.hpp.

std::stack< int > MBMesquite::TestRunner::failureCounters [private]

Definition at line 84 of file MesquiteTestRunner.hpp.

const unsigned char MBMesquite::TestRunner::INDENT_SIZE [static, private]

Definition at line 92 of file MesquiteTestRunner.hpp.

unsigned int MBMesquite::TestRunner::indentLevel [private]

Definition at line 88 of file MesquiteTestRunner.hpp.

std::ostream* MBMesquite::TestRunner::mOut [private]

Definition at line 86 of file MesquiteTestRunner.hpp.

std::vector< CppUnit::Test* > MBMesquite::TestRunner::mTests [private]

Definition at line 82 of file MesquiteTestRunner.hpp.

std::stack< Mesquite::Timer* > MBMesquite::TestRunner::mTimers [private]

Definition at line 83 of file MesquiteTestRunner.hpp.

CppUnit::TestResult* MBMesquite::TestRunner::myResult [private]

Definition at line 87 of file MesquiteTestRunner.hpp.

unsigned int MBMesquite::TestRunner::numExceptions [private]

Definition at line 91 of file MesquiteTestRunner.hpp.

unsigned int MBMesquite::TestRunner::numFailures [private]

Definition at line 90 of file MesquiteTestRunner.hpp.

unsigned int MBMesquite::TestRunner::numSuccesses [private]

Definition at line 89 of file MesquiteTestRunner.hpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines