cxxtools::unit::TestMethod Class Reference

#include <cxxtools/unit/testmethod.h>

Inheritance diagram for cxxtools::unit::TestMethod:
cxxtools::unit::Test cxxtools::Connectable cxxtools::NonCopyable

Public Member Functions

 TestMethod (const std::string &name)
virtual ~TestMethod ()
virtual void run ()
 Runs the test.
virtual void exec (const SerializationInfo *si, unsigned argCount)=0
- Public Member Functions inherited from cxxtools::unit::Test
virtual ~Test ()
 Destructor.
const std::string & name () const
void reportStart (const TestContext &ctx)
 Reports the start of a test.
void reportFinish (const TestContext &ctx)
 Finished notification.
void reportSuccess (const TestContext &ctx)
 Success notification.
void reportSkip (const TestContext &ctx)
 Skip notification.
void reportAssertion (const TestContext &ctx, const Assertion &ass)
 Assertion notification.
void reportException (const TestContext &ctx, const std::exception &ex)
 Exception notification.
void reportError (const TestContext &ctx)
 Error notification.
void reportMessage (const std::string &msg)
 Message notification.
void setParent (Test *test)
Testparent ()
const Testparent () const
void attachReporter (Reporter &r)
 Add reporter for test events.
void detachReporter (Reporter &r)
- Public Member Functions inherited from cxxtools::Connectable
 Connectable ()
 Default constructor.
virtual ~Connectable ()
 Closes all connections.
virtual void onConnectionOpen (const Connection &c)
 Registers a Connection with the Connectable.
virtual void onConnectionClose (const Connection &c)
 Unregisters a Connection from the Connectable.
size_t connectionCount () const

Additional Inherited Members

- Protected Member Functions inherited from cxxtools::unit::Test
 Test (const std::string &name)
 Construct a test by name.
- Protected Attributes inherited from cxxtools::Connectable
std::list< Connection_connections
 A list of all current connections.

Constructor & Destructor Documentation

cxxtools::unit::TestMethod::TestMethod ( const std::string &  name)
inline
virtual cxxtools::unit::TestMethod::~TestMethod ( )
inlinevirtual

Member Function Documentation

virtual void cxxtools::unit::TestMethod::exec ( const SerializationInfo si,
unsigned  argCount 
)
pure virtual
virtual void cxxtools::unit::TestMethod::run ( )
inlinevirtual

Runs the test.

Derived test classes are supposed to implement this method to run the test procedure. A derived class should send the 'started' signal at the begin of the test and send the 'finished' signal at the end of the test. If the test was successful, the 'success' signal is sent, otheriwse one of the signals indicating a failrue. In case of a failed assertion, the signal 'assertion' is sent, if a regular std::exception was the cause of the error the signal 'exception' is sent and and the signal 'error' indicates an unknown exception or error. This method should not propagate any exceptions

Implements cxxtools::unit::Test.


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