cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 33)
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...> - 2004-11-19 20:07:50
|
Update of /cvsroot/cppunit/cppunit/src/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934/src/cppunit Modified Files: Win32DynamicLibraryManager.cpp Log Message: * src/cppunit/Win32DynamicLibraryManager.cpp: integrated patch #1024428, MinGW compilation under Windows XP. Index: Win32DynamicLibraryManager.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/cppunit/Win32DynamicLibraryManager.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Win32DynamicLibraryManager.cpp 7 May 2003 20:07:17 -0000 1.5 --- Win32DynamicLibraryManager.cpp 19 Nov 2004 20:07:41 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- #define NOSOUND #define NOMINMAX + #define BLENDFUNCTION void // for mingw & gcc #include <windows.h> |
From: Baptiste L. <bl...@us...> - 2004-11-19 20:04:45
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20231 Modified Files: ChangeLog NEWS Log Message: * include/cppunit/Message.h * include/cppunit/SourceLine.h: * src/cppunit/Message.cpp: * src/cppunit/SourceLine.cpp: provided thread-safe copy constructor on platform that do not provide thread-safe copy constructor for std::string. Index: NEWS =================================================================== RCS file: /cvsroot/cppunit/cppunit/NEWS,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** NEWS 6 Nov 2004 09:05:45 -0000 1.84 --- NEWS 19 Nov 2004 20:04:35 -0000 1.85 *************** *** 5,9 **** * Portability: ! - Support for embedded visual C++ 4 added. For this purpose, CppUnit now provides a very simple stream implementation if none is provided. This should also help porting on other platforms which have STL but --- 5,9 ---- * Portability: ! - Support for Embedded Visual C++ 4 added. For this purpose, CppUnit now provides a very simple stream implementation if none is provided. This should also help porting on other platforms which have STL but *************** *** 47,50 **** --- 47,55 ---- This was contributed by Max Quatember and Andreas Pfaffenbichler. + * Compilation: + + - MinGW: patch #1024428 contributed by astar, fixed compilation issue in + Win32DynamicLibraryManager.cpp. + * Bug Fix: *************** *** 52,55 **** --- 57,64 ---- if CppUnit is missing. + - Message/SourceLine: copy constructor have been specifically implemented + to ensure they are thread-safe even if std::string copy constructor + is not (usually on reference count based implementation). + * (Possible) Compatiblity break: Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.223 retrieving revision 1.224 diff -C2 -d -r1.223 -r1.224 *** ChangeLog 8 Nov 2004 20:12:56 -0000 1.223 --- ChangeLog 19 Nov 2004 20:04:35 -0000 1.224 *************** *** 1,2 **** --- 1,10 ---- + 2004-11-19 Baptiste Lepilleur <gai...@fr...> + + * include/cppunit/Message.h + * include/cppunit/SourceLine.h: + * src/cppunit/Message.cpp: + * src/cppunit/SourceLine.cpp: provided thread-safe copy constructor on + platform that do not provide thread-safe copy constructor for std::string. + 2004-11-08 Baptiste Lepilleur <gai...@fr...> |
From: Baptiste L. <bl...@us...> - 2004-11-19 20:00:55
|
Update of /cvsroot/cppunit/cppunit/include/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19361/include/cppunit Modified Files: Message.h SourceLine.h Log Message: * added specific copy constructor implementatin to ensure string buffer are detached during copy (therefore providing thread-safe copy constructor for non thread-safe std::string copy constructor implementation). Index: Message.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/Message.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Message.h 29 Aug 2002 07:36:50 -0000 1.5 --- Message.h 19 Nov 2004 20:00:44 -0000 1.6 *************** *** 41,44 **** --- 41,47 ---- Message(); + // Ensure thread-safe copy by detaching the string. + Message( const Message &other ); + explicit Message( const std::string &shortDescription ); *************** *** 55,58 **** --- 58,63 ---- const std::string &detail3 ); + Message &operator =( const Message &other ); + /*! \brief Returns the short description. * \return Short description. *************** *** 128,132 **** bool operator ==( const Message &other ) const; - /*! \brief Tests if a message is different from another one. * \param other Message this message is compared to. --- 133,136 ---- Index: SourceLine.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/SourceLine.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SourceLine.h 13 Jul 2002 10:33:49 -0000 1.6 --- SourceLine.h 19 Nov 2004 20:00:44 -0000 1.7 *************** *** 33,39 **** --- 33,44 ---- SourceLine(); + // Ensure thread-safe copy by detaching the string buffer. + SourceLine( const SourceLine &other ); + SourceLine( const std::string &fileName, int lineNumber ); + SourceLine &operator =( const SourceLine &other ); + /// Destructor. virtual ~SourceLine(); |
From: Baptiste L. <bl...@us...> - 2004-11-19 20:00:54
|
Update of /cvsroot/cppunit/cppunit/src/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19361/src/cppunit Modified Files: Message.cpp SourceLine.cpp Log Message: * added specific copy constructor implementatin to ensure string buffer are detached during copy (therefore providing thread-safe copy constructor for non thread-safe std::string copy constructor implementation). Index: Message.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/cppunit/Message.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Message.cpp 12 Jul 2002 05:59:57 -0000 1.3 --- Message.cpp 19 Nov 2004 20:00:44 -0000 1.4 *************** *** 10,13 **** --- 10,18 ---- } + Message::Message( const Message &other ) + { + *this = other; + } + Message::Message( const std::string &shortDescription ) *************** *** 43,46 **** --- 48,67 ---- } + Message & + Message::operator =( const Message &other ) + { + if ( this != &other ) + { + m_shortDescription = other.m_shortDescription.c_str(); + m_details.clear(); + Details::const_iterator it = other.m_details.begin(); + Details::const_iterator itEnd = other.m_details.end(); + while ( it != itEnd ) + m_details.push_back( (*it++).c_str() ); + } + + return *this; + } + const std::string & Index: SourceLine.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/cppunit/SourceLine.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SourceLine.cpp 12 Jul 2002 05:59:57 -0000 1.2 --- SourceLine.cpp 19 Nov 2004 20:00:44 -0000 1.3 *************** *** 11,22 **** SourceLine::SourceLine( const std::string &fileName, ! int lineNumber ) : ! m_fileName( fileName ), ! m_lineNumber( lineNumber ) { } SourceLine::~SourceLine() { --- 11,41 ---- + SourceLine::SourceLine( const SourceLine &other ) + : m_fileName( other.m_fileName.c_str() ) + , m_lineNumber( other.m_lineNumber ) + { + } + + SourceLine::SourceLine( const std::string &fileName, ! int lineNumber ) ! : m_fileName( fileName.c_str() ) ! , m_lineNumber( lineNumber ) { } + SourceLine & + SourceLine::operator =( const SourceLine &other ) + { + if ( this != &other ) + { + m_fileName = other.m_fileName.c_str(); + m_lineNumber = other.m_lineNumber; + } + return *this; + } + + SourceLine::~SourceLine() { |
From: Baptiste L. <bl...@us...> - 2004-11-19 19:32:26
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11992/src/cpput Added Files: properties.cpp Log Message: * added support for PropertyPath --- NEW FILE: properties.cpp --- #include <opentest/properties.h> #include <string.h> namespace OpenTest { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class Value // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// Value::Value() { guts_.type_ = vtNone; } Value::Value( bool value ) { [...1013 lines suppressed...] if ( !it->value().isProperties() ) { throw std::invalid_argument( "Properties: invalid path, '" + name + "' is not a properties." ); } properties = &(it->value().asProperties()); } return *properties; } void Properties::checkPathNotEmpty( const PropertyPath &path ) const { if ( path.isEmpty() ) throw std::invalid_argument( "Properties: invalid path (empty)." ); } } // namespace OpenTest |
From: Baptiste L. <bl...@us...> - 2004-11-19 19:31:48
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11831/src/cpput Modified Files: cpput.vcproj Log Message: * added support for PropertyPath Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** cpput.vcproj 18 Nov 2004 09:20:33 -0000 1.20 --- cpput.vcproj 19 Nov 2004 19:31:38 -0000 1.21 *************** *** 129,136 **** Filter=""> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File ! RelativePath=".\SConscript"> </File> <File --- 129,136 ---- Filter=""> <File ! RelativePath=".\SConscript"> </File> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File *************** *** 217,220 **** --- 217,223 ---- </File> <File + RelativePath=".\properties.cpp"> + </File> + <File RelativePath="..\..\include\opentest\properties.h"> </File> |
From: Baptiste L. <bl...@us...> - 2004-11-19 19:31:48
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11831/include/opentest Modified Files: forwards.h properties.h Log Message: * added support for PropertyPath Index: properties.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/properties.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** properties.h 18 Nov 2004 09:20:34 -0000 1.3 --- properties.h 19 Nov 2004 19:31:38 -0000 1.4 *************** *** 4,11 **** # include <opentest/forwards.h> # include <cpptl/enumerator.h> ! # include <exception> # include <deque> # include <vector> ! # include <string.h> namespace OpenTest { --- 4,12 ---- # include <opentest/forwards.h> [...1034 lines suppressed...] - #endif // OPENTEST_PROPERTIES_H_INCLUDED --- 358,374 ---- PropertyList::const_iterator find( const std::string &name ) const; ! Properties *tryGetProperties( const PropertyPath &path ); ! const Properties *tryGetProperties( const PropertyPath &path ) const; + Properties &makeProperties( const PropertyPath &path ); ! void checkPathNotEmpty( const PropertyPath &path ) const; + PropertyList properties_; + IndexedProperties indexedProperties_; + }; } // namespace OpenTest #endif // OPENTEST_PROPERTIES_H_INCLUDED Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/forwards.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forwards.h 15 Nov 2004 08:33:30 -0000 1.1 --- forwards.h 19 Nov 2004 19:31:38 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- class ConstPropertiesAccessor; class Property; + class PropertyPath; class Properties; class ResourceList; |
From: Baptiste L. <bl...@us...> - 2004-11-19 19:30:26
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11525/include/cpptl Modified Files: enumerator.h Log Message: * fixed included stdexcept header Index: enumerator.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/enumerator.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** enumerator.h 15 Nov 2004 08:21:04 -0000 1.4 --- enumerator.h 19 Nov 2004 19:30:16 -0000 1.5 *************** *** 3,7 **** # include <cpptl/typetraits.h> ! # include <exception> --- 3,7 ---- # include <cpptl/typetraits.h> ! # include <stdexcept> |
From: Baptiste L. <bl...@us...> - 2004-11-18 09:20:44
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13378/include/cpput Modified Files: forwards.h Added Files: testinfo.h Log Message: * started implementing assertion support for both checking and aborting assertion * TestInfo to send incremental update on the test result to the test driver (logging...) --- NEW FILE: testinfo.h --- #ifndef CPPUT_TESTINFO_H_INCLUDED # define CPPUT_TESTINFO_H_INCLUDED # include <cpput/forwards.h> # include <opentest/properties.h> namespace CppUT { class CPPUT_API AbortingAssertionException : public std::runtime_error { public: AbortingAssertionException( const std::string &message ) : std::runtime_error( "AbortingAssertionException:\n" + message ) { } }; class CPPUT_API TestResultUpdater { public: virtual ~TestResultUpdater() { } virtual void mergeInResult( const std::string &path, const OpenTest::Value &value ) = 0; virtual void appendToResult( const std::string &path, const OpenTest::Value &value ) = 0; }; enum AssertionType { abortingAssertion = 1, checkingAssertion }; namespace TestInfo { void CPPUT_API setTestResultUpdater( const TestResultUpdaterPtr &updater ); void CPPUT_API startNewTest(); OpenTest::PropertiesAccessor CPPUT_API result(); void CPPUT_API newAssertion(); void CPPUT_API setAssertionType( AssertionType type ); AssertionType CPPUT_API assertionType(); void CPPUT_API setAssertionLocation( const char *fileName, unsigned int lineNumber, const char *functionName = 0 ); OpenTest::Properties &CPPUT_API currentAssertion(); /// Realize the current assertion. /// Add data about the current assertion to the test result. /// @exception AbortingAssertionException If assertionType was set to /// abortingAssertion. void CPPUT_API realizeAssertion(); void CPPUT_API mergeInResult( const std::string &path, const OpenTest::Value &value ); void CPPUT_API appendToResult( const std::string &path, const OpenTest::Value &value ); /// Only for using for unit test of the framework itself TestInfoDataPtr CPPUT_API saveAndResetContext(); /// Only for using for unit test of the framework itself void CPPUT_API restoreContext( const TestInfoDataPtr &oldContext ); } // namespace TestInfo } // namespace CppUT #endif // CPPUT_TESTINFO_H_INCLUDED Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** forwards.h 17 Nov 2004 21:47:09 -0000 1.10 --- forwards.h 18 Nov 2004 09:20:34 -0000 1.11 *************** *** 8,11 **** --- 8,12 ---- namespace CppUT { + class AbortingAssertionException; class AbstractTestCase; class AbstractTestSuite; *************** *** 25,29 **** --- 26,32 ---- class TestExceptionGuard; class TestExceptionGuardChain; + class TestInfoData; class TestListener; + class TestResultUpdater; class TestSuite; class TestVisitor; *************** *** 31,35 **** --- 34,40 ---- typedef CppTL::SharedPtr<Test> TestPtr; typedef CppTL::SharedPtr<TestExceptionGuard> TestExceptionGuardPtr; + typedef CppTL::SharedPtr<TestInfoData> TestInfoDataPtr; typedef CppTL::SharedPtr<AbstractTestSuite> AbstractTestSuitePtr; + typedef CppTL::SharedPtr<TestResultUpdater> TestResultUpdaterPtr; typedef CppTL::SharedPtr<TestSuite> TestSuitePtr; |
From: Baptiste L. <bl...@us...> - 2004-11-18 09:20:43
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13378/include/opentest Modified Files: properties.h Log Message: * started implementing assertion support for both checking and aborting assertion * TestInfo to send incremental update on the test result to the test driver (logging...) Index: properties.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/properties.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** properties.h 15 Nov 2004 08:45:24 -0000 1.2 --- properties.h 18 Nov 2004 09:20:34 -0000 1.3 *************** *** 2,6 **** # define OPENTEST_PROPERTIES_H_INCLUDED ! # include <opentest/config.h> # include <cpptl/enumerator.h> # include <exception> --- 2,6 ---- # define OPENTEST_PROPERTIES_H_INCLUDED ! # include <opentest/forwards.h> # include <cpptl/enumerator.h> # include <exception> *************** *** 136,139 **** --- 136,142 ---- const Value &operator[]( const std::string &name ) const; + /// Delegates to Properties::append if the value is a Properties. + Properties &append( const Value &value ); + private: *************** *** 242,245 **** --- 245,250 ---- void swap( Properties &other ); + void clear(); + Properties &set( const Property &property ); *************** *** 757,760 **** --- 762,772 ---- + inline Properties & + Value::append( const Value &value ) + { + return asProperties().append( value ); + } + + inline void Value::throwBadCast() const *************** *** 937,940 **** --- 949,960 ---- + inline void + Properties::clear() + { + properties_.clear(); + indexedProperties_.clear(); + } + + inline Properties & Properties::set( const Property &property ) |
From: Baptiste L. <bl...@us...> - 2004-11-18 09:20:43
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13378/src/cpput Modified Files: cpput.vcproj Added Files: testinfo.cpp Log Message: * started implementing assertion support for both checking and aborting assertion * TestInfo to send incremental update on the test result to the test driver (logging...) --- NEW FILE: testinfo.cpp --- #include <cpput/testinfo.h> namespace { struct CompactLocation { CompactLocation( const char *file = 0, const char *function = 0, unsigned int line =0 ) : file_( file ) , function_( function ) , line_( line ) { } const char *file_; const char *function_; unsigned int line_; }; } namespace CppUT { class TestInfoData { public: TestInfoData() : assertionType_( abortingAssertion ) { } TestResultUpdaterPtr updater_; OpenTest::Properties result_; OpenTest::Properties assertion_; AssertionType assertionType_; CompactLocation assertionLocation_; }; namespace TestInfo { static TestInfoDataPtr staticData( new TestInfoData() ); static const TestInfoDataPtr &dataPtr() { return staticData; } static TestInfoData &data() { return *dataPtr(); } static void setData( const TestInfoDataPtr &data ) { staticData = data; } void setTestResultUpdater( const TestResultUpdaterPtr &updater ) { data().updater_ = updater; } void startNewTest() { data().result_.clear(); } OpenTest::PropertiesAccessor result() { return data().result_.accessor(); } void newAssertion() { data().assertion_.clear(); data().assertionType_ = abortingAssertion; data().assertionLocation_ = CompactLocation(); } void setAssertionType( AssertionType type ) { data().assertionType_ = type; } AssertionType assertionType() { return data().assertionType_; } void setAssertionLocation( const char *fileName, unsigned int lineNumber, const char *functionName ) { data().assertionLocation_ = CompactLocation( fileName, functionName, lineNumber ); } OpenTest::Properties ¤tAssertion() { return data().assertion_; } /// Realize the current assertion. /// Add data about the current assertion to the test result. /// @exception AbortingAssertionException If assertionType was set to /// abortingAssertion. void realizeAssertion() { OpenTest::Properties assertion = data().assertion_; if ( data().assertionLocation_.file_ ) { assertion["location"]["file"] = data().assertionLocation_.file_; assertion["location"]["line"] = data().assertionLocation_.line_; } if ( data().assertionLocation_.function_ ) assertion["location"]["function"] = data().assertionLocation_.function_; appendToResult( "assertions", assertion ); if ( data().assertionType_ == abortingAssertion ) throw AbortingAssertionException( "" ); } void mergeInResult( const std::string &path, const OpenTest::Value &value ) { data().result_[path] = value; if ( data().updater_ ) data().updater_->mergeInResult( path, value ); } void appendToResult( const std::string &path, const OpenTest::Value &value ) { data().result_[path].append( value ); if ( data().updater_ ) data().updater_->appendToResult( path, value ); } TestInfoDataPtr saveAndResetContext() { TestInfoDataPtr oldData = dataPtr(); setData( TestInfoDataPtr( new TestInfoData() ) ); return oldData; } void restoreContext( const TestInfoDataPtr &oldContext ) { setData( oldContext ); } } // namespace TestInfo } // namespace CppUT Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** cpput.vcproj 17 Nov 2004 21:47:10 -0000 1.19 --- cpput.vcproj 18 Nov 2004 09:20:33 -0000 1.20 *************** *** 389,392 **** --- 389,398 ---- </File> <File + RelativePath=".\testinfo.cpp"> + </File> + <File + RelativePath="..\..\include\cpput\testinfo.h"> + </File> + <File RelativePath="..\..\include\cpput\testlistener.h"> </File> |
From: Baptiste L. <bl...@us...> - 2004-11-17 21:47:22
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv508/src/cpput Modified Files: cpput.vcproj testcase.cpp testcontext.cpp testrunner.cpp testsuite.cpp Log Message: * started removing TestDriver stuff from CppUnit 2 * Removed Test::run(), Test::totalTestCount and Test::parent * User can only subclass AbstractTestSuite or AbstractTestCase. * AbstractTest has been inlined into Test * Test no longer have parent * Removed TestListener::enterTest() & TestListener::exitTest() * Moved responsibility of running TestCase from AbstractTestCase to TestContext::run( AbstractTestCase &test ). * Removed method related to suite and enter/exit event from TestContext. * Disabled some unit tests (rely on running test which will change again shortly) Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** cpput.vcproj 17 Nov 2004 09:00:33 -0000 1.18 --- cpput.vcproj 17 Nov 2004 21:47:10 -0000 1.19 *************** *** 251,254 **** --- 251,307 ---- </File> </Filter> + <Filter + Name="experimental" + Filter=""> + <File + RelativePath=".\dllproxy.cpp"> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + DisableLanguageExtensions="FALSE"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + DisableLanguageExtensions="FALSE"/> + </FileConfiguration> + </File> + <File + RelativePath="..\..\include\cpput\dllproxy.h"> + </File> + <File + RelativePath="parametrizedsource.cpp"> + </File> + <File + RelativePath="..\..\include\cpput\parametrizedsource.h"> + </File> + <File + RelativePath="..\..\include\cpput\progresslistener.h"> + </File> + <File + RelativePath=".\tablefixture.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + </File> + <File + RelativePath="..\..\include\cpput\tablefixture.h"> + </File> + </Filter> + <Filter + Name="obsolete by opentest" + Filter=""> + </Filter> <File RelativePath=".\assert.cpp"> *************** *** 273,294 **** </File> <File - RelativePath=".\dllproxy.cpp"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - DisableLanguageExtensions="FALSE"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - DisableLanguageExtensions="FALSE"/> - </FileConfiguration> - </File> - <File - RelativePath="..\..\include\cpput\dllproxy.h"> - </File> - <File RelativePath="..\..\include\cpput\enumerator.h"> </File> --- 326,329 ---- *************** *** 312,324 **** </File> <File - RelativePath="parametrizedsource.cpp"> - </File> - <File - RelativePath="..\..\include\cpput\parametrizedsource.h"> - </File> - <File - RelativePath="..\..\include\cpput\progresslistener.h"> - </File> - <File RelativePath="..\..\include\cpput\properties.h"> </File> --- 347,350 ---- *************** *** 339,360 **** </File> <File - RelativePath=".\tablefixture.cpp"> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="TRUE"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="TRUE"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> - </File> - <File - RelativePath="..\..\include\cpput\tablefixture.h"> - </File> - <File RelativePath="..\..\include\cpput\test.h"> </File> --- 365,368 ---- *************** *** 390,393 **** --- 398,404 ---- </File> <File + RelativePath="..\..\include\cpput\testrunner.h"> + </File> + <File RelativePath="..\..\include\cpput\testrunresult.h"> </File> Index: testsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testsuite.cpp 17 Nov 2004 08:59:34 -0000 1.3 --- testsuite.cpp 17 Nov 2004 21:47:10 -0000 1.4 *************** *** 16,20 **** AbstractTestSuite::AbstractTestSuite( const std::string &name ) ! : AbstractTest( name ) { } --- 16,20 ---- AbstractTestSuite::AbstractTestSuite( const std::string &name ) ! : Test( name ) { } *************** *** 27,50 **** } ! ! void ! AbstractTestSuite::run( TestContext &context ) { ! context.protect( *this, bind1( makeMemFn1( this, ! &AbstractTestSuite::runTests ), ! &context ) ); } - int - AbstractTestSuite::totalTestCount() const - { - int total = 0; - int count = testCount(); - for ( int index = 0; index < count; ++index ) - total += testAt( index )->totalTestCount(); - return total; - } - // Class TestSuite --- 27,37 ---- } ! bool ! AbstractTestSuite::isTestCase() const { ! return false; } // Class TestSuite *************** *** 79,83 **** { tests_.push_back( test ); - test->setParentTest( *this ); } --- 66,69 ---- *************** *** 90,106 **** - void - TestSuite::runTests( TestContext *context ) - { - Tests::iterator it = tests_.begin(); - Tests::iterator itEnd = tests_.end(); - while ( it != itEnd ) - { - const TestPtr &test = *it++; - test->run( *context ); - } - } - - TestSuitePtr makeTestSuite( const std::string &name ) { --- 76,79 ---- Index: testrunner.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testrunner.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testrunner.cpp 15 Nov 2004 08:37:13 -0000 1.1 --- testrunner.cpp 17 Nov 2004 21:47:10 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- #include <cpput/testrunner.h> #include <cpput/message.h> + #include <cpput/testcase.h> #include <cpput/testcontext.h> #include <cpput/testlistener.h> *************** *** 160,164 **** { Test &test = *( itTest->second ); ! test.run( testContext ); } tracker.endTest( entry ); --- 161,177 ---- { Test &test = *( itTest->second ); ! if ( !test.isTestCase() ) ! { ! OpenTest::Properties openResult; ! openResult["result"]["status"]["success"] = false; ! openResult["result"]["status"]["type"] = "skip"; ! openResult["result"]["status"]["message"] = "Can not run test suite."; ! tracker.addTestInfo( entry, openResult ); ! } ! else ! { ! AbstractTestCase &testCase = static_cast<AbstractTestCase &>( test ); ! testContext.run( testCase ); ! } } tracker.endTest( entry ); Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testcase.cpp 23 Jun 2004 18:45:35 -0000 1.3 --- testcase.cpp 17 Nov 2004 21:47:10 -0000 1.4 *************** *** 14,26 **** AbstractTestCase::AbstractTestCase( const std::string &name ) ! : AbstractTest( name ) ! { ! } ! ! ! void ! AbstractTestCase::run( TestContext &context ) { - context.protectTestRun( *this, makeMemFn1( this, &AbstractTestCase::runTest ) ); } --- 14,19 ---- AbstractTestCase::AbstractTestCase( const std::string &name ) ! : Test( name ) { } *************** *** 33,56 **** ! int ! AbstractTestCase::totalTestCount() const ! { ! return 1; ! } ! ! ! void ! AbstractTestCase::runTest( TestContext *context ) { ! bool initialized = context->protect( *this, ! makeMemFn0( this, ! &AbstractTestCase::setUp ) ); ! ! if ( initialized ) ! { ! context->protect( *this, makeMemFn0( this, &AbstractTestCase::doRun ) ); ! context->protect( *this, ! makeMemFn0( this, &AbstractTestCase::tearDown) ); ! } } --- 26,33 ---- ! bool ! AbstractTestCase::isTestCase() const { ! return true; } *************** *** 101,105 **** void ! TestCase::doRun() { if ( run_ ) --- 78,82 ---- void ! TestCase::run() { if ( run_ ) *************** *** 145,149 **** } private: // overridden from AbstractTestCase ! void doRun() { throw CppUT::AssertException( message_ ); --- 122,126 ---- } private: // overridden from AbstractTestCase ! void run() { throw CppUT::AssertException( message_ ); Index: testcontext.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcontext.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testcontext.cpp 4 Aug 2004 19:41:19 -0000 1.8 --- testcontext.cpp 17 Nov 2004 21:47:10 -0000 1.9 *************** *** 1,6 **** #include <cpput/testcontext.h> #include <cpput/resultexception.h> ! #include <cpput/testresult.h> #include <cpput/testlistener.h> #include <cpput/testsuite.h> #include <cpput/testvisitor.h> --- 1,7 ---- #include <cpput/testcontext.h> #include <cpput/resultexception.h> ! #include <cpput/testcase.h> #include <cpput/testlistener.h> + #include <cpput/testresult.h> #include <cpput/testsuite.h> #include <cpput/testvisitor.h> *************** *** 20,36 **** void ! TestContext::protectTestRun( Test &test, ! Functor1<TestContext *> runTest ) { testSucceeded_ = true; ! dispatchTestEvent( test, &TestListener::enterTest ); ! ! guardsChain_.protect( *this, bind1( runTest, this ), test ); if ( testSucceeded_ ) dispatchTestSuccessResult( test ); - - dispatchTestEvent( test, &TestListener::exitTest ); } --- 21,39 ---- void ! TestContext::run( AbstractTestCase &test ) { testSucceeded_ = true; + + bool initialized = protect( test, makeMemFn0( &test, + &AbstractTestCase::setUp ) ); ! if ( initialized ) ! { ! protect( test, makeMemFn0( &test, &AbstractTestCase::run ) ); ! protect( test, makeMemFn0( &test, &AbstractTestCase::tearDown) ); ! } if ( testSucceeded_ ) dispatchTestSuccessResult( test ); } *************** *** 80,111 **** void - TestContext::dispatchTestEvent( Test &test, - void (TestListener::*eventMethod)( Test &, TestContext &) ) - { - Listeners::const_iterator it = listeners_.begin(); - Listeners::const_iterator itEnd = listeners_.end(); - while ( it != itEnd ) - { - TestListener &listener = **it++; - (listener.*eventMethod)( test, *this ); - } - } - - - void - TestContext::dispatchSuiteEvent( AbstractTestSuite &suite, - void (TestListener::*eventMethod)( AbstractTestSuite &, TestContext &) ) - { - Listeners::const_iterator it = listeners_.begin(); - Listeners::const_iterator itEnd = listeners_.end(); - while ( it != itEnd ) - { - TestListener &listener = **it++; - (listener.*eventMethod)( suite, *this ); - } - } - - - void TestContext::dispatchTestResult( TestResult &result ) { --- 83,86 ---- |
From: Baptiste L. <bl...@us...> - 2004-11-17 21:47:21
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv508/src/cpputtest Modified Files: cpputtest.vcproj main.cpp registrytest.cpp testtestcase.cpp testtestsuite.cpp Log Message: * started removing TestDriver stuff from CppUnit 2 * Removed Test::run(), Test::totalTestCount and Test::parent * User can only subclass AbstractTestSuite or AbstractTestCase. * AbstractTest has been inlined into Test * Test no longer have parent * Removed TestListener::enterTest() & TestListener::exitTest() * Moved responsibility of running TestCase from AbstractTestCase to TestContext::run( AbstractTestCase &test ). * Removed method related to suite and enter/exit event from TestContext. * Disabled some unit tests (rely on running test which will change again shortly) Index: registrytest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** registrytest.cpp 27 Jan 2004 20:34:36 -0000 1.1.1.1 --- registrytest.cpp 17 Nov 2004 21:47:10 -0000 1.2 *************** *** 24,28 **** { CppUT::TestSuitePtr suite = registry_->createDefaultTests(); - CPPUT_ASSERT_EQUAL( 0, suite->totalTestCount() ); CPPUT_ASSERT( testNames_.empty() ); } --- 24,27 ---- *************** *** 36,40 **** registry_->addToDefault( makeTestFactory( "Test3" ) ); CppUT::TestSuitePtr suite = registry_->createDefaultTests(); - CPPUT_ASSERT_EQUAL( 3, suite->totalTestCount() ); CppUT::TestContext context; --- 35,38 ---- *************** *** 54,59 **** CppUT::TestSuitePtr suite = registry_->createTests( "Name" ); CppUT::TestSuitePtr suite2 = registry_->createTests( "Name2" ); - CPPUT_ASSERT_EQUAL( 2, suite->totalTestCount() ); - CPPUT_ASSERT_EQUAL( 1, suite2->totalTestCount() ); CppUT::TestContext context; --- 52,55 ---- *************** *** 78,82 **** registry_->addChild( "Name", "Name3" ); CppUT::TestSuitePtr suite = registry_->createTests( "Name" ); - CPPUT_ASSERT_EQUAL( 4, suite->totalTestCount() ); CppUT::TestContext context; --- 74,77 ---- Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.cpp 17 Nov 2004 08:59:34 -0000 1.9 --- main.cpp 17 Nov 2004 21:47:10 -0000 1.10 *************** *** 1,6 **** - #include <cpput/progresslistener.h> - #include <cpput/testrunresult.h> #include <cpput/test.h> - #include <cpput/testcontext.h> #include <cpput/testsuite.h> #include <iostream> --- 1,3 ---- *************** *** 8,14 **** #include "assertstringtest.h" #include "commandlineoptionstest.h" ! #include "registrytest.h" #include "enumeratortest.h" ! #include "testfixturetest.h" #include <cpput/testrunner.h> // cppunit2 testrunner for opentest --- 5,11 ---- #include "assertstringtest.h" #include "commandlineoptionstest.h" ! //#include "registrytest.h" #include "enumeratortest.h" ! //#include "testfixturetest.h" #include <cpput/testrunner.h> // cppunit2 testrunner for opentest *************** *** 17,22 **** bool testBasicAssertions(); ! bool testTestContext(); ! bool testTestRunResult(); bool testTestSuite(); bool testTestCase(); --- 14,19 ---- bool testBasicAssertions(); ! //bool testTestContext(); ! //bool testTestRunResult(); bool testTestSuite(); bool testTestCase(); *************** *** 30,35 **** testFunctors() && // testFunctors2() && ! testTestRunResult() && ! testTestContext() && testTestSuite() && testTestCase(); --- 27,32 ---- testFunctors() && // testFunctors2() && ! // testTestRunResult() && ! // testTestContext() && testTestSuite() && testTestCase(); *************** *** 37,66 **** - static void dumpFailures( const CppUT::TestSuite &allSuite, - const CppUT::TestRunResult &result ) - { - if ( result.successful() ) - { - std::cout << "All " << allSuite.totalTestCount() << " tests passed..." << std::endl; - return; - } - - for ( int index =0; index < result.failureCount(); ++index ) - { - const CppUT::TestResult &failure = result.failureAt( index ); - - if ( failure.location().isValid() ) - std::cout << failure.location().toString() << ": "; - else - std::cout << "Unknown failure location: "; - std::cout << CppUT::path( failure.test() ) << std::endl; - std::cout << failure.message().toString() << std::endl; - } - - std::cout << "Failures: " << result.failureCount() << ", "; - std::cout << "Tested: " << allSuite.totalTestCount() << std::endl; - } - - int main( int argc, const char *argv[] ) { --- 34,37 ---- *************** *** 76,81 **** CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); ! allSuite->add( RegistryTest::suite() ); ! allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); allSuite->add( EnumeratorTest::suite() ); --- 47,52 ---- CppUT::TestSuitePtr allSuite = CppUT::makeTestSuite( "All tests" ); ! // allSuite->add( RegistryTest::suite() ); ! // allSuite->add( TestFixtureTest::suite() ); allSuite->add( AssertStringTest::suite() ); allSuite->add( EnumeratorTest::suite() ); *************** *** 83,99 **** // allSuite->add( CommandLineOptionsTest::suite() ); - - /* // Old stuff using CppUnit 2 - CppUT::TestContext context; - CppUT::TestRunResult result; - context.add( result ); - CppUT::BriefProgressListener progress; - context.add( progress ); - allSuite->run( context ); - - dumpFailures( *allSuite, result ); - return result.successful() ? 0 : 1; - */ - CppUT::TestRunner runner; CppUT::AbstractTestSuitePtr rootSuite = --- 54,57 ---- Index: testtestsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestsuite.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testtestsuite.cpp 4 Aug 2004 08:01:15 -0000 1.2 --- testtestsuite.cpp 17 Nov 2004 21:47:10 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- #include <cpput/assert.h> #include <cpput/resultexception.h> + #include <cpput/testcase.h> #include <cpput/testsuite.h> #include <cpput/testcontext.h> *************** *** 6,34 **** #include "mocktestvisitor.h" namespace { ! class CalledTest : public CppUT::AbstractTest { public: CalledTest( int &callCount ) ! : callCount_( callCount ) { } ! void run( CppUT::TestContext &context ) { ++callCount_; } - void accept( CppUT::TestVisitor &visitor ) - { - } - - int totalTestCount() const - { - return 1; - } - int &callCount_; }; --- 7,28 ---- #include "mocktestvisitor.h" + /// @todo Simplify this test some more... namespace { ! class CalledTest : public CppUT::AbstractTestCase { public: CalledTest( int &callCount ) ! : CppUT::AbstractTestCase( "CalledTest" ) ! , callCount_( callCount ) { } ! void run() { ++callCount_; } int &callCount_; }; *************** *** 53,63 **** suite1->add( test1 ); CPPUT_ASSERT_EQUAL( 1, suite1->testCount() ); - CPPUT_ASSERT_EQUAL( 1, suite1->totalTestCount() ); CPPUT_ASSERT( test1 == suite1->testAt(0), "returned test[0] is not added test" ); - CPPUT_ASSERT( test1->parentTest() == &*suite1 ); - - CppUT::TestContext context; - suite1->run( context ); - CPPUT_ASSERT_EQUAL( 1, callCount1, "test1 should have been called" ); int callCount2 = 0; --- 47,51 ---- *************** *** 65,85 **** suite1->add( test2 ); CPPUT_ASSERT_EQUAL( 2, suite1->testCount() ); - CPPUT_ASSERT_EQUAL( 2, suite1->totalTestCount() ); CPPUT_ASSERT( test1 == suite1->testAt(0), "returned test[0] is not added test" ); CPPUT_ASSERT( test2 == suite1->testAt(1), "returned test[1] is not added test" ); - CPPUT_ASSERT( test1->parentTest() == &*suite1 ); - CPPUT_ASSERT( test2->parentTest() == &*suite1 ); - - suite1->run( context ); - CPPUT_ASSERT_EQUAL( 2, callCount1, "test1 should have been called" ); - CPPUT_ASSERT_EQUAL( 1, callCount2, "test2 should have been called" ); - - CppUT::TestSuitePtr suite2 = CppUT::makeTestSuite( "Suite 2" ); - suite2->add( CppUT::TestPtr( new CalledTest( callCount1 ) ) ); - suite2->add( CppUT::TestPtr( new CalledTest( callCount1 ) ) ); - CPPUT_ASSERT_EQUAL( 2, suite2->totalTestCount() ); - - suite1->add( suite2 ); - CPPUT_ASSERT_EQUAL( 4, suite1->totalTestCount() ); } catch ( CppUT::AssertException &e ) --- 53,58 ---- Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testtestcase.cpp 17 Nov 2004 08:59:34 -0000 1.5 --- testtestcase.cpp 17 Nov 2004 21:47:10 -0000 1.6 *************** *** 85,88 **** --- 85,89 ---- "Test 1" ); CPPUT_ASSERT_EQUAL( "Test 1", test->name() ); + CPPUT_ASSERT( test->isTestCase() ); MockTestVisitor visitor; *************** *** 90,100 **** CPPUT_ASSERT_EQUAL( 1, visitor.visitTestCaseCount_ ); CPPUT_ASSERT_EQUAL( 0, visitor.visitTestSuiteCount_ ); - CPPUT_ASSERT( test->parentTest() == 0 ); - CPPUT_ASSERT_EQUAL( 1, test->totalTestCount() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, testCall ); CPPUT_ASSERT_EQUAL( 0, result.failureCount() ); --- 91,99 ---- CPPUT_ASSERT_EQUAL( 1, visitor.visitTestCaseCount_ ); CPPUT_ASSERT_EQUAL( 0, visitor.visitTestSuiteCount_ ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, testCall ); CPPUT_ASSERT_EQUAL( 0, result.failureCount() ); *************** *** 128,135 **** "Test 2" ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); --- 127,136 ---- "Test 2" ); + CPPUT_ASSERT( test->isTestCase() ); + CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); *************** *** 148,156 **** &callback, &testTearDownCall, "Test" ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 0, testRunCall ); --- 149,158 ---- &callback, &testTearDownCall, "Test" ); + CPPUT_ASSERT( test->isTestCase() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 0, testRunCall ); *************** *** 169,177 **** &callback, &testTearDownCall, "Test" ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); --- 171,180 ---- &callback, &testTearDownCall, "Test" ); + CPPUT_ASSERT( test->isTestCase() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); *************** *** 190,198 **** &callbackThrow, &testTearDownCall, "Test" ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); --- 193,202 ---- &callbackThrow, &testTearDownCall, "Test" ); + CPPUT_ASSERT( test->isTestCase() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, testSetUpCall ); CPPUT_ASSERT_EQUAL( 1, testRunCall ); *************** *** 211,219 **** &TestTestCaseFixture::run ), "Test1" ); CPPUT_ASSERT_EQUAL( "Test1", test->name() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 1, fixture->setUp_ ); CPPUT_ASSERT_EQUAL( 1, fixture->run_ ); --- 215,224 ---- &TestTestCaseFixture::run ), "Test1" ); + CPPUT_ASSERT( test->isTestCase() ); CPPUT_ASSERT_EQUAL( "Test1", test->name() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 1, fixture->setUp_ ); CPPUT_ASSERT_EQUAL( 1, fixture->run_ ); *************** *** 231,239 **** CppUT::bind1( CppUT::makeMemFn1( fixture, &TestTestCaseFixture::runWithParameter ), 100 ), "Test1" ); CPPUT_ASSERT_EQUAL( "Test1", test->name() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! test->run( context ); CPPUT_ASSERT_EQUAL( 0, fixture->setUp_ ); CPPUT_ASSERT_EQUAL( 111, fixture->run_ ); --- 236,245 ---- CppUT::bind1( CppUT::makeMemFn1( fixture, &TestTestCaseFixture::runWithParameter ), 100 ), "Test1" ); + CPPUT_ASSERT( test->isTestCase() ); CPPUT_ASSERT_EQUAL( "Test1", test->name() ); CppUT::TestContext context; CppUT::TestRunResult result; context.add( result ); ! context.run( static_cast<CppUT::AbstractTestCase &>( *test ) ); CPPUT_ASSERT_EQUAL( 0, fixture->setUp_ ); CPPUT_ASSERT_EQUAL( 111, fixture->run_ ); Index: cpputtest.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/cpputtest.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** cpputtest.vcproj 22 Oct 2004 06:20:07 -0000 1.7 --- cpputtest.vcproj 17 Nov 2004 21:47:10 -0000 1.8 *************** *** 191,194 **** --- 191,206 ---- <File RelativePath="registrytest.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File *************** *** 200,203 **** --- 212,227 ---- <File RelativePath="testfixturetest.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File *************** *** 215,221 **** --- 239,269 ---- <File RelativePath=".\testtestcontext.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File RelativePath=".\testtestrunresult.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File |
From: Baptiste L. <bl...@us...> - 2004-11-17 21:47:21
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv508/include/cpput Modified Files: forwards.h test.h testcase.h testcontext.h testlistener.h testsuite.h Log Message: * started removing TestDriver stuff from CppUnit 2 * Removed Test::run(), Test::totalTestCount and Test::parent * User can only subclass AbstractTestSuite or AbstractTestCase. * AbstractTest has been inlined into Test * Test no longer have parent * Removed TestListener::enterTest() & TestListener::exitTest() * Moved responsibility of running TestCase from AbstractTestCase to TestContext::run( AbstractTestCase &test ). * Removed method related to suite and enter/exit event from TestContext. * Disabled some unit tests (rely on running test which will change again shortly) Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testcase.h 17 Nov 2004 08:59:05 -0000 1.4 --- testcase.h 17 Nov 2004 21:47:09 -0000 1.5 *************** *** 13,34 **** ! class CPPUT_API AbstractTestCase : public AbstractTest { public: AbstractTestCase( const std::string &name ); ! // overridden from AbstractTest ! void run( TestContext &context ); ! void accept( TestVisitor &visitor ); ! int totalTestCount() const; ! ! private: ! void runTest( TestContext *context ); virtual void setUp(); ! virtual void doRun() = 0; virtual void tearDown(); --- 13,31 ---- ! class CPPUT_API AbstractTestCase : public Test { public: AbstractTestCase( const std::string &name ); ! public: // overridden from Test void accept( TestVisitor &visitor ); ! /// Returns \c true if the class is derived from AbstractTestCase. ! bool isTestCase() const; + public: virtual void setUp(); ! virtual void run() = 0; virtual void tearDown(); *************** *** 47,54 **** const std::string &name ); ! private: // overridden from AbstractTestCase void setUp(); ! void doRun(); void tearDown(); --- 44,51 ---- const std::string &name ); ! public: // overridden from AbstractTestCase void setUp(); ! void run(); void tearDown(); Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testsuite.h 27 Jan 2004 23:37:21 -0000 1.2 --- testsuite.h 17 Nov 2004 21:47:09 -0000 1.3 *************** *** 8,12 **** namespace CppUT { ! class CPPUT_API AbstractTestSuite : public AbstractTest { public: --- 8,12 ---- namespace CppUT { ! class CPPUT_API AbstractTestSuite : public Test { public: *************** *** 19,31 **** virtual TestPtr testAt( int index ) const = 0; ! // overridden from AbstractTest void accept( TestVisitor &visitor ); ! void run( TestContext &context ); ! ! int totalTestCount() const; ! ! private: ! virtual void runTests( TestContext *context ) = 0; }; --- 19,27 ---- virtual TestPtr testAt( int index ) const = 0; ! public: // overridden from Test void accept( TestVisitor &visitor ); ! /// Returns \c true if the class is derived from AbstractTestCase. ! bool isTestCase() const; }; *************** *** 49,55 **** private: ! void runTests( TestContext *context ); ! ! typedef std::deque<TestPtr> Tests; Tests tests_; }; --- 45,49 ---- private: ! typedef std::deque<TestPtr> Tests; Tests tests_; }; Index: testcontext.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcontext.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testcontext.h 4 Aug 2004 19:41:19 -0000 1.7 --- testcontext.h 17 Nov 2004 21:47:09 -0000 1.8 *************** *** 14,22 **** TestContext(); ! void protectTestRun( Test &test, ! Functor1<TestContext *> runTest ); ! ! bool protect( Test &test, ! const Functor0 &functor ); void add( TestListener &listener ); --- 14,18 ---- TestContext(); ! void run( AbstractTestCase &test ); void add( TestListener &listener ); *************** *** 29,37 **** private: ! void dispatchTestEvent( Test &test, ! void (TestListener::*eventMethod)( Test &, TestContext &) ); ! ! void dispatchSuiteEvent( AbstractTestSuite &suite, ! void (TestListener::*eventMethod)( AbstractTestSuite &, TestContext &) ) ; void dispatchTestResult( TestResult &result ); --- 25,30 ---- private: ! bool protect( Test &test, ! const Functor0 &functor ); void dispatchTestResult( TestResult &result ); Index: testlistener.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testlistener.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testlistener.h 4 Aug 2004 06:43:53 -0000 1.4 --- testlistener.h 17 Nov 2004 21:47:09 -0000 1.5 *************** *** 15,21 **** } ! virtual void enterTest( Test &test, TestContext &context ) ! { ! } virtual void processTestResult( TestResult &result, --- 15,21 ---- } ! //virtual void enterTest( Test &test, TestContext &context ) ! //{ ! //} virtual void processTestResult( TestResult &result, *************** *** 24,30 **** } ! virtual void exitTest( Test &test, TestContext &context ) ! { ! } }; --- 24,30 ---- } ! //virtual void exitTest( Test &test, TestContext &context ) ! //{ ! //} }; Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test.h 4 Aug 2004 21:17:17 -0000 1.2 --- test.h 17 Nov 2004 21:47:09 -0000 1.3 *************** *** 2,6 **** # define CPPUT_TEST_H_INCLUDED - # include <cpput/config.h> # include <cpput/forwards.h> # include <string> --- 2,5 ---- *************** *** 13,75 **** class CPPUT_API Test { public: ! virtual std::string name() const = 0; ! ! virtual void run( TestContext &context ) = 0; ! ! virtual void accept( TestVisitor &visitor ) = 0; ! ! virtual void setParentTest( Test &parentTest ) = 0; ! ! virtual Test *parentTest() const = 0; ! ! virtual int totalTestCount() const =0; ! }; ! ! class CPPUT_API AbstractTest : public Test ! { ! public: ! AbstractTest() ! : parentTest_( 0 ) { } ! AbstractTest( const std::string &name ) ! : name_( name ) ! , parentTest_( 0 ) { } ! // overridden from Test ! std::string name() const { ! return name_; } ! void setParentTest( Test &parentTest ) { - parentTest_ = &parentTest; } ! Test *parentTest() const { - return parentTest_; } private: std::string name_; - Test *parentTest_; }; - inline std::string CPPUT_API path( Test &test ) - { - if ( test.parentTest() ) - return path( *test.parentTest() ) + "/" + test.name(); - return test.name(); - } - - } // namespace CppUT --- 12,62 ---- class CPPUT_API Test { + // ensure that this class can only be derived by AbstractTestCase and + // AbstractTestSuite. + friend class AbstractTestCase; + friend class AbstractTestSuite; public: ! virtual ~Test() ! { ! } ! std::string name() const { + return name_; } ! /// @warning You must never change the name of the test after ! /// registering the test or scheduling it for running. ! void setName( const std::string &name ) { + name_ = name; } ! /// Returns \c true if the class is derived from AbstractTestSuite. ! bool isTestSuite() const { ! return !isTestCase(); } ! virtual void accept( TestVisitor &visitor ) = 0; ! ! /// Returns \c true if the class is derived from AbstractTestCase. ! virtual bool isTestCase() const = 0; ! ! private: ! Test() { } ! Test( const std::string &name ) ! : name_( name ) { } private: std::string name_; }; } // namespace CppUT Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** forwards.h 17 Nov 2004 08:59:05 -0000 1.9 --- forwards.h 17 Nov 2004 21:47:09 -0000 1.10 *************** *** 8,11 **** --- 8,12 ---- namespace CppUT { + class AbstractTestCase; class AbstractTestSuite; class AssertException; |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:02:50
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/src/cpput Removed Files: atomiccounter.cpp Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation --- atomiccounter.cpp DELETED --- |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:02:50
|
Update of /cvsroot/cppunit/cppunit2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/src Modified Files: cpput_lib.suo Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: cpput_lib.suo =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput_lib.suo,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsPGG4Ol and /tmp/cvsqxwQ3o differ |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:02:50
|
Update of /cvsroot/cppunit/cppunit2/include/cpput/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/include/cpput/impl Removed Files: atomiccounter.h Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation --- atomiccounter.h DELETED --- |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:02:49
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/include/cpput Removed Files: smartptr.h Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation --- smartptr.h DELETED --- |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:01:11
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19369/src/cpput Modified Files: cpput.vcproj Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** cpput.vcproj 16 Nov 2004 22:48:02 -0000 1.17 --- cpput.vcproj 17 Nov 2004 09:00:33 -0000 1.18 *************** *** 129,136 **** Filter=""> <File ! RelativePath=".\SConscript"> </File> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File --- 129,136 ---- Filter=""> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File ! RelativePath=".\SConscript"> </File> <File *************** *** 267,288 **** </File> <File - RelativePath=".\atomiccounter.cpp"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - DisableLanguageExtensions="FALSE"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - DisableLanguageExtensions="FALSE"/> - </FileConfiguration> - </File> - <File - RelativePath="..\..\include\cpput\impl\atomiccounter.h"> - </File> - <File RelativePath="..\..\include\cpput\autolink.h"> </File> --- 267,270 ---- *************** *** 321,324 **** --- 303,309 ---- </File> <File + RelativePath=".\functor.py"> + </File> + <File RelativePath="..\..\include\cpput\location.h"> </File> *************** *** 351,357 **** </File> <File - RelativePath="..\..\include\cpput\smartptr.h"> - </File> - <File RelativePath="..\..\include\cpput\stringize.h"> </File> --- 336,339 ---- |
From: Baptiste L. <bl...@us...> - 2004-11-17 09:00:55
|
Update of /cvsroot/cppunit/cppunit2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19369/src Modified Files: cpput_lib.sln Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: cpput_lib.sln =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput_lib.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cpput_lib.sln 22 Oct 2004 06:20:23 -0000 1.3 --- cpput_lib.sln 17 Nov 2004 09:00:32 -0000 1.4 *************** *** 9,17 **** EndProjectSection EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpputrunner", "cpputrunner\cpputrunner.vcproj", "{8EC622CA-677A-4CAF-9B22-46F60DCD1822}" - ProjectSection(ProjectDependencies) = postProject - {199257EE-17B2-4BC2-A3F7-D379217A86A0} = {199257EE-17B2-4BC2-A3F7-D379217A86A0} - EndProjectSection - EndProject Global GlobalSection(SolutionConfiguration) = preSolution --- 9,12 ---- *************** *** 28,35 **** {F58E403C-FE39-43E5-B7FD-0478FCE3ACE4}.Release.ActiveCfg = Release|Win32 {F58E403C-FE39-43E5-B7FD-0478FCE3ACE4}.Release.Build.0 = Release|Win32 - {8EC622CA-677A-4CAF-9B22-46F60DCD1822}.Debug.ActiveCfg = Debug|Win32 - {8EC622CA-677A-4CAF-9B22-46F60DCD1822}.Debug.Build.0 = Debug|Win32 - {8EC622CA-677A-4CAF-9B22-46F60DCD1822}.Release.ActiveCfg = Release|Win32 - {8EC622CA-677A-4CAF-9B22-46F60DCD1822}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution --- 23,26 ---- |
From: Baptiste L. <bl...@us...> - 2004-11-17 08:59:53
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19035/src/cpputtest Modified Files: main.cpp registrytest.h testfixturetest.cpp testfixturetest.h testfunctor.cpp testtestcase.cpp Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: testfixturetest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testfixturetest.h 3 Aug 2004 22:20:03 -0000 1.3 --- testfixturetest.h 17 Nov 2004 08:59:34 -0000 1.4 *************** *** 23,27 **** private: ! static void addTest( const CppUT::SmartPtr<TestFixtureTest> &fixture, void (TestFixtureTest::*testMethod)(), const char *testName, --- 23,27 ---- private: ! static void addTest( const CppTL::SharedPtr<TestFixtureTest> &fixture, void (TestFixtureTest::*testMethod)(), const char *testName, Index: registrytest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** registrytest.h 27 Jan 2004 23:37:22 -0000 1.2 --- registrytest.h 17 Nov 2004 08:59:34 -0000 1.3 *************** *** 2,6 **** #define CPPUT_REGISTRYTEST_H_INCLUDED ! # include <cpput/smartptr.h> # include <cpput/assert.h> # include <cpput/testfixture.h> --- 2,6 ---- #define CPPUT_REGISTRYTEST_H_INCLUDED ! # include <cpptl/sharedptr.h> # include <cpput/assert.h> # include <cpput/testfixture.h> *************** *** 40,44 **** std::set<std::string> testNames_; ! CppUT::SmartPtr<CppUT::Registry> registry_; }; --- 40,44 ---- std::set<std::string> testNames_; ! CppTL::SharedPtr<CppUT::Registry> registry_; }; Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.cpp 15 Nov 2004 08:39:20 -0000 1.8 --- main.cpp 17 Nov 2004 08:59:34 -0000 1.9 *************** *** 98,102 **** CppUT::TestRunner runner; CppUT::AbstractTestSuitePtr rootSuite = ! CppUT::staticPointerCast<CppUT::AbstractTestSuite>( allSuite ); runner.setRootSuite( rootSuite ); --- 98,102 ---- CppUT::TestRunner runner; CppUT::AbstractTestSuitePtr rootSuite = ! CppTL::staticPointerCast<CppUT::AbstractTestSuite>( allSuite ); runner.setRootSuite( rootSuite ); Index: testfixturetest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testfixturetest.cpp 3 Aug 2004 22:20:03 -0000 1.3 --- testfixturetest.cpp 17 Nov 2004 08:59:34 -0000 1.4 *************** *** 121,125 **** { CppUT::TestSuitePtr suite( CppUT::makeTestSuite( "TestFixtureTest" ) ); ! CppUT::SmartPtr<TestFixtureTest> fixture( new TestFixtureTest() ); addTest( fixture, &TestFixtureTest::testEmptySuite, --- 121,125 ---- { CppUT::TestSuitePtr suite( CppUT::makeTestSuite( "TestFixtureTest" ) ); ! CppTL::SharedPtr<TestFixtureTest> fixture( new TestFixtureTest() ); addTest( fixture, &TestFixtureTest::testEmptySuite, *************** *** 141,145 **** void ! TestFixtureTest::addTest( const CppUT::SmartPtr<TestFixtureTest> &fixture, void (TestFixtureTest::*testMethod)(), const char *testName, --- 141,145 ---- void ! TestFixtureTest::addTest( const CppTL::SharedPtr<TestFixtureTest> &fixture, void (TestFixtureTest::*testMethod)(), const char *testName, Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testtestcase.cpp 4 Aug 2004 08:01:15 -0000 1.4 --- testtestcase.cpp 17 Nov 2004 08:59:34 -0000 1.5 *************** *** 44,48 **** }; ! typedef CppUT::SmartPtr<TestTestCaseFixture> TestTestCaseFixturePtr; --- 44,48 ---- }; ! typedef CppTL::SharedPtr<TestTestCaseFixture> TestTestCaseFixturePtr; Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testfunctor.cpp 4 Aug 2004 08:01:15 -0000 1.3 --- testfunctor.cpp 17 Nov 2004 08:59:34 -0000 1.4 *************** *** 76,80 **** CPPUT_ASSERT( callbackCalled, "Functor() did not call functor object." ); ! CppUT::SmartPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; fn = CppUT::makeMemFn0( helper, &HelperObject::setFlagOn ); --- 76,80 ---- CPPUT_ASSERT( callbackCalled, "Functor() did not call functor object." ); ! CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; fn = CppUT::makeMemFn0( helper, &HelperObject::setFlagOn ); *************** *** 98,102 **** CPPUT_ASSERT_FALSE( callbackCalled, "Functor1(false) did not call C function." ); ! CppUT::SmartPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; fn = CppUT::makeMemFn1( helper, &HelperObject::setFlag ); --- 98,102 ---- CPPUT_ASSERT_FALSE( callbackCalled, "Functor1(false) did not call C function." ); ! CppTL::SharedPtr<HelperObject> helper( new HelperObject() ); helper->flag_ = false; fn = CppUT::makeMemFn1( helper, &HelperObject::setFlag ); |
From: Baptiste L. <bl...@us...> - 2004-11-17 08:59:45
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19035/src/cpput Modified Files: functor.py testsuite.cpp Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: testsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testsuite.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testsuite.cpp 27 Jan 2004 23:37:22 -0000 1.2 --- testsuite.cpp 17 Nov 2004 08:59:34 -0000 1.3 *************** *** 86,90 **** TestSuite::add( const TestSuitePtr &test ) { ! add( staticPointerCast<Test>( test ) ); } --- 86,90 ---- TestSuite::add( const TestSuitePtr &test ) { ! add( CppTL::staticPointerCast<Test>( test ) ); } Index: functor.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/functor.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functor.py 27 Jan 2004 23:49:48 -0000 1.2 --- functor.py 17 Nov 2004 08:59:34 -0000 1.3 *************** *** 230,234 **** private: ! %sSmartPtr< %s > impl_; }; """ % ( name, --- 230,234 ---- private: ! %sCppTL::SharedPtr< %s > impl_; }; """ % ( name, *************** *** 278,282 **** basic_ptr_type = ptr_type if ptr_type.count( 'shared_ptr' ): ! basic_ptr_type = 'SmartPtr<ObjectType>' impl_template_params = ['ObjectType', basic_ptr_type] makefn_template_params = '' --- 278,282 ---- basic_ptr_type = ptr_type if ptr_type.count( 'shared_ptr' ): ! basic_ptr_type = 'CppTL::SharedPtr<ObjectType>' impl_template_params = ['ObjectType', basic_ptr_type] makefn_template_params = '' *************** *** 489,493 **** // File generated using functor.py. DO NOT EDIT. ! # include <cpput/smartptr.h> namespace CppUT { --- 489,493 ---- // File generated using functor.py. DO NOT EDIT. ! # include <cpptl/sharedptr.h> namespace CppUT { *************** *** 601,607 **** printCFnGenerator( out, types, True ) printMemFnGenerator( out, arg_count, types, False, 'ObjectType *' ) ! printMemFnGenerator( out, arg_count, types, False, 'SmartPtr<ObjectType>' ) printMemFnGenerator( out, arg_count, types, True, 'ObjectType *' ) ! printMemFnGenerator( out, arg_count, types, True, 'SmartPtr<ObjectType>' ) printBindGenerator( out, types, False ) printBindGenerator( out, types, True ) --- 601,607 ---- printCFnGenerator( out, types, True ) printMemFnGenerator( out, arg_count, types, False, 'ObjectType *' ) ! printMemFnGenerator( out, arg_count, types, False, 'CppTL::SharedPtr<ObjectType>' ) printMemFnGenerator( out, arg_count, types, True, 'ObjectType *' ) ! printMemFnGenerator( out, arg_count, types, True, 'CppTL::SharedPtr<ObjectType>' ) printBindGenerator( out, types, False ) printBindGenerator( out, types, True ) *************** *** 615,619 **** } //namespace CppUT ! #endif CPPUT_FUNCTOR_H_INCLUDED """ --- 615,619 ---- } //namespace CppUT ! #endif // CPPUT_FUNCTOR_H_INCLUDED """ |
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18930/include/cpput Modified Files: enumerator.h equality.h forwards.h functor.h parametrizedsource.h resource.h tablefixture.h testcase.h testfixture.h thread.h Log Message: * moved CppUT::SmartPtr to CppTL::SharedPtr * moved CppUT::AtomicCounter to CppTL::AtomicCounter and inlined implementation Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testcase.h 23 Jun 2004 18:45:36 -0000 1.3 --- testcase.h 17 Nov 2004 08:59:05 -0000 1.4 *************** *** 6,10 **** # include <cpput/functor.h> # include <cpput/test.h> ! # include <cpput/smartptr.h> # include <string> --- 6,10 ---- # include <cpput/functor.h> # include <cpput/test.h> ! # include <cpptl/sharedptr.h> # include <string> *************** *** 74,78 **** template<typename FixtureType> ! TestPtr makeFixtureTestCase( const SmartPtr<FixtureType> &fixture, const Functor0 &run, const std::string &name ) --- 74,78 ---- template<typename FixtureType> ! TestPtr makeFixtureTestCase( const CppTL::SharedPtr<FixtureType> &fixture, const Functor0 &run, const std::string &name ) Index: parametrizedsource.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/parametrizedsource.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** parametrizedsource.h 1 Feb 2004 16:12:51 -0000 1.3 --- parametrizedsource.h 17 Nov 2004 08:59:05 -0000 1.4 *************** *** 4,8 **** # include <cpput/config.h> # include <cpput/testcase.h> ! # include <cpput/smartptr.h> # include <map> # include <stdexcept> --- 4,8 ---- # include <cpput/config.h> # include <cpput/testcase.h> ! # include <cpptl/sharedptr.h> # include <map> # include <stdexcept> *************** *** 20,24 **** ! typedef SmartPtr<ParameterNode> ParameterNodePtr; --- 20,24 ---- ! typedef CppTL::SharedPtr<ParameterNode> ParameterNodePtr; *************** *** 55,59 **** }; ! typedef SmartPtr<TestParameterFactory> TestParameterFactoryPtr; typedef FunctorR1<TestParameterFactoryPtr, std::string> SuiteParameterFactory; --- 55,59 ---- }; ! typedef CppTL::SharedPtr<TestParameterFactory> TestParameterFactoryPtr; typedef FunctorR1<TestParameterFactoryPtr, std::string> SuiteParameterFactory; Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/forwards.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** forwards.h 15 Nov 2004 08:25:39 -0000 1.8 --- forwards.h 17 Nov 2004 08:59:05 -0000 1.9 *************** *** 2,6 **** # define CPPUT_FORWARDS_H_INCLUDED ! # include <cpput/smartptr.h> # include <string> --- 2,7 ---- # define CPPUT_FORWARDS_H_INCLUDED ! # include <cpput/config.h> ! # include <cpptl/sharedptr.h> # include <string> *************** *** 27,34 **** class TestVisitor; ! typedef SmartPtr<Test> TestPtr; ! typedef SmartPtr<TestExceptionGuard> TestExceptionGuardPtr; ! typedef SmartPtr<AbstractTestSuite> AbstractTestSuitePtr; ! typedef SmartPtr<TestSuite> TestSuitePtr; --- 28,35 ---- class TestVisitor; ! typedef CppTL::SharedPtr<Test> TestPtr; ! typedef CppTL::SharedPtr<TestExceptionGuard> TestExceptionGuardPtr; ! typedef CppTL::SharedPtr<AbstractTestSuite> AbstractTestSuitePtr; ! typedef CppTL::SharedPtr<TestSuite> TestSuitePtr; Index: equality.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/equality.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** equality.h 1 Feb 2004 10:22:02 -0000 1.2 --- equality.h 17 Nov 2004 08:59:05 -0000 1.3 *************** *** 2,6 **** # define CPPUT_EQUALITY_H_INCLUDED ! # include <cpput/smartptr.h> # ifndef CPPUT_NO_DEFAULT_EQUALITY --- 2,6 ---- # define CPPUT_EQUALITY_H_INCLUDED ! # include <cpptl/sharedptr.h> # ifndef CPPUT_NO_DEFAULT_EQUALITY *************** *** 39,43 **** template<typename AType, typename BType> ! bool equalityTest( const SmartPtr<AType> &a, const SmartPtr<BType> &b ) { return a.get() == b.get() || ( a.get() && b.get() && equalityTest( *a, *b ) ); --- 39,43 ---- template<typename AType, typename BType> ! bool equalityTest( const CppTL::SharedPtr<AType> &a, const CppTL::SharedPtr<BType> &b ) { return a.get() == b.get() || ( a.get() && b.get() && equalityTest( *a, *b ) ); Index: enumerator.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/enumerator.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** enumerator.h 21 Oct 2004 17:23:23 -0000 1.8 --- enumerator.h 17 Nov 2004 08:59:05 -0000 1.9 *************** *** 3,7 **** # include <cpput/config.h> ! # include <cpput/smartptr.h> # include <deque> # include <iterator> --- 3,7 ---- # include <cpput/config.h> ! # include <cpptl/sharedptr.h> # include <deque> # include <iterator> *************** *** 44,48 **** public: typedef AEnumeratedType EnumeratedType; ! typedef SmartPtr<EnumeratorImpl<EnumeratedType> > Ptr; virtual EnumeratedType getNext() =0; --- 44,48 ---- public: typedef AEnumeratedType EnumeratedType; ! typedef CppTL::SharedPtr<EnumeratorImpl<EnumeratedType> > Ptr; virtual EnumeratedType getNext() =0; Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testfixture.h 15 Nov 2004 08:28:51 -0000 1.4 --- testfixture.h 17 Nov 2004 08:59:05 -0000 1.5 *************** *** 2,6 **** # define CPPUT_TESTFIXTURE_H_INCLUDED ! # include <cpput/config.h> # include <cpput/testcase.h> # include <cpput/testsuite.h> --- 2,6 ---- # define CPPUT_TESTFIXTURE_H_INCLUDED ! # include <cpput/forwards.h> # include <cpput/testcase.h> # include <cpput/testsuite.h> *************** *** 31,35 **** namespace Impl { ! typedef SmartPtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory --- 31,35 ---- namespace Impl { ! typedef CppTL::SharedPtr<TestFixture> TestFixturePtr; class CPPUT_API FixtureFactory *************** *** 100,106 **** } ! CPPUT_DEDUCED_TYPENAME SmartPtr<FixtureType> operator()() { ! return ::CppUT::staticPointerCast<FixtureType>( factory_() ); } --- 100,106 ---- } ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr<FixtureType> operator()() { ! return ::CppTL::staticPointerCast<FixtureType>( factory_() ); } *************** *** 127,131 **** { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::SmartPtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) --- 127,131 ---- { ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( factory_ ); ! ::CppTL::SharedPtr<FixtureType> fixture; // CPPUT_TESTSUITE_EXTEND (if defined) *************** *** 179,183 **** ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppUT::SmartPtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ --- 179,183 ---- ::CppUT::Impl::FixtureFactoryWrapper<CppUT_ThisType> fixtureFactory( \ factory_ ); \ ! ::CppTL::SharedPtr<FixtureType> fixture # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ *************** *** 195,199 **** ::CppUT::Impl::FixtureFactoryImpl<CppUT_ThisType> factory; \ addTests_( testSuite, factory ); \ ! return ::CppUT::staticPointerCast< ::CppUT::Test >( testSuite ); \ } --- 195,199 ---- ::CppUT::Impl::FixtureFactoryImpl<CppUT_ThisType> factory; \ addTests_( testSuite, factory ); \ ! return ::CppTL::staticPointerCast< ::CppUT::Test >( testSuite ); \ } Index: thread.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/thread.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** thread.h 7 Feb 2004 21:50:57 -0000 1.7 --- thread.h 17 Nov 2004 08:59:05 -0000 1.8 *************** *** 209,213 **** class Thread; ! typedef SmartPtr<Thread> ThreadPtr; inline ThreadPtr createThread( Functor0 threadFunction ) --- 209,213 ---- class Thread; ! typedef CppTL::SharedPtr<Thread> ThreadPtr; inline ThreadPtr createThread( Functor0 threadFunction ) Index: resource.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/resource.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** resource.h 21 Oct 2004 17:21:20 -0000 1.2 --- resource.h 17 Nov 2004 08:59:05 -0000 1.3 *************** *** 2,6 **** # define CPPUT_RESOURCE_H_INCLUDED ! # include <cpput/smartptr.h> /* --- 2,6 ---- # define CPPUT_RESOURCE_H_INCLUDED ! # include <cpptl/sharedptr.h> /* *************** *** 17,21 **** class Resource; ! typedef SmartPtr<Resource> ResourcePtr; class CPPUT_API Resource --- 17,21 ---- class Resource; ! typedef CppTL::SharedPtr<Resource> ResourcePtr; class CPPUT_API Resource Index: functor.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/functor.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functor.h 1 Feb 2004 16:12:51 -0000 1.4 --- functor.h 17 Nov 2004 08:59:05 -0000 1.5 *************** *** 4,8 **** // File generated using functor.py. DO NOT EDIT. ! # include <cpput/smartptr.h> namespace CppUT { --- 4,8 ---- // File generated using functor.py. DO NOT EDIT. ! # include <cpptl/sharedptr.h> namespace CppUT { *************** *** 485,489 **** private: ! SmartPtr< Impl::Functor0Base<void> > impl_; }; --- 485,489 ---- private: ! CppTL::SharedPtr< Impl::Functor0Base<void> > impl_; }; *************** *** 515,519 **** private: ! CPPUT_DEDUCED_TYPENAME SmartPtr< Impl::Functor0Base<ReturnType> > impl_; }; --- 515,519 ---- private: ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr< Impl::Functor0Base<ReturnType> > impl_; }; *************** *** 548,552 **** private: ! CPPUT_DEDUCED_TYPENAME SmartPtr< Impl::Functor1Base<void, Arg1Type> > impl_; }; --- 548,552 ---- private: ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr< Impl::Functor1Base<void, Arg1Type> > impl_; }; *************** *** 579,583 **** private: ! CPPUT_DEDUCED_TYPENAME SmartPtr< Impl::Functor1Base<ReturnType, Arg1Type> > impl_; }; --- 579,583 ---- private: ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr< Impl::Functor1Base<ReturnType, Arg1Type> > impl_; }; *************** *** 613,617 **** private: ! CPPUT_DEDUCED_TYPENAME SmartPtr< Impl::Functor2Base<void, Arg1Type, Arg2Type> > impl_; }; --- 613,617 ---- private: ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr< Impl::Functor2Base<void, Arg1Type, Arg2Type> > impl_; }; *************** *** 645,649 **** private: ! CPPUT_DEDUCED_TYPENAME SmartPtr< Impl::Functor2Base<ReturnType, Arg1Type, Arg2Type> > impl_; }; --- 645,649 ---- private: ! CPPUT_DEDUCED_TYPENAME CppTL::SharedPtr< Impl::Functor2Base<ReturnType, Arg1Type, Arg2Type> > impl_; }; *************** *** 693,700 **** template<class ObjectType> Functor0 ! makeMemFn0( SmartPtr<ObjectType> object, void (ObjectType::*method)() ) { ! return makeFn0( Impl::MemFn0< ObjectType, SmartPtr<ObjectType> >( object, method ) ); } --- 693,700 ---- template<class ObjectType> Functor0 ! makeMemFn0( CppTL::SharedPtr<ObjectType> object, void (ObjectType::*method)() ) { ! return makeFn0( Impl::MemFn0< ObjectType, CppTL::SharedPtr<ObjectType> >( object, method ) ); } *************** *** 709,716 **** template<class ReturnType, class ObjectType> FunctorR0<ReturnType> ! makeMemFnR0( SmartPtr<ObjectType> object, ReturnType (ObjectType::*method)() ) { ! return makeFnR0<ReturnType>( Impl::MemFnR0< ObjectType, SmartPtr<ObjectType>, ReturnType >( object, method ) ); } --- 709,716 ---- template<class ReturnType, class ObjectType> FunctorR0<ReturnType> ! makeMemFnR0( CppTL::SharedPtr<ObjectType> object, ReturnType (ObjectType::*method)() ) { ! return makeFnR0<ReturnType>( Impl::MemFnR0< ObjectType, CppTL::SharedPtr<ObjectType>, ReturnType >( object, method ) ); } *************** *** 765,772 **** template<class ObjectType, class Arg1Type> Functor1<Arg1Type> ! makeMemFn1( SmartPtr<ObjectType> object, void (ObjectType::*method)(Arg1Type arg1) ) { ! return makeFn1( Impl::MemFn1< ObjectType, SmartPtr<ObjectType>, Arg1Type >( object, method ) ); } --- 765,772 ---- template<class ObjectType, class Arg1Type> Functor1<Arg1Type> ! makeMemFn1( CppTL::SharedPtr<ObjectType> object, void (ObjectType::*method)(Arg1Type arg1) ) { ! return makeFn1( Impl::MemFn1< ObjectType, CppTL::SharedPtr<ObjectType>, Arg1Type >( object, method ) ); } *************** *** 781,788 **** template<class ReturnType, class ObjectType, class Arg1Type> FunctorR1<ReturnType, Arg1Type> ! makeMemFnR1( SmartPtr<ObjectType> object, ReturnType (ObjectType::*method)(Arg1Type arg1) ) { ! return makeFnR1<ReturnType>( Impl::MemFnR1< ObjectType, SmartPtr<ObjectType>, ReturnType, Arg1Type >( object, method ) ); } --- 781,788 ---- template<class ReturnType, class ObjectType, class Arg1Type> FunctorR1<ReturnType, Arg1Type> ! makeMemFnR1( CppTL::SharedPtr<ObjectType> object, ReturnType (ObjectType::*method)(Arg1Type arg1) ) { ! return makeFnR1<ReturnType>( Impl::MemFnR1< ObjectType, CppTL::SharedPtr<ObjectType>, ReturnType, Arg1Type >( object, method ) ); } *************** *** 861,868 **** template<class ObjectType, class Arg1Type, class Arg2Type> Functor2<Arg1Type, Arg2Type> ! makeMemFn2( SmartPtr<ObjectType> object, void (ObjectType::*method)(Arg1Type arg1, Arg2Type arg2) ) { ! return makeFn2( Impl::MemFn2< ObjectType, SmartPtr<ObjectType>, Arg1Type, Arg2Type >( object, method ) ); } --- 861,868 ---- template<class ObjectType, class Arg1Type, class Arg2Type> Functor2<Arg1Type, Arg2Type> ! makeMemFn2( CppTL::SharedPtr<ObjectType> object, void (ObjectType::*method)(Arg1Type arg1, Arg2Type arg2) ) { ! return makeFn2( Impl::MemFn2< ObjectType, CppTL::SharedPtr<ObjectType>, Arg1Type, Arg2Type >( object, method ) ); } *************** *** 877,884 **** template<class ReturnType, class ObjectType, class Arg1Type, class Arg2Type> FunctorR2<ReturnType, Arg1Type, Arg2Type> ! makeMemFnR2( SmartPtr<ObjectType> object, ReturnType (ObjectType::*method)(Arg1Type arg1, Arg2Type arg2) ) { ! return makeFnR2<ReturnType>( Impl::MemFnR2< ObjectType, SmartPtr<ObjectType>, ReturnType, Arg1Type, Arg2Type >( object, method ) ); } --- 877,884 ---- template<class ReturnType, class ObjectType, class Arg1Type, class Arg2Type> FunctorR2<ReturnType, Arg1Type, Arg2Type> ! makeMemFnR2( CppTL::SharedPtr<ObjectType> object, ReturnType (ObjectType::*method)(Arg1Type arg1, Arg2Type arg2) ) { ! return makeFnR2<ReturnType>( Impl::MemFnR2< ObjectType, CppTL::SharedPtr<ObjectType>, ReturnType, Arg1Type, Arg2Type >( object, method ) ); } Index: tablefixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/tablefixture.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tablefixture.h 15 Jun 2004 01:19:17 -0000 1.1 --- tablefixture.h 17 Nov 2004 08:59:05 -0000 1.2 *************** *** 10,14 **** class TableFixture; class TableRow; ! typedef SmartPtr<CellBinder> CellBinderPtr; class Table --- 10,14 ---- class TableFixture; class TableRow; ! typedef CppTL::SharedPtr<CellBinder> CellBinderPtr; class Table |
From: Baptiste L. <bl...@us...> - 2004-11-16 22:48:12
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25237/src/cpput Modified Files: cpput.vcproj Log Message: * updated Index: cpput.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/cpput.vcproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** cpput.vcproj 15 Nov 2004 08:51:43 -0000 1.16 --- cpput.vcproj 16 Nov 2004 22:48:02 -0000 1.17 *************** *** 129,136 **** Filter=""> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File ! RelativePath=".\SConscript"> </File> <File --- 129,136 ---- Filter=""> <File ! RelativePath=".\SConscript"> </File> <File ! RelativePath="..\cpputtest\SConscript"> </File> <File *************** *** 210,213 **** --- 210,253 ---- Name="opentest" Filter=""> + <File + RelativePath="..\..\include\opentest\config.h"> + </File> + <File + RelativePath="..\..\include\opentest\forwards.h"> + </File> + <File + RelativePath="..\..\include\opentest\properties.h"> + </File> + <File + RelativePath="..\..\include\opentest\resourcelist.h"> + </File> + <File + RelativePath="..\..\include\opentest\testplan.h"> + </File> + <File + RelativePath="..\..\include\opentest\testrunner.h"> + </File> + <File + RelativePath="..\..\include\opentest\texttestdriver.h"> + </File> + </Filter> + <Filter + Name="doc" + Filter=""> + <File + RelativePath="..\..\doc\cppunit2todo.txt"> + </File> + <File + RelativePath="..\..\doc\features.txt"> + </File> + <File + RelativePath="..\..\doc\index.txt"> + </File> + <File + RelativePath="..\..\doc\opentest.txt"> + </File> + <File + RelativePath="..\..\doc\opentesttodo.txt"> + </File> </Filter> <File |
From: Baptiste L. <bl...@us...> - 2004-11-16 22:46:54
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24939/include/opentest Modified Files: testrunner.h texttestdriver.h Log Message: * removed the addSuite() method during test declaration (make implementation of test driver more complex). Index: testrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/testrunner.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testrunner.h 15 Nov 2004 08:33:30 -0000 1.1 --- testrunner.h 16 Nov 2004 22:46:44 -0000 1.2 *************** *** 40,45 **** const Properties &data ) = 0; - virtual void addSuite( TestId suite ) = 0; - virtual void endSuite() = 0; }; --- 40,43 ---- Index: texttestdriver.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/texttestdriver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texttestdriver.h 15 Nov 2004 08:34:13 -0000 1.1 --- texttestdriver.h 16 Nov 2004 22:46:44 -0000 1.2 *************** *** 89,94 **** const Properties &data ); - void addSuite( TestId suite ); - void endSuite(); --- 89,92 ---- *************** *** 112,121 **** private: struct TestInfo { ! TestInfo( TestId id, const std::string &name, const Properties &info ) : id_( id ) , name_( name ) , info_( info ) { } --- 110,125 ---- private: + typedef std::deque<TestId> ParentSuites; + struct TestInfo { ! TestInfo( TestId id, ! const std::string &name, ! const Properties &info, ! const ParentSuites &parents ) : id_( id ) , name_( name ) , info_( info ) + , parents_( parents ) { } *************** *** 124,132 **** std::string name_; Properties info_; }; typedef std::set<TestId> Tests; typedef std::map<TestId,TestId> Hierarchy; // suite <-> tests - typedef std::stack<TestId> DeclarationSuites; typedef std::deque<TestResult> Results; typedef std::vector<unsigned int> TestResultIndexes; --- 128,136 ---- std::string name_; Properties info_; + ParentSuites parents_; }; typedef std::set<TestId> Tests; typedef std::map<TestId,TestId> Hierarchy; // suite <-> tests typedef std::deque<TestResult> Results; typedef std::vector<unsigned int> TestResultIndexes; *************** *** 139,148 **** const TestInfo &getTestInfo( TestId id ) const; TestRunner &runner_; TestInfos testInfos_; Tests tests_; Tests suites_; Hierarchy hierarchy_; ! DeclarationSuites declarationSuites_; Tests testsToRun_; Results results_; --- 143,164 ---- const TestInfo &getTestInfo( TestId id ) const; + void declareTestOrSuite( TestId id, + const std::string &name, + const Properties &data ); + + std::string getTestPath( TestId test, unsigned int maxParent = -1 ) const; + TestRunner &runner_; + /// Information associated to each test/suite at declaration time TestInfos testInfos_; + /// TestId of all test cases. Tests tests_; + /// TestId of all suites. Tests suites_; + /// Parent/Child association to describe the hierarchy Hierarchy hierarchy_; ! /// Stack of parent suite for 'current' declared test. ! ParentSuites declaratorParentSuites_; ! /// List of test to run. Tests testsToRun_; Results results_; *************** *** 301,308 **** { TestId id = nextTestId(); ! declarationSuites_.push( id ); suites_.insert( id ); - TestInfo info( id, name, data ); - testInfos_.insert( TestInfos::value_type( id, info ) ); return id; } --- 317,323 ---- { TestId id = nextTestId(); ! declareTestOrSuite( id, name, data ); ! declaratorParentSuites_.push_back( id ); suites_.insert( id ); return id; } *************** *** 314,321 **** { TestId id = nextTestId(); ! hierarchy_.insert( Hierarchy::value_type( declarationSuites_.top(), id ) ); tests_.insert( id ); - TestInfo info( id, name, data ); - testInfos_.insert( TestInfos::value_type( id, info ) ); return id; } --- 329,334 ---- { TestId id = nextTestId(); ! declareTestOrSuite( id, name, data ); tests_.insert( id ); return id; } *************** *** 323,336 **** inline void ! TextTestDriver::addSuite( TestId suite ) { ! hierarchy_.insert( Hierarchy::value_type( declarationSuites_.top(), suite ) ); } ! inline void ! TextTestDriver::endSuite() { ! declarationSuites_.pop(); } --- 336,354 ---- inline void ! TextTestDriver::endSuite() { ! declaratorParentSuites_.pop_back(); } ! void ! TextTestDriver::declareTestOrSuite( TestId id, ! const std::string &name, ! const Properties &data ) { ! TestInfo info( id, name, data, declaratorParentSuites_ ); ! testInfos_.insert( TestInfos::value_type( id, info ) ); ! if ( declaratorParentSuites_.size() > 0 ) ! hierarchy_.insert( Hierarchy::value_type( declaratorParentSuites_.back(), id ) ); } *************** *** 361,365 **** results_.push_back( result ); ! std::cout << "Testing '" << getTestInfo( testEntry.test() ).name_ << "' : "; std::cout.flush(); } --- 379,385 ---- results_.push_back( result ); ! const unsigned int maxParent = 1; ! std::cout << "Testing '" << getTestPath( testEntry.test(), ! maxParent ) << "' : "; std::cout.flush(); } *************** *** 445,449 **** } ! std::cout << getTestInfo( testResult.test() ).name_ << std::endl; std::string failureType = info["result"]["status"].getValue("type","").asString(); --- 465,469 ---- } ! std::cout << getTestPath( testResult.test() ) << std::endl; std::string failureType = info["result"]["status"].getValue("type","").asString(); *************** *** 460,463 **** --- 480,508 ---- } + + inline std::string + TextTestDriver::getTestPath( TestId test, unsigned int maxParent ) const + { + std::string path; + const TestInfo &info = getTestInfo( test ); + path = "/" + info.name_; + if ( info.parents_.empty() ) + return path; + + bool isPartialPath = maxParent < info.parents_.size(); + + for ( unsigned int index = info.parents_.size()-1; + index != -1 && maxParent-- >0; + --index ) + { + const TestInfo &parentInfo = getTestInfo( info.parents_[index] ); + path = "/" + parentInfo.name_ + path; + } + + if ( isPartialPath ) + path = ".." + path; + return path; + } + } // namespace OpenTest |