TextTestProgressListener

   
TextTestProgressListener

Description

The class TextTestProgressListener (see Figure C-35) is a subclass of TestListener . It prints a textual "progress bar" indicating the progress of a series of tests as they are run. A sample of its output is shown here:

 ....F...E... 

This shows that 10 tests were run, and 1 failure and 1 error occurred.

TextTestProgressListener belongs to the namespace CppUnit . It is declared in TextTestProgressListener.h and implemented in TextTestProgressListener.cpp .

Figure C-35. The class TextTestProgressListener
figs/utf_ac35.gif

Declaration

 class TextTestProgressListener : public TestListener 

Constructors/Destructors


TextTestProgressListener( )

A constructor.


virtual ~TextTestProgressListener( )

A destructor.

Public Methods


void addFailure(const TestFailure &failure)

A method that informs TextTestProgressListener of a TestFailure . If the TestFailure is an assertion failure, an F is printed; otherwise , an E is printed.


void done( )

Prints a carriage return and flushes the output stream to complete the output.


void startTest(Test *test)

A method that informs TextTestProgressListener that a Test is about to be run. A period ( .) is printed to indicate progress.

Protected/Private Methods


TextTestProgressListener(const TextTestProgressListener& copy)

A copy constructor, scoped private to prevent its use.


void operator=(const TextTestProgressListener& copy)

A copy operator, scoped private to prevent its use.

Attributes

None.



Unit Test Frameworks
Unit Test Frameworks
ISBN: 0596006896
EAN: 2147483647
Year: 2006
Pages: 146
Authors: Paul Hamill

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net