class VerboseSessionLog : StreamingObserver

Test observer that does verbose test logging.

A verbose terminal logger logs the execution of every test in a separate line. Each test suite increases the level of indentation. That leads to a tree like representation of the test session. First the name of the test is printed and then the status is logged. Test cases are prefixed with a dash, test suites with a plus.

See also observer output examples



Public Members:
    VerboseSessionLog ( ostream& stream, bool enabled = false, bool permitCancel = true ) ;
    Creates a verbose session log.
    The only mandatory parameter is the output stream. Also the activation state and the permission of test session cancellation could be set.

    Verbose seesion logs underatnd the following defauult options:
    The flag "-v" enables the verbose session log; the flag is consumed.


    virtual ~VerboseSessionLog () ;
    Destroys the log.
    Does nothing extra. See StreamingObserver.

    virtual void beginSession (TestSession& session) ;
    The verbose terminal log is reset.
    The indentation level is set to 0.

    virtual void endSession (TestSession& session, bool cancelled) ;
    The session has come to an end.
    Nothing is done but a newline is printed.

    virtual void beginTest (Test& test, TestSession& session) ;
    The name of the test is logged.
    If the test is a test suite, a '+' is printed in front of the name and the indentation level is increased. Otherwise a '-' is written in front of the test case name.

    virtual void endTest (Test& test, TestSession& session, bool success) ;
    The success status of the test is logged.
    OK is printed if everything went fine, otherwise FAILED is written.

    virtual void testSkipped (Test& test, TestSession& session) ;
    A test was skipped.
    The name of the test is printed with a leading '!'. In case of a test suite, the number of contained tests is printed in parentheses after the name.

    virtual void logException (TestExceptionRecord& mr, TestSession& session) ;
    An exception has happened.
    Nothing is done. Exception are not logged!




Protected Members:
    void indent () ;
    Leading spaces for the indentation are printed.
    Used for creating the tree-like representation.




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