[Cppunit-cvs] cppunit2/src/cpput assert.cpp,1.15,1.16 exceptionguard.cpp,1.7,1.8 testinfo.cpp,1.18,1
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-11-09 20:04:14
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28417/src/cpput Modified Files: assert.cpp exceptionguard.cpp testinfo.cpp Log Message: - added CPPUT_SKIP_TEST to skip the current test - added CPPUT_IGNORE_FAILURE( assertion ) to ignore a failure caused by an assertion, but count the failed assertion Index: assert.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/assert.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** assert.cpp 8 Nov 2005 21:44:54 -0000 1.15 --- assert.cpp 9 Nov 2005 20:04:06 -0000 1.16 *************** *** 117,120 **** --- 117,130 ---- + void + skipCurrentTest() + { + TestStatus &status = TestInfo::threadInstance().getUpdatedTestStatus(); + if ( status.hasPassed() ) + status.setStatus( TestStatus::skipped ); + throw SkipTestException(); + } + + } // namespace CppUT Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** testinfo.cpp 8 Nov 2005 21:44:55 -0000 1.18 --- testinfo.cpp 9 Nov 2005 20:04:06 -0000 1.19 *************** *** 148,151 **** --- 148,163 ---- } + bool + TestStatus::hasPassed() const + { + return status_ == passed; + } + + bool + TestStatus::wasSkipped() const + { + return status_ == skipped; + } + void TestStatus::setStatistics( const std::string &name, *************** *** 190,193 **** --- 202,206 ---- , assertionCount_( 0 ) , failedAssertionCount_( 0 ) + , ignoredAssertionCount_( 0 ) , updater_( 0 ) { *************** *** 208,211 **** --- 221,225 ---- assertionCount_ = 0; failedAssertionCount_ = 0; + ignoredAssertionCount_ = 0; assertionType_ = abortingAssertion; } *************** *** 285,288 **** --- 299,309 ---- + void + TestInfo::ignoredFailure() + { + ++ignoredAssertionCount_; + } + + // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** exceptionguard.cpp 10 Aug 2005 21:34:29 -0000 1.7 --- exceptionguard.cpp 9 Nov 2005 20:04:06 -0000 1.8 *************** *** 32,38 **** { if ( deleguate_ ) ! return deleguate_->protect( context ); ! context.test_(); ! return true; } --- 32,39 ---- { if ( deleguate_ ) ! deleguate_->protect( context ); ! else ! context.test_(); ! return !(TestInfo::threadInstance().getUpdatedTestStatus().hasFailed()); } |