diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-04-12 21:34:37 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-04-12 21:34:37 +0000 |
| commit | 8cabaebd9f8689ca96184daf415e3cc6cf67d722 (patch) | |
| tree | 3c1b0f8d4a74147dbf659875e1a646def0dfb7b9 /src/cppunit/TestComposite.cpp | |
| parent | ed406a2966e62072fa6afaca8abc578db7c0c9fb (diff) | |
| download | cppunit-8cabaebd9f8689ca96184daf415e3cc6cf67d722.tar.gz | |
Include/cppunit/CompilerOutputter.
include/cppunit/CompilerOutputter.h:
* src/cppunit/CompilerOutputter.h: deprecated defaultOuputter(). Added
setLocationFormat() and format specifiation in constructor. A string that
represent the location format is used to output the location. Default format
is defined by CPPUNIT_COMPILER_LOCATION_FORMAT.
* include/cppunit/config-msvc6.h:
* include/cppunit/Portability.h: added CPPUNIT_COMPILER_LOCATION_FORMAT. Use
gcc location format if VC++ is not detected.
* include/cppunit/Test.h: fixed documentation.
* include/cppunit/TestListener.h: added startSuite() and endSuite()
callbacks. Added new example to documentation.
* include/cppunit/TestResult.h:
* src/cppunit/TestResult.cpp:
* include/cppunit/TestComposite.h:
* src/cppunit/TestComposite.cpp: Updated to inform the listeners.
* src/qttestrunner/TestBrowserDlgImpl.cpp: used Test new composite interface
instead of RTTI to explore the test hierarchy.
* examples/cppunittest/MockTestListener.h:
* examples/cppunittest/MockTestListener.cpp: updated,added support for
startSuite() and endSuite().
* examples/cppunittest/TestResultTest.h:
* examples/cppunittest/TestResultTest.cpp: added tests for startSuite()
and endSuite().
Diffstat (limited to 'src/cppunit/TestComposite.cpp')
| -rw-r--r-- | src/cppunit/TestComposite.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/src/cppunit/TestComposite.cpp b/src/cppunit/TestComposite.cpp index e5f38c3..1127a4c 100644 --- a/src/cppunit/TestComposite.cpp +++ b/src/cppunit/TestComposite.cpp @@ -18,14 +18,9 @@ TestComposite::~TestComposite() void TestComposite::run( TestResult *result ) { - int childCount = getChildTestCount(); - for ( int index =0; index < childCount; ++index ) - { - if ( result->shouldStop() ) - break; - - getChildTestAt( index )->run( result ); - } + doStartSuite( result ); + doRunChildTests( result ); + doEndSuite( result ); } @@ -49,5 +44,33 @@ TestComposite::getName() const } +void +TestComposite::doStartSuite( TestResult *controller ) +{ + controller->startSuite( this ); +} + + +void +TestComposite::doRunChildTests( TestResult *controller ) +{ + int childCount = getChildTestCount(); + for ( int index =0; index < childCount; ++index ) + { + if ( controller->shouldStop() ) + break; + + getChildTestAt( index )->run( controller ); + } +} + + +void +TestComposite::doEndSuite( TestResult *controller ) +{ + controller->endSuite( this ); +} + + } // namespace CppUnit |
