class ExecutionTracer : StreamingObserver

Execution Trace Log.

An execution trace log is useful in situations where a test fails so that the whole test driver executable crashes (i.e. because of a segmentation fault). In such cases, having only the a terminal log might not be enough. The execution tracer logs every single step during test execution and immediately flushes the output stream buffer. Because this leads to high I/O load, the execution trace log should only be enabled when necessary.
The output of the execution trace log is designed so that it could be read by humans and easily parsed by other programs.

See also observer output examples



Public Members:
    ExecutionTracer ( TestManager& manager, ostream& stream, bool enabled = false, bool permitCancel = true ) ;
    Create an execution tracer.
    Note that the default enabled-status is false, so it must be enabled explicitly (typically by a command line option).

    The default option handlers for an execution tracer:
    The flag "-t" enables the execution tracer, the flag "-tf" (trace file) enables the tracer and sets the output file. Both flags are consumed.


    virtual ~ExecutionTracer () ;
    The destructor.
    Does nothing special.

    virtual void beginSession (TestSession& session) ;
    Logs the begin of a test session.
    From now on the execution tracer logs every single step during execution of the test session.

    virtual void endSession (TestSession& session, bool cancelled) ;
    Logs the end of a session.
    In addition, it is logged whether the session was cancelled or completed and a test session summary is written.

    virtual void beginTest (Test& test, TestSession& session) ;
    A new test was started.
    Both test cases and test suites are logged with their name. At the beginning of each test phase (set-up, execution or (premature) tear-down), a test phase marker is written to the log stream. This allows to exactly detect in which phase a test crashes.

    virtual void endTest (Test& test, TestSession& session, bool success) ;
    A test was finished.
    The test outcome is logged (passed or failed).

    virtual void testSkipped (Test& test, TestSession& session) ;
    A test was skipped.
    Also skipping of tests is recorded to make the execution trace complete. if more than one are skipped altogether, the number of skipped tests is logged as well.

    virtual void logException (TestExceptionRecord& mr, TestSession& session) ;
    An exception is logged.
    All kinds of exceptions are also put to the trace log.




Friends:
    friend class PhaseTracker ;
    Test phase tracker.
    Used to track the execution phases of a single test. Used only inside ExecutionTracer.




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