class TestObserver

Interface for test observers.

A test observer is an object that supervises the execution of unit tests. It is informed by the TestManager about the execution of unit tests and about all generated exceptions. A test observer instance must register itself to the TestManager before tests are executed.



Public Members:
    virtual bool configureFrom (ArgVector& args) ;
    Configure the observer from command line options.
    This functions allows the observer to configure itself according to the given command line options (in the usual C/C++ command line format). When this function returns true, The observer is included in observing the execution of tests. If false is returned, the observer is disabled until this function called again.

    virtual bool permitsCancel () const ;
    Check if the observer permits cancelling the execution of tests.
    If this function returns true, the TestManager is allowed to cancel a test session; it does notmean that it will stop all test activities. If another observer returns false, the TestManager will continue testing.

    virtual void beginSession (TestSession& session) ;
    A new test session is started.
    This function is called by the TestManager before it starts running unit tests. The observer could do necessary initialization steps and/or it could generate a test report header.

    virtual void endSession (TestSession& session, bool cancelled) ;
    A test session has come to an end.
    After the test session was terminated, this function is called. Parameter cancelled is true when the session was stopped during execution. In this case, most likely not all tests have been executed.

    virtual void beginTest (Test& test, TestSession& session) ;
    Another test is executed.
    This functions is called before another unit test is run. It does not matter if that test is a test case or a test suite.

    virtual void endTest (Test& test, TestSession& session, bool success) ;
    A test was run.
    Called after running the test was finished. The parameter success is true when no test exception was thrown during execution.

    virtual void testSkipped (Test& test, TestSession& session) ;
    A test is skipped.
    When a test is directly skipped, this function is called. It is not called for test cases and test suites contained in a test suite that is skipped itself. That also means that the test object could be a test case or a test suite.

    virtual void logException (TestExceptionRecord& mr, TestSession& session) ;
    A test exception has occurred.
    If some test exception was generated by a test, this function is called.




Protected Members:
    virtual ~TestObserver () ;
    Virtual destructor.
    Ensures that all derived classes have a virtual destructor too.




The Scrunitizer C++ Unit Test Framework
by Bernd Linowski

[Scrunitizer]  [Overview]  [Cookbook]  [Download]  [Index]  [Linosphere]

Page generated: 1 Nov 2000
(C) by Bernd Linowski
scrunitizer@linosphere.de