Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ccunit::AutoTestSuite Class Reference

Automagically register and run tests. More...

#include <AutoTest.hh>

Inheritance diagram for ccunit::AutoTestSuite:

ccunit::TestSuite ccunit::TestComponent List of all members.

Public Methods

virtual void Add (TestComponentPtr child)
 Calls the super classes Add function. Ensures tests will be run. More...


Static Public Methods

AutoTestSuite & instance ()
 Singleton access. More...

void finish ()
 function to register with _atexit (way cool...). More...


Private Methods

 AutoTestSuite ()
 AutoTestSuite (const AutoTestSuite &)
AutoTestSuite & operator= (const AutoTestSuite &)

Detailed Description

Automagically register and run tests.

The purpose of this class is to eliminate some of the boiler-plate code used to create a test runner (i.e., RunTests.cc). This code allows tests to be registered, and run automatically.

Test classes (UnitTest) are added using ccunit::registerTest<T>(), where T is the class type.

Once one or more test classes are registered, then the program will automatically run and print the results on exit.

<note>If this level of automation is not to your liking, then all tests can be collected and run manually as in RunTests.cc.</note>

The use of the auto test functionality is demonstrated in AutoTestTest.hh, AutoTestTest.cc, and AutoTestMain.cc.

Definition at line 29 of file AutoTest.hh.


Constructor & Destructor Documentation

ccunit::AutoTestSuite::AutoTestSuite   [private]
 

Definition at line 9 of file AutoTest.cc.

Referenced by instance.

ccunit::AutoTestSuite::AutoTestSuite const AutoTestSuite &    [private]
 


Member Function Documentation

void ccunit::AutoTestSuite::Add TestComponentPtr    child [virtual]
 

Calls the super classes Add function. Ensures tests will be run.

Reimplemented from ccunit::TestSuite.

Definition at line 22 of file AutoTest.cc.

References ccunit::TestComponentPtr.

void ccunit::AutoTestSuite::finish   [static]
 

function to register with _atexit (way cool...).

Definition at line 36 of file AutoTest.cc.

AutoTestSuite & ccunit::AutoTestSuite::instance   [static]
 

Singleton access.

Definition at line 15 of file AutoTest.cc.

References AutoTestSuite.

Referenced by main.

AutoTestSuite& ccunit::AutoTestSuite::operator= const AutoTestSuite &    [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Apr 2 15:33:26 2002 for libccunit by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002

Project hosted on sourceforge SourceForge Logo