Update of /cvsroot/cppunit/cppunit2/src/cpput
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21663/src/cpput
Modified Files:
cpput.vcproj testcase.cpp testfailureguard.cpp testrunner.cpp
testsuite.cpp
Removed Files:
testcontext.cpp
Log Message:
* Removed TestContext.
* TestContext/AbstractTestCase: moved responsibility of running the test to AbstractTestCase.
Index: testsuite.cpp
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** testsuite.cpp 17 Nov 2004 21:47:10 -0000 1.4
--- testsuite.cpp 20 Nov 2004 15:26:38 -0000 1.5
***************
*** 1,5 ****
#include <cpput/testsuite.h>
#include <cpput/functor.h>
- #include <cpput/testcontext.h>
#include <cpput/testvisitor.h>
--- 1,4 ----
Index: testrunner.cpp
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testrunner.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** testrunner.cpp 20 Nov 2004 15:07:00 -0000 1.5
--- testrunner.cpp 20 Nov 2004 15:26:38 -0000 1.6
***************
*** 2,6 ****
#include <cpput/message.h>
#include <cpput/testcase.h>
- #include <cpput/testcontext.h>
#include <cpput/testinfo.h>
#include <cpput/testsuite.h>
--- 2,5 ----
***************
*** 136,141 ****
const OpenTest::Properties &configuration )
{
- TestContext testContext;
-
tracker.startTestRun();
--- 135,138 ----
***************
*** 169,173 ****
{
AbstractTestCase &testCase = static_cast<AbstractTestCase &>( test );
! testContext.run( testCase );
}
}
--- 166,170 ----
{
AbstractTestCase &testCase = static_cast<AbstractTestCase &>( test );
! testCase.runTest();
}
}
Index: cpput.vcproj
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** cpput.vcproj 20 Nov 2004 15:07:00 -0000 1.23
--- cpput.vcproj 20 Nov 2004 15:26:38 -0000 1.24
***************
*** 374,383 ****
</File>
<File
- RelativePath=".\testcontext.cpp">
- </File>
- <File
- RelativePath="..\..\include\cpput\testcontext.h">
- </File>
- <File
RelativePath=".\testfailureguard.cpp">
</File>
--- 374,377 ----
--- testcontext.cpp DELETED ---
Index: testfailureguard.cpp
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testfailureguard.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** testfailureguard.cpp 20 Nov 2004 15:07:00 -0000 1.11
--- testfailureguard.cpp 20 Nov 2004 15:26:38 -0000 1.12
***************
*** 135,139 ****
bool
! TestExceptionGuardChain::protect( Functor0 test )
{
TestExceptionGuard::Context context( test );
--- 135,139 ----
bool
! TestExceptionGuardChain::protect( Functor0 test ) const
{
TestExceptionGuard::Context context( test );
Index: testcase.cpp
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** testcase.cpp 20 Nov 2004 15:07:00 -0000 1.5
--- testcase.cpp 20 Nov 2004 15:26:38 -0000 1.6
***************
*** 3,7 ****
#include <cpput/functor.h>
#include <cpput/message.h>
! #include <cpput/testcontext.h>
#include <cpput/testvisitor.h>
--- 3,7 ----
#include <cpput/functor.h>
#include <cpput/message.h>
! #include <cpput/testfailureguard.h>
#include <cpput/testvisitor.h>
***************
*** 35,38 ****
--- 35,61 ----
+ bool
+ AbstractTestCase::runTest()
+ {
+ TestExceptionGuardChain guardsChain;
+ return runTest( guardsChain );
+ }
+
+ bool
+ AbstractTestCase::runTest( const TestExceptionGuardChain &guardsChain )
+ {
+ bool initialized = guardsChain.protect( makeMemFn0( this,
+ &AbstractTestCase::setUp ) );
+
+ if ( initialized )
+ {
+ guardsChain.protect( makeMemFn0( this, &AbstractTestCase::run ) );
+ guardsChain.protect( makeMemFn0( this, &AbstractTestCase::tearDown) );
+ }
+
+ return !TestInfo::testHasFailed();
+ }
+
+
void
AbstractTestCase::setUp()
|