From 8cabaebd9f8689ca96184daf415e3cc6cf67d722 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Fri, 12 Apr 2002 21:34:37 +0000 Subject: 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(). --- src/cppunit/TestResult.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/cppunit/TestResult.cpp') diff --git a/src/cppunit/TestResult.cpp b/src/cppunit/TestResult.cpp index d5644a4..aacb9a4 100644 --- a/src/cppunit/TestResult.cpp +++ b/src/cppunit/TestResult.cpp @@ -66,7 +66,7 @@ TestResult::addFailure( const TestFailure &failure ) } -/// Informs the result that a test will be started. +/// Informs TestListener that a test will be started. void TestResult::startTest( Test *test ) { @@ -78,7 +78,7 @@ TestResult::startTest( Test *test ) } -/// Informs the result that a test was completed. +/// Informs TestListener that a test was completed. void TestResult::endTest( Test *test ) { @@ -90,6 +90,30 @@ TestResult::endTest( Test *test ) } +/// Informs TestListener that a test suite will be started. +void +TestResult::startSuite( Test *test ) +{ + ExclusiveZone zone( m_syncObject ); + for ( TestListeners::iterator it = m_listeners.begin(); + it != m_listeners.end(); + ++it ) + (*it)->startSuite( test ); +} + + +/// Informs TestListener that a test suite was completed. +void +TestResult::endSuite( Test *test ) +{ + ExclusiveZone zone( m_syncObject ); + for ( TestListeners::iterator it = m_listeners.begin(); + it != m_listeners.end(); + ++it ) + (*it)->endSuite( test ); +} + + /// Returns whether testing should be stopped bool TestResult::shouldStop() const -- cgit v1.2.1