cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 19)
Brought to you by:
blep
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(94) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(114) |
Mar
(80) |
Apr
|
May
|
Jun
(36) |
Jul
(67) |
Aug
(37) |
Sep
(33) |
Oct
(28) |
Nov
(91) |
Dec
(16) |
2006 |
Jan
(1) |
Feb
(7) |
Mar
(45) |
Apr
|
May
|
Jun
(36) |
Jul
(7) |
Aug
|
Sep
(32) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
(29) |
Feb
(11) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(35) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(13) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(15) |
From: Baptiste L. <bl...@us...> - 2005-08-09 05:39:26
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31446/src/cpput Modified Files: SConscript assert.cpp cpput.vcproj exceptionguard.cpp lighttestrunner.cpp testcase.cpp testinfo.cpp Log Message: Rewrote failure reporting during test. It now provides more structure while still providing some flexibility. Index: lighttestrunner.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/lighttestrunner.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lighttestrunner.cpp 7 Aug 2005 08:42:15 -0000 1.3 --- lighttestrunner.cpp 8 Aug 2005 22:10:21 -0000 1.4 *************** *** 35,39 **** if ( testFailed_ > 0 ) { ! printf( "Failure report:\n", report_ ); printf( "%d/%d tests passed, %d tests failed.", testRun_ - testFailed_, --- 35,39 ---- if ( testFailed_ > 0 ) { ! printf( "Failure report:\n", report_.c_str() ); printf( "%d/%d tests passed, %d tests failed.", testRun_ - testFailed_, *************** *** 72,77 **** LightTestRunner::runTestCase( const AbstractTestCasePtr &testCase ) { - result_.clear(); printf( "Testing %s : ", getTestPath().c_str() ); TestInfo::startNewTest(); ++testRun_; --- 72,77 ---- LightTestRunner::runTestCase( const AbstractTestCasePtr &testCase ) { printf( "Testing %s : ", getTestPath().c_str() ); + assertions_.clear(); TestInfo::startNewTest(); ++testRun_; *************** *** 83,129 **** ++testFailed_; ! printf( "Result tree: %s\n", result_.toString().c_str() ); ! ! CppTL::ConstString resultType = TestInfo::faultCount() ? "fault" : "assertion"; report_ += "-> " + getTestPath() + " : " + resultType + "\n"; ! ! OpenTest::PropertiesAccessor info = result_.accessor(); ! OpenTest::Properties::ValueEnum enumFaults = info["result/faults"].listValues(); ! while ( enumFaults.hasNext() ) ! { ! OpenTest::Value fault = enumFaults.next(); ! reportFailure( fault.asProperties(), false ); ! } ! OpenTest::Properties::ValueEnum enumAssertions = info["result/assertions"].listValues(); ! while ( enumAssertions.hasNext() ) ! { ! OpenTest::Value assertion = enumAssertions.next(); ! reportFailure( assertion.asProperties(), true ); ! } report_ += "\n"; } } - void ! LightTestRunner::mergeInResult( const OpenTest::Properties &result ) { ! result_.mergeReplacingExisting( result ); } void ! LightTestRunner::mergeInResult( const OpenTest::PropertyPath &path, ! const OpenTest::Value &value ) { ! result_[path] = value; } void ! LightTestRunner::appendToResult( const OpenTest::PropertyPath &path, ! const OpenTest::Value &value ) { - result_[path].append( value ); } --- 83,114 ---- ++testFailed_; ! CppTL::ConstString resultType = assertions_.back().kind() == Assertion::fault ? "fault" ! : "assertion"; report_ += "-> " + getTestPath() + " : " + resultType + "\n"; ! Assertions::const_iterator it = assertions_.begin(); ! for ( ; it != assertions_.end(); ++it ) ! reportFailure( *it ); report_ += "\n"; } } void ! LightTestRunner::addResultLog( const OpenTest::Value &log ) { ! // discard log for the time being. Need to incorporate them ! // into a single list with assertions. } void ! LightTestRunner::addResultAssertion( const Assertion &assertion ) { ! assertions_.push_back( assertion ); } void ! LightTestRunner::setTestStatus( const TestStatus &status ) { } *************** *** 140,171 **** void ! LightTestRunner::reportFailure( const OpenTest::Properties &failure, ! bool isAssertion ) ! { ! if ( failure.has( "location") && failure.has("location/file") ) { ! report_ += failure["location/file"].asString() + "(" ! + CppTL::toString( failure["location/line"].asInt() ) ! + ") : "; } else report_ += "unknwon failure location : "; ! CppTL::ConstString failureType = failure.getValue( "failure_type", ! isAssertion ? "assertion" ! : "fault" ).asString(); report_ += "[failure type: " + failureType + "]\n"; ! OpenTest::Properties::ValueEnum enumMessages = failure.accessor()["messages"].listValues(); ! if ( enumMessages.hasNext() ) ! report_ += "Messages:\n"; ! while ( enumMessages.hasNext() ) ! report_ += enumMessages.next().asString() + "\n"; ! ! OpenTest::Properties::ValueEnum enumLogs = failure.accessor()["logs"].listValues(); ! if ( enumLogs.hasNext() ) ! report_ += "Log:\n"; ! while ( enumLogs.hasNext() ) ! report_ += enumLogs.next().asString() + "\n"; ! report_ += "Specifics:\n" + failure.toString() + "\n"; } --- 125,150 ---- void ! LightTestRunner::reportFailure( const Assertion &failure ) ! { // @todo duplicated in Assertion::toString(). ! report_ += "* "; ! if ( failure.location().isValid() ) { ! report_ += failure.location().file_; ! report_ += "(" + CppTL::toString( failure.location().line_ ) + ") : "; } else report_ += "unknwon failure location : "; ! CppTL::ConstString failureType = failure.kind() == Assertion::fault ? "fault" ! : "assertion"; report_ += "[failure type: " + failureType + "]\n"; ! if ( !failure.messages().empty() ) ! report_ += "Messages:\n" + failure.messages().toString(); ! if ( !failure.testDataType().empty() ) ! { ! const OpenTest::Properties &testData = failure.testData(); ! report_ += "Test data type: " + failure.testDataType() + "\n"; ! report_ += testData.toString() + "\n"; ! } } Index: assert.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/assert.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** assert.cpp 6 Mar 2005 18:45:38 -0000 1.10 --- assert.cpp 8 Aug 2005 22:10:21 -0000 1.11 *************** *** 12,17 **** fail( const Message &message ) { ! for ( int index =0; index < message.count(); ++index ) ! TestInfo::currentAssertion()["messages"].append( message.at(index) ); TestInfo::realizeAssertion(); } --- 12,16 ---- fail( const Message &message ) { ! TestInfo::currentAssertion().setMessages( message ); TestInfo::realizeAssertion(); } Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** cpput.vcproj 6 Aug 2005 22:24:53 -0000 1.37 --- cpput.vcproj 8 Aug 2005 22:10:21 -0000 1.38 *************** *** 491,494 **** --- 491,506 ---- <File RelativePath=".\testrunner.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/SConscript,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SConscript 6 Aug 2005 22:26:31 -0000 1.8 --- SConscript 8 Aug 2005 22:10:21 -0000 1.9 *************** *** 11,15 **** testcase.cpp testinfo.cpp - testrunner.cpp testsuite.cpp """ ), --- 11,14 ---- Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testinfo.cpp 2 Jul 2005 20:27:36 -0000 1.11 --- testinfo.cpp 8 Aug 2005 22:10:21 -0000 1.12 *************** *** 1,31 **** #include <cpput/testinfo.h> #include <cpptl/thread.h> ! namespace { ! struct CompactLocation { ! CompactLocation( const char *file = 0, ! const char *function = 0, ! unsigned int line =0 ) ! : file_( file ) ! , function_( function ) ! , line_( line ) ! { ! } ! void clear() ! { ! file_ = 0; ! function_ = 0; ! line_ = 0; ! } ! const char *file_; ! const char *function_; ! unsigned int line_; ! }; } ! namespace CppUT { // ////////////////////////////////////////////////////////////////// --- 1,157 ---- #include <cpput/testinfo.h> + #include <cpptl/stringtools.h> #include <cpptl/thread.h> ! namespace CppUT { ! ! // ////////////////////////////////////////////////////////////////// ! // ////////////////////////////////////////////////////////////////// ! // Class Assertion ! // ////////////////////////////////////////////////////////////////// ! // ////////////////////////////////////////////////////////////////// ! ! Assertion::Assertion( Kind kind, ! const SourceLocation &sourceLocation ) ! : kind_( kind ) ! , location_( sourceLocation ) ! { ! } ! ! void ! Assertion::setLocation( const SourceLocation &location ) ! { ! location_ = location; ! } ! ! const SourceLocation & ! Assertion::location() const ! { ! return location_; ! } ! ! void ! Assertion::setKind( Kind kind ) ! { ! kind_ = kind; ! } ! ! Assertion::Kind ! Assertion::kind() const ! { ! return kind_; ! } ! ! void ! Assertion::setMessages( const Message &messages ) ! { ! messages_ = messages; ! } ! ! const Message & ! Assertion::messages() const ! { ! return messages_; ! } ! ! void ! Assertion::setTestDataType( const CppTL::ConstString &type ) ! { ! testDataType_ = type; ! } ! ! const CppTL::ConstString & ! Assertion::testDataType() const ! { ! return testDataType_; ! } ! ! void ! Assertion::setTestData( const CppTL::ConstString &name, ! const OpenTest::Value &value, ! const CppTL::ConstString &type ) ! { ! testData_["name"]["type"] = type; ! testData_["name"]["value"] = value; ! } ! ! const OpenTest::Properties & ! Assertion::testData() const ! { ! return testData_; ! } ! ! CppTL::ConstString ! Assertion::toString() const ! { ! CppTL::StringBuffer buffer; ! buffer += "* "; ! if ( location().isValid() ) { ! buffer += location().file_; ! buffer += "(" + CppTL::toString( location().line_ ) + ") : "; ! } ! else ! buffer += "unknwon failure location : "; ! CppTL::ConstString failureType = kind() == fault ? "fault" ! : "assertion"; ! buffer += "[failure type: " + failureType + "]\n"; ! if ( !messages().empty() ) ! buffer += "Messages:\n" + messages().toString(); ! if ( !testDataType().empty() ) ! { ! buffer += "Test data type: " + testDataType() + "\n"; ! buffer += testData_.toString() + "\n"; ! } ! return buffer; ! } ! // ////////////////////////////////////////////////////////////////// ! // ////////////////////////////////////////////////////////////////// ! // Class TestStatus ! // ////////////////////////////////////////////////////////////////// ! // ////////////////////////////////////////////////////////////////// ! TestStatus::TestStatus( Status status ) ! : status_( status ) ! { } ! void ! TestStatus::setStatus( Status status ) ! { ! status_ = status; ! } ! ! TestStatus::Status ! TestStatus::status() const ! { ! return status_; ! } ! ! bool ! TestStatus::hasFailed() const ! { ! return status_ == failed; ! } ! ! void ! TestStatus::setStatistics( const CppTL::ConstString &name, ! const OpenTest::Value &value ) ! { ! statistics_[name] = value; ! } ! ! ! //OpenTest::Value ! //TestStatus::getStatistics( const CppTL::ConstString &name ) ! //{ ! //} ! ! void ! TestStatus::addSpecific( const CppTL::ConstString &type, ! const OpenTest::Value &value ) ! { ! specifics_[type] = value; ! } // ////////////////////////////////////////////////////////////////// *************** *** 49,71 **** void startNewTest() { ! result_.clear(); ! assertion_.clear(); assertionCount_ = 0; failedAssertionCount_ = 0; assertionType_ = abortingAssertion; - assertionLocation_.clear(); - } - - void updateTestStatistics() - { - TestInfo::mergeInResult( "statistics/assertions", assertionCount_ ); - } - - void newAssertion() - { - assertionType_ = abortingAssertion; - assertionLocation_.clear(); - assertion_.clear(); - ++assertionCount_; } --- 175,183 ---- void startNewTest() { ! testStatus_ = TestStatus( TestStatus::passed ); ! currentAssertion_ = Assertion(); assertionCount_ = 0; failedAssertionCount_ = 0; assertionType_ = abortingAssertion; } *************** *** 74,106 **** ++failedAssertionCount_; ! OpenTest::Properties assertion = assertion_; ! if ( assertionLocation_.file_ ) ! { ! assertion["location"]["file"] = assertionLocation_.file_; ! assertion["location"]["line"] = assertionLocation_.line_; ! } ! if ( assertionLocation_.function_ ) ! assertion["location"]["function"] = assertionLocation_.function_; ! TestInfo::appendToResult( "assertions", assertion ); // @todo Move appendToResult here ! if ( !assertion.has( "failure_type" ) ) ! assertion["failure_type"] = "assertion"; if ( assertionType_ == abortingAssertion ) { std::string message; if ( abortingAssertionMode_ != fastAbortingAssertion ) ! message = result_.toString().c_str(); throw AbortingAssertionException( message ); } } TestResultUpdater *updater_; ! OpenTest::Properties result_; ! OpenTest::Properties assertion_; AssertionType assertionType_; - CompactLocation assertionLocation_; AbortingAssertionMode abortingAssertionMode_; unsigned int assertionCount_; unsigned int failedAssertionCount_; - }; --- 186,215 ---- ++failedAssertionCount_; ! if ( updater_ ) ! updater_->addResultAssertion( currentAssertion_ ); ! if ( assertionType_ == abortingAssertion ) { std::string message; if ( abortingAssertionMode_ != fastAbortingAssertion ) ! message = currentAssertion_.toString().c_str(); throw AbortingAssertionException( message ); } } + TestStatus &getUpdatedTestStatus() + { + if ( !testStatus_.hasFailed() && failedAssertionCount_ > 0 ) + testStatus_.setStatus( TestStatus::failed ); + return testStatus_; + } + TestResultUpdater *updater_; ! TestStatus testStatus_; ! Assertion currentAssertion_; AssertionType assertionType_; AbortingAssertionMode abortingAssertionMode_; unsigned int assertionCount_; unsigned int failedAssertionCount_; }; *************** *** 132,145 **** } - void updateTestStatistics() - { - data().updateTestStatistics(); - } - - OpenTest::PropertiesAccessor result() - { - return data().result_.accessor(); - } - void newAssertion( AssertionType type, const char *fileName, --- 241,244 ---- *************** *** 147,153 **** const char *functionName ) { ! data().newAssertion(); data().assertionType_ = type; - data().assertionLocation_ = CompactLocation( fileName, functionName, lineNumber ); } --- 246,255 ---- const char *functionName ) { ! data().currentAssertion_ = Assertion( Assertion::assertion, ! SourceLocation( fileName, ! lineNumber, ! functionName ) ); ! ++(data().assertionCount_); data().assertionType_ = type; } *************** *** 162,182 **** } - OpenTest::Properties ¤tAssertion() - { - return data().assertion_; - } - - - OpenTest::Properties ¤tAssertionActual() - { - return currentAssertion()["actual"].asProperties(); - } - - - OpenTest::Properties ¤tAssertionExpected() - { - return currentAssertion()["expected"].asProperties(); - } - void realizeAssertion() { --- 264,267 ---- *************** *** 184,245 **** } ! unsigned int assertionCount() ! { ! return data().assertionCount_; ! } ! ! unsigned int failedAssertionCount() ! { ! return result()["assertions"].listSize(); ! } ! ! unsigned int faultCount() ! { ! return result()["faults"].listSize(); ! } ! ! bool testHasFailed() ! { ! const OpenTest::PropertiesAccessor &accessor = result(); ! return accessor["assertions"].hasList() ! || accessor["faults"].hasList(); ! } ! ! void log( const CppTL::ConstString &text ) ! { ! appendToResult( "logs", text ); ! } ! ! void appendFaultToResult( const OpenTest::Properties &fault ) ! { ! OpenTest::Properties actualFault = fault; ! if ( !actualFault.has( "failure_type" ) ) ! actualFault["failure_type"] = "fault"; ! appendToResult( "faults", actualFault ); ! } ! ! ! void mergeInResult( const OpenTest::Properties &result ) ! { ! data().result_.mergeReplacingExisting( result ); ! if ( data().updater_ ) ! data().updater_->mergeInResult( result ); ! } ! ! ! void mergeInResult( const OpenTest::PropertyPath &path, ! const OpenTest::Value &value ) { - data().result_[path] = value; if ( data().updater_ ) ! data().updater_->mergeInResult( path, value ); } ! void appendToResult( const OpenTest::PropertyPath &path, ! const OpenTest::Value &value ) { - data().result_[path].append( value ); if ( data().updater_ ) ! data().updater_->appendToResult( path, value ); } --- 269,283 ---- } ! void log( const OpenTest::Value &log ) { if ( data().updater_ ) ! data().updater_->addResultLog( log ); } ! void handleUnexpectedException( const Assertion &fault ) { if ( data().updater_ ) ! data().updater_->addResultAssertion( fault ); ! data().testStatus_.setStatus( TestStatus::failed ); } *************** *** 262,265 **** --- 300,318 ---- + Assertion & + currentAssertion() + { + return data().currentAssertion_; + } + + TestStatus & + getUpdatedTestStatus() + { + return data().getUpdatedTestStatus(); + } + + + + // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** testcase.cpp 27 Feb 2005 14:38:27 -0000 1.10 --- testcase.cpp 8 Aug 2005 22:10:21 -0000 1.11 *************** *** 54,58 **** } ! return !TestInfo::testHasFailed(); } --- 54,58 ---- } ! return !TestInfo::getUpdatedTestStatus().hasFailed(); } Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** exceptionguard.cpp 28 Feb 2005 22:14:03 -0000 1.5 --- exceptionguard.cpp 8 Aug 2005 22:10:21 -0000 1.6 *************** *** 69,76 **** catch ( ... ) { ! OpenTest::Properties fault; ! fault["type"] = "unexpected exception"; ! fault["message"].append( "caught unexpected exception of unknown type." ); ! TestInfo::appendFaultToResult( fault ); } --- 69,77 ---- catch ( ... ) { ! Assertion fault( Assertion::fault ); ! Message messages( "test threw an unexpected exception" ); ! messages.add( "caught unexpected exception of unknown type (not a subclass of std::exception)." ); ! fault.setMessages( messages ); ! TestInfo::handleUnexpectedException( fault ); } *************** *** 82,91 **** const char *what ) { ! OpenTest::Properties fault; ! fault["type"] = "unexpected exception"; ! fault["exception_type"] = exceptionType; ! fault["message"].append( "caught unexpected exception." ); ! fault["message"].append( what ); ! TestInfo::appendFaultToResult( fault ); } }; --- 83,95 ---- const char *what ) { ! Assertion fault( Assertion::fault ); ! Message messages( "test threw an unexpected exception" ); ! messages.add( "caught unexpected exception of type: " + exceptionType ); ! messages.add( what ); ! fault.setMessages( messages ); ! fault.setTestDataType( "unexpected-exception-fault" ); ! fault.setTestData( "expection-type", exceptionType ); ! fault.setTestData( "expection-message", what ); ! TestInfo::handleUnexpectedException( fault ); } }; |
From: Baptiste L. <bl...@us...> - 2005-08-09 05:39:25
|
Update of /cvsroot/cppunit/cppunit2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31446/src Modified Files: cpput_lib.suo Log Message: Rewrote failure reporting during test. It now provides more structure while still providing some flexibility. Index: cpput_lib.suo =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput_lib.suo,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 Binary files /tmp/cvs2Mx14Q and /tmp/cvsL4oiDm differ |
From: Baptiste L. <bl...@us...> - 2005-08-09 05:39:25
|
Update of /cvsroot/cppunit/cppunit2/examples/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30949/examples/common Added Files: examplecommon.h Log Message: * Centralized test running logic in examples/common/examplecommon.h --- NEW FILE: examplecommon.h --- #ifndef CPPUT_EXAMPLES_EXAMPLECOMMON_H_INCLUDED # define CPPUT_EXAMPLES_EXAMPLECOMMON_H_INCLUDED #include <cpput/testsuite.h> #include <cpput/lighttestrunner.h> //#include <cpput/testrunner.h> // cppunit2 testrunner for opentest #include <cpput/assert.h> inline int runExampleTests( int argc, const char *argv[], CppUT::Test *test ) { // CppUT::TestRunner runner; // runner.setRootSuite( allSuite.get() ); // OpenTest::TextTestDriver driver( runner ); // bool sucessful = driver.run(); CppUT::LightTestRunner runner; runner.addTest( test ); bool sucessful = runner.runAllTests(); return sucessful ? 0 : 1; } #endif // CPPUT_EXAMPLES_EXAMPLECOMMON_H_INCLUDED |
From: Baptiste L. <bl...@us...> - 2005-08-09 01:33:06
|
Update of /cvsroot/cppunit/cppunit2/src/opentesttest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32594/src/opentesttest Modified Files: packetstest.cpp Log Message: * Fixed msvc6 compilation issue Index: packetstest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentesttest/packetstest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** packetstest.cpp 20 Jul 2005 21:06:51 -0000 1.2 --- packetstest.cpp 8 Aug 2005 22:12:37 -0000 1.3 *************** *** 24,28 **** const char *begin = static_cast<const char *>( data_ ); return "length = " + CppTL::toString( length_ ) + "\ndata = " ! + quoteString( CppTL::ConstString( begin, begin + length_ ) ); } --- 24,28 ---- const char *begin = static_cast<const char *>( data_ ); return "length = " + CppTL::toString( length_ ) + "\ndata = " ! + CppTL::quoteString( CppTL::ConstString( begin, begin + length_ ) ); } |
From: Baptiste L. <bl...@us...> - 2005-08-09 00:34:19
|
Update of /cvsroot/cppunit/cppunit2/examples/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29754/examples/common Log Message: Directory /cvsroot/cppunit/cppunit2/examples/common added to the repository |
From: Baptiste L. <bl...@us...> - 2005-08-08 22:42:07
|
Update of /cvsroot/cppunit/cppunit2/examples/parametrized_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30949/examples/parametrized_test Modified Files: main.cpp Log Message: * Centralized test running logic in examples/common/examplecommon.h Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/examples/parametrized_test/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 28 Feb 2005 20:31:30 -0000 1.1 --- main.cpp 8 Aug 2005 22:07:58 -0000 1.2 *************** *** 1,8 **** #include <cpput/testcase.h> - #include <cpput/testsuite.h> - #include <cpput/testrunner.h> // cppunit2 testrunner for opentest #include <cpput/assert.h> - #include <opentest/texttestdriver.h> - #include <opentest/properties.h> --- 1,5 ---- + #include <examples/common/examplecommon.h> #include <cpput/testcase.h> #include <cpput/assert.h> *************** *** 23,33 **** "multiply 7*5 (failing demo)" ) ); ! CppUT::TestRunner runner; ! CppUT::AbstractTestSuitePtr rootSuite = ! CppTL::staticPointerCast<CppUT::AbstractTestSuite>( allSuite ); ! runner.setRootSuite( rootSuite ); ! ! OpenTest::TextTestDriver driver( runner ); ! bool sucessful = driver.run(); ! return sucessful ? 0 : 1; } --- 20,23 ---- "multiply 7*5 (failing demo)" ) ); ! return runExampleTests( argc, argv, allSuite.get() ); } |
From: Baptiste L. <bl...@us...> - 2005-08-08 22:14:26
|
Update of /cvsroot/cppunit/cppunit2/examples/input_based_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30949/examples/input_based_test Modified Files: input_based_test.vcproj main.cpp Log Message: * Centralized test running logic in examples/common/examplecommon.h Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/examples/input_based_test/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 28 Feb 2005 22:31:36 -0000 1.2 --- main.cpp 8 Aug 2005 22:07:58 -0000 1.3 *************** *** 1,8 **** #include <cpput/testcase.h> - #include <cpput/testsuite.h> - #include <cpput/testrunner.h> // cppunit2 testrunner for opentest #include <cpput/testinfo.h> #include <cpput/assert.h> - #include <opentest/texttestdriver.h> #include <opentest/properties.h> --- 1,6 ---- + #include <examples/common/examplecommon.h> #include <cpput/testcase.h> #include <cpput/testinfo.h> #include <cpput/assert.h> #include <opentest/properties.h> *************** *** 35,45 **** allSuite->add( test1 ); ! CppUT::TestRunner runner; ! CppUT::AbstractTestSuitePtr rootSuite = ! CppTL::staticPointerCast<CppUT::AbstractTestSuite>( allSuite ); ! runner.setRootSuite( rootSuite ); ! ! OpenTest::TextTestDriver driver( runner ); ! bool sucessful = driver.run(); ! return sucessful ? 0 : 1; } --- 33,36 ---- allSuite->add( test1 ); ! return runExampleTests( argc, argv, allSuite.get() ); } Index: input_based_test.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/examples/input_based_test/input_based_test.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** input_based_test.vcproj 28 Feb 2005 20:48:56 -0000 1.1 --- input_based_test.vcproj 8 Aug 2005 22:07:58 -0000 1.2 *************** *** 21,25 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" --- 21,25 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\include;../.." PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" *************** *** 117,121 **** <Files> <File ! RelativePath=".\main.cpp"> </File> </Files> --- 117,124 ---- <Files> <File ! RelativePath="..\common\examplecommon.h"> ! </File> ! <File ! RelativePath="..\checking_assertions\main.cpp"> </File> </Files> |
From: Baptiste L. <bl...@us...> - 2005-08-07 08:42:23
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19482/src/cpputtest Modified Files: main.cpp Log Message: - Added test run summary at the end of test run - cpputtest now use LightTestRunner instead of OpenTest. Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** main.cpp 7 Mar 2005 21:34:45 -0000 1.21 --- main.cpp 7 Aug 2005 08:42:15 -0000 1.22 *************** *** 9,14 **** #include "reflectiontest.h" ! #include <cpput/testrunner.h> // cppunit2 testrunner for opentest ! #include <opentest/texttestdriver.h> --- 9,15 ---- #include "reflectiontest.h" ! #include <cpput/lighttestrunner.h> ! //#include <cpput/testrunner.h> // cppunit2 testrunner for opentest ! //#include <opentest/texttestdriver.h> *************** *** 107,110 **** --- 108,112 ---- // allSuite->add( CommandLineOptionsTest::suite() ); + /* // using opentest CppUT::TestRunner runner; CppUT::AbstractTestSuitePtr rootSuite = *************** *** 114,117 **** --- 116,124 ---- OpenTest::TextTestDriver driver( runner ); bool sucessful = driver.run(); + */ + + CppUT::LightTestRunner runner; + runner.addTest( allSuite.get() ); + bool sucessful = runner.runAllTests(); return sucessful ? 0 : 1; } |
From: Baptiste L. <bl...@us...> - 2005-08-07 08:42:23
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19482/src/cpput Modified Files: lighttestrunner.cpp Log Message: - Added test run summary at the end of test run - cpputtest now use LightTestRunner instead of OpenTest. Index: lighttestrunner.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/lighttestrunner.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lighttestrunner.cpp 4 Jul 2005 08:11:26 -0000 1.2 --- lighttestrunner.cpp 7 Aug 2005 08:42:15 -0000 1.3 *************** *** 33,37 **** for ( Tests::iterator it = tests_.begin(); it != tests_.end(); ++it ) runTest( *it ); ! printf( "Failure report:\n", report_ ); return testFailed_ == 0; } --- 33,48 ---- for ( Tests::iterator it = tests_.begin(); it != tests_.end(); ++it ) runTest( *it ); ! if ( testFailed_ > 0 ) ! { ! printf( "Failure report:\n", report_ ); ! printf( "%d/%d tests passed, %d tests failed.", ! testRun_ - testFailed_, ! testRun_, ! testFailed_ ); ! } ! else ! { ! printf( "All %d tests passed.", testRun_ ); ! } return testFailed_ == 0; } |
From: Baptiste L. <bl...@us...> - 2005-08-07 08:42:23
|
Update of /cvsroot/cppunit/cppunit2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19482/src Modified Files: cpput_lib.suo Log Message: - Added test run summary at the end of test run - cpputtest now use LightTestRunner instead of OpenTest. Index: cpput_lib.suo =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput_lib.suo,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 Binary files /tmp/cvsuv4pu5 and /tmp/cvskv3rdY differ |
From: Baptiste L. <bl...@us...> - 2005-08-06 22:26:40
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10790/src/cpput Modified Files: SConscript Log Message: Added extendeddata.cpp Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/SConscript,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SConscript 4 Jul 2005 08:11:25 -0000 1.7 --- SConscript 6 Aug 2005 22:26:31 -0000 1.8 *************** *** 5,8 **** --- 5,9 ---- assertstring.cpp exceptionguard.cpp + extendeddata.cpp lighttestrunner.cpp properties.cpp |
From: Baptiste L. <bl...@us...> - 2005-08-06 22:25:04
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323/src/cpput Modified Files: cpput.vcproj Added Files: extendeddata.cpp Log Message: Added possibility to add test to a fixture and set its description and time-out (and other specifics). Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** cpput.vcproj 20 Jul 2005 21:06:51 -0000 1.36 --- cpput.vcproj 6 Aug 2005 22:24:53 -0000 1.37 *************** *** 133,140 **** Filter=""> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File ! RelativePath=".\SConscript"> </File> <File --- 133,140 ---- Filter=""> <File ! RelativePath=".\SConscript"> </File> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File *************** *** 442,445 **** --- 442,451 ---- </File> <File + RelativePath=".\extendeddata.cpp"> + </File> + <File + RelativePath="..\..\include\cpput\extendeddata.h"> + </File> + <File RelativePath="..\..\include\cpput\forwards.h"> </File> --- NEW FILE: extendeddata.cpp --- #include <cpput/extendeddata.h> #include <cpput/test.h> namespace CppUT { TestExtendedDataHelper::TestExtendedDataHelper( Test &test ) : test_( test ) { } TestExtendedDataHelper::~TestExtendedDataHelper() { } Test & TestExtendedDataHelper::operator()( const TestExtendedData &data ) const { data.apply( test_ ); return test_; } TestExtendedData::~TestExtendedData() { } TestExtendedDataList TestExtendedData::operator ,( const TestExtendedData &other ) const { return TestExtendedDataList( *this, other ); } TestExtendedDataList::TestExtendedDataList( const TestExtendedData &left, const TestExtendedData &right ) : left_( left ) , right_( right ) { } void TestExtendedDataList::apply( Test &test ) const { left_.apply( test ); right_.apply( test ); } DescriptionData::DescriptionData( const std::string &description ) : description_( description ) { } void DescriptionData::apply( Test &test ) const { test.setDescription( description_.c_str() ); } TimeOutData::TimeOutData( double timeOutInSeconds ) : timeOutInSeconds_( timeOutInSeconds ) { } void TimeOutData::apply( Test &test ) const { test.setTimeOut( timeOutInSeconds_ ); } DependenciesData::DependenciesData( const std::string &dependencies ) : dependencies_( dependencies ) { } void DependenciesData::apply( Test &test ) const { // test.setDependenciesFromPackedString( dependencies ); } TestExtendedDataFactory::~TestExtendedDataFactory() { } DescriptionData TestExtendedDataFactory::describe( const std::string &description ) { return DescriptionData( description ); } TimeOutData TestExtendedDataFactory::timeOut( double timeOutInSeconds ) { return TimeOutData( timeOutInSeconds ); } DependenciesData TestExtendedDataFactory::depends( const std::string &dependencies ) { return DependenciesData( dependencies ); } } // namespace CppUT |
From: Baptiste L. <bl...@us...> - 2005-08-06 22:25:04
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323/src/cpputtest Modified Files: minitestrunner.h testfixturetest.cpp testfixturetest.h Log Message: Added possibility to add test to a fixture and set its description and time-out (and other specifics). Index: testfixturetest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testfixturetest.h 27 Feb 2005 16:12:08 -0000 1.5 --- testfixturetest.h 6 Aug 2005 22:24:54 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- void testDefaultIsNoSharedFixture(); void testSharedFixture(); + void testFixtureWithSpecifics(); private: Index: testfixturetest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testfixturetest.cpp 27 Feb 2005 16:12:08 -0000 1.5 --- testfixturetest.cpp 6 Aug 2005 22:24:54 -0000 1.6 *************** *** 114,117 **** --- 114,132 ---- }; + class TestFixtureWithSpecific : public CppUT::TestFixture + { + CPPUT_TESTSUITE_BEGIN( TestFixtureWithSpecific ); + CPPUT_TEST_WITH_SPECIFICS( testFail, + ( describe( "Forced test failure" ), + timeOut( 30.0 ) + ) ); + CPPUT_TESTSUITE_END(); + public: + void testFail() + { + CPPUT_ASSERT( false, "forced failure" ); + } + }; + } // anonymous namespace *************** *** 136,139 **** --- 151,156 ---- addTest( fixture, &TestFixtureTest::testSharedFixture, "testSharedFixture", suite ); + addTest( fixture, &TestFixtureTest::testFixtureWithSpecifics, + "testFixtureWithSpecifics", suite ); return suite; *************** *** 219,220 **** --- 236,253 ---- CPPUT_ASSERT_EQUAL( 1, int(SharedFixtureTestBase::instances_.size() ) ); } + + + void + TestFixtureTest::testFixtureWithSpecifics() + { + CppUT::TestPtr suite = TestFixtureWithSpecific::suite(); + CPPUT_ASSERT_EQUAL( 1, dynamic_cast<CppUT::TestSuite &>( *suite ).testCount() ); + CppUT::TestPtr test = dynamic_cast<CppUT::TestSuite &>( *suite ).testAt(0); + CPPUT_ASSERT_EQUAL( "Forced test failure", test->description() ); + CPPUT_ASSERT_EQUAL( 30.0, test->timeOut() ); + + MiniTestRunner runner; + runner.run( suite ); + CPPUT_ASSERT_EQUAL( 1, runner.tested_ ); + CPPUT_ASSERT_EQUAL( 1, runner.failed_ ); + } Index: minitestrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/minitestrunner.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** minitestrunner.h 27 Feb 2005 16:12:07 -0000 1.2 --- minitestrunner.h 6 Aug 2005 22:24:53 -0000 1.3 *************** *** 70,72 **** --- 70,74 ---- }; + // 0x00688ec0 "`anonymous namespace'::TestFixtureWithSpecific" + #endif // CPPUTTEST_MINITESTRUNNER_H_INCLUDED |
From: Baptiste L. <bl...@us...> - 2005-08-06 22:25:01
|
Update of /cvsroot/cppunit/cppunit2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323/src Modified Files: cpput_lib.suo Log Message: Added possibility to add test to a fixture and set its description and time-out (and other specifics). Index: cpput_lib.suo =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput_lib.suo,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsTrNjq2 and /tmp/cvslnGMsZ differ |
From: Baptiste L. <bl...@us...> - 2005-08-06 22:25:01
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323/include/cpput Modified Files: forwards.h test.h testfixture.h Added Files: extendeddata.h Log Message: Added possibility to add test to a fixture and set its description and time-out (and other specifics). Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test.h 20 Jul 2005 21:06:49 -0000 1.6 --- test.h 6 Aug 2005 22:24:53 -0000 1.7 *************** *** 23,26 **** --- 23,36 ---- } + void setDescription( const CppTL::ConstString &description ) + { + info_["configuration/description"] = description; + } + + CppTL::ConstString description() const + { + return info().getValue("configuration/description", "" ).asString(); + } + CppTL::ConstString name() const { *************** *** 28,31 **** --- 38,51 ---- } + void setTimeOut( double timeOutInSeconds ) + { + info_["configuration/timeOut"] = timeOutInSeconds; + } + + double timeOut() const + { + return info().getValue( "configuration/timeOut", 0.0 ).asReal(); + } + /// @warning You must never change the name of the test after /// registering the test or scheduling it for running. --- NEW FILE: extendeddata.h --- #ifndef CPPUT_EXTENDEDDATA_H_INCLUDED # define CPPUT_EXTENDEDDATA_H_INCLUDED # include <cpput/forwards.h> # include <string> namespace CppUT { /** \brief Helper to set test extended data (description, time-out, dependencies...) * * Example of usage: * \code * class SomeClass : public TestExtendedDataFactory { * public: * static void enrichTest( Test &test ) { * CppUT::TestExtendedDataHelper( test )( describe( "Test conversion" ), * timeOut( 30.0 ), * depends( "testInit" ) ); * } * }; * \endcode * * The above code sample is equivalent to: * * \code * static void enrichTest( Test &test ) { * test.setDescription( "Test conversion" ); * test.setTimeOut( 30.0 ); * test.setDependenciesFromPackedString( "testInit" ); * } * \end * * The only purpose of this class is to make it easy to set test properties without * direct access to the test object. It is used to implement the macro * \link CPPUT_TEST_WITH_SPECIFICS(). */ class TestExtendedDataHelper { public: TestExtendedDataHelper( Test &test ); virtual ~TestExtendedDataHelper(); Test &operator()( const TestExtendedData &data ) const; private: Test &test_; }; class CPPUT_API TestExtendedData { public: virtual ~TestExtendedData(); virtual void apply( Test &test ) const = 0; TestExtendedDataList operator ,( const TestExtendedData &other ) const; }; class TestExtendedDataList : public TestExtendedData { public: TestExtendedDataList( const TestExtendedData &left, const TestExtendedData &right ); public: // overridden from TestExtendedData void apply( Test &test ) const; private: const TestExtendedData &left_; const TestExtendedData &right_; }; class CPPUT_API DescriptionData : public TestExtendedData { public: DescriptionData( const std::string &description ); public: // overridden from TestExtendedData void apply( Test &test ) const; private: std::string description_; }; class CPPUT_API TimeOutData : public TestExtendedData { public: TimeOutData( double timeOutInSeconds ); public: // overridden from TestExtendedData void apply( Test &test ) const; private: double timeOutInSeconds_; }; class CPPUT_API DependenciesData : public TestExtendedData { public: DependenciesData( const std::string &dependencies ); public: // overridden from TestExtendedData void apply( Test &test ) const; private: std::string dependencies_; }; class CPPUT_API TestExtendedDataFactory { public: virtual ~TestExtendedDataFactory(); static DescriptionData describe( const std::string &description ); static TimeOutData timeOut( double timeOutInSeconds ); static DependenciesData depends( const std::string &dependencies ); }; } // namespace CppUT #endif // CPPUT_EXTENDEDDATA_H_INCLUDED Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testfixture.h 20 Jul 2005 21:06:49 -0000 1.9 --- testfixture.h 6 Aug 2005 22:24:53 -0000 1.10 *************** *** 3,6 **** --- 3,7 ---- # include <cpput/forwards.h> + # include <cpput/extendeddata.h> # include <cpput/testcase.h> # include <cpput/testsuite.h> *************** *** 11,15 **** --- 12,18 ---- namespace CppUT { + class CPPUT_API TestFixture : public CppTL::IntrusiveCount + , public TestExtendedDataFactory { public: *************** *** 25,28 **** --- 28,40 ---- { } + + static void addTestWithSpecifics( TestSuite &suite, + const TestPtr &test, + const TestExtendedData &specifics ) + { + ::CppUT::TestExtendedDataHelper specificHelper( *test ); + specificHelper( specifics ); + suite.add( test ); + } }; *************** *** 208,211 **** --- 220,233 ---- #testMethod ) ) + # define CPPUT_TEST_WITH_SPECIFICS( testMethod, specifics ) \ + fixture = fixtureFactory(); \ + addTestWithSpecifics( *suite, \ + ::CppUT::makeFixtureTestCase( fixture, \ + ::CppTL::memfn0( fixture, \ + &CppUT_ThisType::testMethod ), \ + #testMethod ), \ + specifics ) + + /* // still need to find a way to have setUp()/tearDown() called only once Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** forwards.h 20 Jul 2005 21:06:49 -0000 1.16 --- forwards.h 6 Aug 2005 22:24:53 -0000 1.17 *************** *** 14,17 **** --- 14,19 ---- class Test; class TestCase; + class TestExtendedData; + class TestExtendedDataList; class ExceptionGuardElement; class ExceptionGuard; |
From: Baptiste L. <bl...@us...> - 2005-08-02 17:47:08
|
Update of /cvsroot/cppunit/cppunit/include/cppunit/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30622/include/cppunit/plugin Modified Files: PlugInManager.h Log Message: * fixed documentation typo. Index: PlugInManager.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/plugin/PlugInManager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PlugInManager.h 29 Aug 2002 19:27:07 -0000 1.6 --- PlugInManager.h 2 Aug 2005 17:46:58 -0000 1.7 *************** *** 42,46 **** * \return Pointer on the DynamicLibraryManager associated to the library. * Valid until the library is unloaded. Never \c NULL. ! * \exception DynamicLibraryManager is thrown if an error occurs during loading. */ void load( const std::string &libraryFileName, --- 42,46 ---- * \return Pointer on the DynamicLibraryManager associated to the library. * Valid until the library is unloaded. Never \c NULL. ! * \exception DynamicLibraryManagerException is thrown if an error occurs during loading. */ void load( const std::string &libraryFileName, |
From: Baptiste L. <bl...@us...> - 2005-07-30 07:04:15
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30193 Modified Files: ChangeLog Log Message: * include/cppunit/config/config-msvc6.h: added missing macro definition CPPUNIT_HAVE_CPP_CAST. Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** ChangeLog 30 Jul 2005 06:55:21 -0000 1.237 --- ChangeLog 30 Jul 2005 07:04:07 -0000 1.238 *************** *** 3,6 **** --- 3,9 ---- * include/cppunit/config/config-msvc6.h: auto-detect if RTTI are enabled the _CPPRTTI macro (defined by the compiler when enabling RTTI). + + * include/cppunit/config/config-msvc6.h: added missing macro definition + CPPUNIT_HAVE_CPP_CAST. * src/cppunit/TestResultCollector.cpp: fixed memory leak in destructor. |
From: Baptiste L. <bl...@us...> - 2005-07-30 07:03:10
|
Update of /cvsroot/cppunit/cppunit/include/cppunit/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30020/include/cppunit/config Modified Files: config-msvc6.h Log Message: * include/cppunit/config/config-msvc6.h: added missing macro definition CPPUNIT_HAVE_CPP_CAST. Index: config-msvc6.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/config/config-msvc6.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config-msvc6.h 30 Jul 2005 06:54:13 -0000 1.9 --- config-msvc6.h 30 Jul 2005 07:02:38 -0000 1.10 *************** *** 62,65 **** --- 62,69 ---- #endif + // Define to 1 if the compiler support C++ style cast. + #define CPPUNIT_HAVE_CPP_CAST 1 + + // Uncomment to turn on STL wrapping => use this to test compilation. // This will make CppUnit subclass std::vector & co to provide default |
From: Baptiste L. <bl...@us...> - 2005-07-30 06:57:13
|
Update of /cvsroot/cppunit/cppunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28596/doc Modified Files: other_documentation.dox Log Message: * fixed typo. Index: other_documentation.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit/doc/other_documentation.dox,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** other_documentation.dox 23 Sep 2002 05:43:50 -0000 1.16 --- other_documentation.dox 30 Jul 2005 06:57:03 -0000 1.17 *************** *** 87,91 **** * * The interface CppUnitTestPlugIn is automatically implemented by the previous ! * macro. You can define your one implementation. * * To provide your custom implementation of the plug-in interface, you must: --- 87,91 ---- * * The interface CppUnitTestPlugIn is automatically implemented by the previous ! * macro. You can define your own implementation. * * To provide your custom implementation of the plug-in interface, you must: |
From: Baptiste L. <bl...@us...> - 2005-07-30 06:55:38
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28348 Modified Files: THANKS ChangeLog Log Message: * include/cppunit/config/config-msvc6.h: auto-detect if RTTI are enabled the _CPPRTTI macro (defined by the compiler when enabling RTTI). * src/cppunit/TestResultCollector.cpp: fixed memory leak in destructor. Index: THANKS =================================================================== RCS file: /cvsroot/cppunit/cppunit/THANKS,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** THANKS 10 Sep 2004 07:54:42 -0000 1.19 --- THANKS 30 Jul 2005 06:55:21 -0000 1.20 *************** *** 20,22 **** Stephan Stapel <ste...@we...> Abdessattar Sassi <abd...@us...> (hp-ux plug-in support) ! Max Quatember and Andreas Pfaffenbichler (VC++ 7 MFC TestRunner go to source line) \ No newline at end of file --- 20,23 ---- Stephan Stapel <ste...@we...> Abdessattar Sassi <abd...@us...> (hp-ux plug-in support) ! Max Quatember and Andreas Pfaffenbichler (VC++ 7 MFC TestRunner go to source line) ! Vincent Rivière Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** ChangeLog 15 Jul 2005 19:04:54 -0000 1.236 --- ChangeLog 30 Jul 2005 06:55:21 -0000 1.237 *************** *** 1,2 **** --- 1,9 ---- + 2005-07-30 Baptiste Lepilleur <gai...@fr...> + + * include/cppunit/config/config-msvc6.h: auto-detect if RTTI are enabled + the _CPPRTTI macro (defined by the compiler when enabling RTTI). + + * src/cppunit/TestResultCollector.cpp: fixed memory leak in destructor. + 2005-07-15 Baptiste Lepilleur <gai...@fr...> |
From: Baptiste L. <bl...@us...> - 2005-07-30 06:54:22
|
Update of /cvsroot/cppunit/cppunit/include/cppunit/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28157/include/cppunit/config Modified Files: config-msvc6.h Log Message: * include/cppunit/config/config-msvc6.h: auto-detect if RTTI are enabled the _CPPRTTI macro (defined by the compiler when enabling RTTI). Index: config-msvc6.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/config/config-msvc6.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** config-msvc6.h 15 May 2003 06:31:52 -0000 1.8 --- config-msvc6.h 30 Jul 2005 06:54:13 -0000 1.9 *************** *** 32,37 **** /* define if the compiler supports Run-Time Type Identification */ ! #ifndef CPPUNIT_HAVE_RTTI ! #define CPPUNIT_HAVE_RTTI 1 #endif --- 32,41 ---- /* define if the compiler supports Run-Time Type Identification */ ! #ifndef CPPUNIT_HAVE_RTTI ! # ifdef _CPPRTTI // Defined by the compiler option /GR ! # define CPPUNIT_HAVE_RTTI 1 ! # else ! # define CPPUNIT_HAVE_RTTI 0 ! # endif #endif |
From: Baptiste L. <bl...@us...> - 2005-07-30 06:50:21
|
Update of /cvsroot/cppunit/cppunit/src/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27543 Modified Files: TestResultCollector.cpp Log Message: * src/cppunit/TestResultCollector.cpp: fixed memory leak in destructor. Index: TestResultCollector.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/cppunit/TestResultCollector.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestResultCollector.cpp 5 Jul 2005 21:17:40 -0000 1.4 --- TestResultCollector.cpp 30 Jul 2005 06:50:11 -0000 1.5 *************** *** 15,18 **** --- 15,19 ---- TestResultCollector::~TestResultCollector() { + freeFailures(); } *************** *** 24,27 **** --- 25,29 ---- while ( itFailure != m_failures.end() ) delete *itFailure++; + m_failures.clear(); } *************** *** 36,40 **** m_testErrors = 0; m_tests.clear(); - m_failures.clear(); } --- 38,41 ---- |
From: Baptiste L. <bl...@us...> - 2005-07-20 21:07:31
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8806/include/cpput Modified Files: forwards.h lighttestrunner.h test.h testcase.h testfixture.h testrunner.h testsuite.h Log Message: * Added IntrusivePtr, a reference counted smart-pointer * Changed Test hierarchy and TestFixture to use IntrusivePtr instead of SharedPtr (this allows simple upcasting). Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testcase.h 27 Feb 2005 14:38:26 -0000 1.9 --- testcase.h 20 Jul 2005 21:06:49 -0000 1.10 *************** *** 5,9 **** # include <cpptl/functor.h> # include <cpput/test.h> - # include <cpptl/sharedptr.h> # include <string> --- 5,8 ---- *************** *** 75,80 **** const Message &message ); template<typename FixtureType> ! TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, const CppTL::Functor0 &run, const CppTL::ConstString &name ) --- 74,80 ---- const Message &message ); + /// @todo Use traits to get smart-pointer type and allow for any type of smart-pointer template<typename FixtureType> ! TestPtr makeFixtureTestCase( const CppTL::IntrusivePtr<FixtureType> &fixture, const CppTL::Functor0 &run, const CppTL::ConstString &name ) Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testsuite.h 27 Feb 2005 10:15:41 -0000 1.4 --- testsuite.h 20 Jul 2005 21:06:49 -0000 1.5 *************** *** 35,40 **** void add( const TestPtr &test ); - // notes: should we defines this only if smart-pointer does not - // have templated constructor ? void add( const TestSuitePtr &test ); --- 35,38 ---- Index: testrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testrunner.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testrunner.h 4 Jul 2005 08:11:25 -0000 1.5 --- testrunner.h 20 Jul 2005 21:06:49 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <opentest/testrunner.h> + # include <cpptl/intrusiveptr.h> # include <map> Index: lighttestrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/lighttestrunner.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lighttestrunner.h 2 Jul 2005 20:27:35 -0000 1.1 --- lighttestrunner.h 20 Jul 2005 21:06:49 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <cpput/testinfo.h> + # include <cpptl/intrusiveptr.h> # include <deque> Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.h 27 Feb 2005 10:15:41 -0000 1.5 --- test.h 20 Jul 2005 21:06:49 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- # include <cpput/forwards.h> # include <opentest/properties.h> + # include <cpptl/intrusiveptr.h> # include <string> *************** *** 11,15 **** class TestVisitor; ! class CPPUT_API Test { // ensure that this class can only be derived by AbstractTestCase and --- 12,16 ---- class TestVisitor; ! class CPPUT_API Test : public CppTL::IntrusiveCount { // ensure that this class can only be derived by AbstractTestCase and Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testfixture.h 28 Feb 2005 21:36:19 -0000 1.8 --- testfixture.h 20 Jul 2005 21:06:49 -0000 1.9 *************** *** 11,15 **** namespace CppUT { ! class CPPUT_API TestFixture { public: --- 11,15 ---- namespace CppUT { ! class CPPUT_API TestFixture : public CppTL::IntrusiveCount { public: *************** *** 31,35 **** namespace Impl { ! typedef CppTL::SharedPtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory --- 31,35 ---- namespace Impl { ! typedef CppTL::IntrusivePtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory *************** *** 100,104 **** } ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr<FixtureType> operator()() { return ::CppTL::staticPointerCast<FixtureType>( factory_() ); --- 100,104 ---- } ! CPPUT_DEDUCED_TYPENAME CppTL::IntrusivePtr<FixtureType> operator()() { return ::CppTL::staticPointerCast<FixtureType>( factory_() ); *************** *** 127,131 **** { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::CppTL::SharedPtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) --- 127,131 ---- { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::CppTL::IntrusivePtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) *************** *** 179,183 **** ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppTL::SharedPtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ --- 179,183 ---- ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppTL::IntrusivePtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** forwards.h 27 Feb 2005 15:47:37 -0000 1.15 --- forwards.h 20 Jul 2005 21:06:49 -0000 1.16 *************** *** 21,30 **** class TestVisitor; ! typedef CppTL::SharedPtr<AbstractTestCase> AbstractTestCasePtr; ! typedef CppTL::SharedPtr<AbstractTestSuite> AbstractTestSuitePtr; typedef CppTL::SharedPtr<ExceptionGuardElement> ExceptionGuardElementPtr; ! typedef CppTL::SharedPtr<Test> TestPtr; typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; ! typedef CppTL::SharedPtr<TestSuite> TestSuitePtr; typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; --- 21,30 ---- class TestVisitor; ! typedef CppTL::IntrusivePtr<AbstractTestCase> AbstractTestCasePtr; ! typedef CppTL::IntrusivePtr<AbstractTestSuite> AbstractTestSuitePtr; typedef CppTL::SharedPtr<ExceptionGuardElement> ExceptionGuardElementPtr; ! typedef CppTL::IntrusivePtr<Test> TestPtr; typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; ! typedef CppTL::IntrusivePtr<TestSuite> TestSuitePtr; typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; |
From: Baptiste L. <bl...@us...> - 2005-07-20 21:07:31
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8806/include/cpptl Modified Files: forwards.h Added Files: intrusiveptr.h Log Message: * Added IntrusivePtr, a reference counted smart-pointer * Changed Test hierarchy and TestFixture to use IntrusivePtr instead of SharedPtr (this allows simple upcasting). Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/forwards.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** forwards.h 4 Jul 2005 08:09:30 -0000 1.5 --- forwards.h 20 Jul 2005 21:06:49 -0000 1.6 *************** *** 24,27 **** --- 24,32 ---- class Functor0R; + // intrusiveptr.h + class IntrusiveCount; + template<class PointeeType> + class IntrusivePtr; + // reflection.h class Attribut; --- NEW FILE: intrusiveptr.h --- #ifndef CPPTL_INTRUSIVEPTR_H_INCLUDED # define CPPTL_INTRUSIVEPTR_H_INCLUDED # include <cpptl/forwards.h> # include <cpptl/atomiccounter.h> // We use inheritance instead of the typedef in a struct to // simulate the template typedef because the typedef in a struct // trick does not support type deduction in template functions. // If CPPTL_USE_BOOST_INTRUSIVE_PTR is defined, then we use boost::intrusive_ptr // as our smart_pointer, otherwise we use a simple implementation // of our own. namespace CppTL { /// Instrusive counter base class for use with InstrusivePtr. class IntrusiveCount { public: virtual ~IntrusiveCount() { } void incrementReferenceCount() { count_.increment(); } void releaseReferenceCount() { if ( !count_.decrement() ) delete this; } private: mutable AtomicCounter count_; }; } # ifndef CPPTL_USE_BOOST_SHARED_PTR namespace CppTL { namespace Impl { /// Smart-pointer base class to avoid template code bloat class IntrusivePtrBase { public: operator bool() const { return p_ != 0; } bool operator !() const { return p_ == 0; } protected: IntrusivePtrBase() : p_( 0 ) { } IntrusivePtrBase( void *p ) : p_( p ) { } IntrusivePtrBase( const IntrusivePtrBase &other ) : p_( other.p_ ) { } void swap( IntrusivePtrBase &other ) { CppTL::swap( p_, other.p_ ); } void *get() const { return p_; } void *deref() const { // assert( p_ != 0 ) return p_; } //private: // Friend template function is not well supported // Private access required by function staticPointerCast<> public: void *p_; }; } // namespace Impl inline void instrusivePtrAddRef( IntrusiveCount *p ) { p->incrementReferenceCount(); } inline void intrusivePtrRelease( IntrusiveCount *p ) { p->releaseReferenceCount(); } template<class PointeeType> class IntrusivePtr : public Impl::IntrusivePtrBase { public: typedef IntrusivePtr<PointeeType> ThisType; typedef Impl::IntrusivePtrBase SuperClass; IntrusivePtr() { } IntrusivePtr( PointeeType *p ) : SuperClass( p ) { if ( p ) instrusivePtrAddRef( p ); } IntrusivePtr( const ThisType &other ) : Impl::IntrusivePtrBase( other ) { if ( p_ ) instrusivePtrAddRef( get() ); } ~IntrusivePtr() { if ( p_ ) intrusivePtrRelease( get() ); } void reset() { IntrusivePtr tmp; tmp.swap( *this ); } void reset( PointeeType *p ) { IntrusivePtr tmp( p ); tmp.swap( *this ); } PointeeType *get() const { return static_cast<PointeeType *>( IntrusivePtrBase::get() ); } void swap( IntrusivePtr &other ) { SuperClass::swap( other ); } ThisType &operator =( const IntrusivePtr &other ) { ThisType tmp( other ); swap( tmp ); return *this; } PointeeType &operator *() const { // assert( p_ != 0 ) return *( static_cast<PointeeType *>( p_ ) ); } PointeeType *operator ->() const { return static_cast<PointeeType *>( SuperClass::deref() ); } }; template<class T, class U> IntrusivePtr<T> staticPointerCast( const IntrusivePtr<U> & r) { return IntrusivePtr<T>( static_cast<T*>( r.get() ) ); } } // namespace CppTL # else // ifndef CPPTL_USE_BOOST_SHARED_PTR # include <boost/shared_ptr.hpp> namespace CppTL { template<class PointeeType> class IntrusivePtr : public ::boost::intrusive_ptr<PointeeType> { public: typedef IntrusivePtr<PointeeType> ThisType; IntrusivePtr() { } IntrusivePtr( PointeeType *p ) : ::boost::intrusive_ptr( p ) { } IntrusivePtr( const ::boost::intrusive_ptr<PointeeType> &other ) : ::boost::intrusive_ptr( other ) { } ThisType &operator =( const ::boost::intrusive_ptr<PointeeType> &other ) { return ::boost::intrusive_ptr<PointeeType>::operator =( other ); } }; template<class T, class U> IntrusivePtr<T> staticPointerCast( const ::boost::intrusive_ptr<U> & r) { return IntrusivePtr<T>( ::boost::static_pointer_cast<T>( r ) ); } } // namespace CppTL namespace boost { inline void intrusive_ptr_add_ref( CppTL::IntrusiveCount *p ) { p->incrementReferenceCount(); } inline void intrusive_ptr_release( CppTL::IntrusiveCount *p ) { p->releaseReferenceCount(); } } // namespace boost # endif // ifndef CPPTL_USE_BOOST_SHARED_PTR #endif // CPPTL_INTRUSIVEPTR_H_INCLUDED |
From: Baptiste L. <bl...@us...> - 2005-07-20 21:07:02
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8806/src/cpputtest Modified Files: testtestcase.cpp Log Message: * Added IntrusivePtr, a reference counted smart-pointer * Changed Test hierarchy and TestFixture to use IntrusivePtr instead of SharedPtr (this allows simple upcasting). Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** testtestcase.cpp 27 Feb 2005 16:50:36 -0000 1.15 --- testtestcase.cpp 20 Jul 2005 21:06:51 -0000 1.16 *************** *** 8,13 **** ! struct TestTestCaseFixture { TestTestCaseFixture() : setUp_(0) --- 8,14 ---- ! class TestTestCaseFixture : public CppTL::IntrusiveCount { + public: TestTestCaseFixture() : setUp_(0) *************** *** 42,46 **** }; ! typedef CppTL::SharedPtr<TestTestCaseFixture> TestTestCaseFixturePtr; --- 43,47 ---- }; ! typedef CppTL::IntrusivePtr<TestTestCaseFixture> TestTestCaseFixturePtr; |