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

ccunit::TestSuite Class Reference

#include <TestSuite.hh>

Inheritance diagram for ccunit::TestSuite:

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

Public Methods

 TestSuite (const string &name="(no name)", TestSuiteFormatterPtr formatter=TestSuiteFormatterPtr(new TestSuiteFormatter()))
 Create a new test suite. More...

virtual ~TestSuite ()
virtual void report (ostream &ostr)
 Print a report on an output stream. More...

virtual void Add (TestComponentPtr child)
 add a component to a composite; must be heap allocated! More...

virtual void Remove (TestComponentPtr child)
 remove a component from a composite. More...

virtual bool CheckRecursion (TestComponent *target) const
 return true for attempts to add self to composite. More...

virtual void setFormatter (TestSuiteFormatterPtr fmt_p)
 set the output formatter. More...


Protected Methods

virtual void run_tests ()
 run all the tests. More...


Private Types

typedef list< TestComponentPtrTEST_LIST_t
 Type of the tests container. More...


Private Methods

virtual void reset ()
 To reset the test. More...

 TestSuite (const TestSuite &)
TestSuite & operator= (const TestSuite &)

Private Attributes

TEST_LIST_t m_tests
 The tests to be run. More...

TestSuiteFormatterPtr mp_formatter
 Output formatter (to support different report types). More...


Detailed Description

A composite set of tests.

#

Id:
TestSuite.hh,v 1.2 2002/04/01 23:37:37 canislupus Exp
#

The TestSuite is a way for tests to be run and tabulated as a unified group.

Author:
\URL[Dale K. Hawkins]{mailto:dhawkins@cdrgts.com}.
Version:
#
Revision:
1.2
# \begin{verbatim}
Log:
TestSuite.hh,v
Revision 1.2 2002/04/01 23:37:37 canislupus Progress on Doxygen integration. Added abstract report formatter (generator?). Doxygen output is not right *sigh*.

Revision 1.1.1.1 2002/03/28 20:16:56 canislupus

Revision 1.1 2001/04/12 17:47:14 dhawkins Initial checkin.

\end{verbatim}

See also:
UnitTest

Definition at line 44 of file TestSuite.hh.


Member Typedef Documentation

typedef list<TestComponentPtr> ccunit::TestSuite::TEST_LIST_t [private]
 

Type of the tests container.

Definition at line 76 of file TestSuite.hh.


Constructor & Destructor Documentation

ccunit::TestSuite::TestSuite const string &    name = "(no name)",
TestSuiteFormatterPtr    formatter = TestSuiteFormatterPtr(new TestSuiteFormatter())
 

Create a new test suite.

Definition at line 20 of file TestSuite.cc.

References ccunit::TestSuiteFormatterPtr.

virtual ccunit::TestSuite::~TestSuite   [inline, virtual]
 

Definition at line 53 of file TestSuite.hh.

ccunit::TestSuite::TestSuite const TestSuite &    [private]
 


Member Function Documentation

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

add a component to a composite; must be heap allocated!

Reimplemented from ccunit::TestComponent.

Reimplemented in ccunit::AutoTestSuite.

Definition at line 87 of file TestSuite.cc.

References m_tests, and ccunit::TestComponentPtr.

Referenced by main.

bool ccunit::TestSuite::CheckRecursion TestComponent   target const [virtual]
 

return true for attempts to add self to composite.

Reimplemented from ccunit::TestComponent.

Definition at line 117 of file TestSuite.cc.

References m_tests.

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

void ccunit::TestSuite::Remove TestComponentPtr    child [virtual]
 

remove a component from a composite.

Reimplemented from ccunit::TestComponent.

Definition at line 110 of file TestSuite.cc.

References m_tests, and ccunit::TestComponentPtr.

void ccunit::TestSuite::report ostream &    ostr [virtual]
 

Print a report on an output stream.

Implements ccunit::TestComponent.

Definition at line 45 of file TestSuite.cc.

References ccunit::TestComponent::checkRun, m_tests, and mp_formatter.

void ccunit::TestSuite::reset   [private, virtual]
 

To reset the test.

Reimplemented from ccunit::TestComponent.

Definition at line 73 of file TestSuite.cc.

References m_tests.

Referenced by run_tests.

void ccunit::TestSuite::run_tests   [protected, virtual]
 

run all the tests.

Implements ccunit::TestComponent.

Definition at line 27 of file TestSuite.cc.

References ccunit::TestComponent::m_hasRun, ccunit::TestComponent::m_nFail, ccunit::TestComponent::m_nPass, m_tests, and reset.

void ccunit::TestSuite::setFormatter TestSuiteFormatterPtr    fmt_p [virtual]
 

set the output formatter.

Definition at line 67 of file TestSuite.cc.

References mp_formatter, and ccunit::TestSuiteFormatterPtr.

Referenced by main.


Member Data Documentation

TEST_LIST_t ccunit::TestSuite::m_tests [private]
 

The tests to be run.

Definition at line 79 of file TestSuite.hh.

Referenced by Add, CheckRecursion, Remove, report, reset, and run_tests.

TestSuiteFormatterPtr ccunit::TestSuite::mp_formatter [private]
 

Output formatter (to support different report types).

Definition at line 89 of file TestSuite.hh.

Referenced by report, and setFormatter.


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

Project hosted on sourceforge SourceForge Logo