Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

easyunit::DefaultTestPrinter Class Reference

This is the default testprinter used by easyunit testregistry when the user calls the runAndPrint() method without specifying a testprinter. More...

#include <defaulttestprinter.h>

Inheritance diagram for easyunit::DefaultTestPrinter:

easyunit::TestPrinter List of all members.

Public Member Functions

 DefaultTestPrinter ()
 Default constructor that sets the header level to normal and the output source to the standard output.
virtual ~DefaultTestPrinter ()
 Empty destructor.
virtual void print (const TestResult *testResult)
 Prints a header depending of the header level and details about each test to the output_.
void setHeaderLevel (headerLevel level)
 Set the header level of the printer.
void showSuccessDetail (bool show)
 Set whether or not the printer should display the details of test that succeeded.
void setOutput (FILE *output)
 Set the output to which the printer will print results.

Protected Member Functions

virtual void printHeader (const TestResult *testResult)
virtual void printTests (TestCase *testCase)
virtual void printResults (Test *test)
virtual void printCompleteHeader (const TestResult *testResult)
virtual void printNormalHeader (const TestResult *testResult)

Protected Attributes

int testsTotal_
int testFailuresTotal_
int failuresTotal_
headerLevel level_
bool showSuccessDetail_
FILE * output_

Detailed Description

This is the default testprinter used by easyunit testregistry when the user calls the runAndPrint() method without specifying a testprinter.

This testprinter writes plain text result to any supplied file. The default file is the standard output.

You may customize the outpur format by specifying the header level and if you wish the testprinter to print details about each success.

The default header level is normal and by default, the testprinter does not print details about each success.


Constructor & Destructor Documentation

easyunit::DefaultTestPrinter::DefaultTestPrinter  ) 
 

Default constructor that sets the header level to normal and the output source to the standard output.

virtual easyunit::DefaultTestPrinter::~DefaultTestPrinter  )  [virtual]
 

Empty destructor.


Member Function Documentation

virtual void easyunit::DefaultTestPrinter::print const TestResult testResult  )  [virtual]
 

Prints a header depending of the header level and details about each test to the output_.

Parameters:
testResult Results of all tests that were ran.

Implements easyunit::TestPrinter.

virtual void easyunit::DefaultTestPrinter::printCompleteHeader const TestResult testResult  )  [protected, virtual]
 

virtual void easyunit::DefaultTestPrinter::printHeader const TestResult testResult  )  [protected, virtual]
 

virtual void easyunit::DefaultTestPrinter::printNormalHeader const TestResult testResult  )  [protected, virtual]
 

virtual void easyunit::DefaultTestPrinter::printResults Test test  )  [protected, virtual]
 

virtual void easyunit::DefaultTestPrinter::printTests TestCase testCase  )  [protected, virtual]
 

void easyunit::DefaultTestPrinter::setHeaderLevel headerLevel  level  ) 
 

Set the header level of the printer.

Parameters:
level Header level that will be used during print()

void easyunit::DefaultTestPrinter::setOutput FILE *  output  ) 
 

Set the output to which the printer will print results.

Parameters:
output Output used to print the results

void easyunit::DefaultTestPrinter::showSuccessDetail bool  show  ) 
 

Set whether or not the printer should display the details of test that succeeded.

Parameters:
show Set to true to display details about success


Member Data Documentation

int easyunit::DefaultTestPrinter::failuresTotal_ [protected]
 

headerLevel easyunit::DefaultTestPrinter::level_ [protected]
 

FILE* easyunit::DefaultTestPrinter::output_ [protected]
 

bool easyunit::DefaultTestPrinter::showSuccessDetail_ [protected]
 

int easyunit::DefaultTestPrinter::testFailuresTotal_ [protected]
 

int easyunit::DefaultTestPrinter::testsTotal_ [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Mar 4 09:51:25 2005 for EasyUnit by doxygen 1.3.8