cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 8)
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...> - 2006-06-29 20:30:34
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31492 Modified Files: INSTALL-WIN32.txt Log Message: - fixed doc typos. Index: INSTALL-WIN32.txt =================================================================== RCS file: /cvsroot/cppunit/cppunit/INSTALL-WIN32.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** INSTALL-WIN32.txt 18 Jun 2004 09:59:17 -0000 1.12 --- INSTALL-WIN32.txt 29 Jun 2006 20:30:29 -0000 1.13 *************** *** 10,16 **** - Make HostApp the Active project - Compile ! - in VC++, Tools/Customize.../Add-ins and macro files/Browse... ! - select the file lib/TestRunnerDSPlugIn.dll and press ok to register ! the add-ins (double-click on failure = open file in VC++). - Run the project --- 10,17 ---- - Make HostApp the Active project - Compile ! - For Visual Studio 6 only: ! - in VC++, Tools/Customize.../Add-ins and macro files/Browse... ! - select the file lib/TestRunnerDSPlugIn.dll and press ok to register ! the add-ins (double-click on failure = open file in VC++). - Run the project *************** *** 32,38 **** tests from a GUI. ! * DSPlugIn (lib/TestRunnerDSPlugIn.dll) : a VC++ add-in used by testrunner.dll. If you double-click on a failure in the MFC TestRunner, a running instance of VC++ will open the file and highlight the line. * TestPlugInRunner : (Warning: experimental) a VC++ --- 33,40 ---- tests from a GUI. ! * DSPlugIn (lib/TestRunnerDSPlugIn.dll) : a VC++ 6.0 add-in used by testrunner.dll. If you double-click on a failure in the MFC TestRunner, a running instance of VC++ will open the file and highlight the line. + This add-ins is not required for Visual Studio 7. * TestPlugInRunner : (Warning: experimental) a VC++ *************** *** 144,148 **** Notes that the DllPlugInTester(d).exe version of this tools does not allow to use the automatic test registration that comes along with test plug-in. ! You probably don't want to use them unless you really now what you are doing. --- 146,150 ---- Notes that the DllPlugInTester(d).exe version of this tools does not allow to use the automatic test registration that comes along with test plug-in. ! You probably don't want to use them unless you really know what you are doing. |
From: Baptiste L. <bl...@us...> - 2006-06-29 20:03:25
|
Update of /cvsroot/cppunit/cppunit/include/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20713/include/cppunit Modified Files: CompilerOutputter.h Log Message: - fixed doc typos. Index: CompilerOutputter.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/CompilerOutputter.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CompilerOutputter.h 9 Jul 2005 07:42:47 -0000 1.16 --- CompilerOutputter.h 29 Jun 2006 20:03:17 -0000 1.17 *************** *** 86,90 **** * * - VC++ error location format: "%p(%l):" => produce "G:\prg\MyTest.cpp(43):" ! * - GCC error location format: "%f:%l:" => produce "MyTest.cpp(43):" * * Thoses are the two compilers currently <em>supported</em> (gcc format is used if --- 86,90 ---- * * - VC++ error location format: "%p(%l):" => produce "G:\prg\MyTest.cpp(43):" ! * - GCC error location format: "%f:%l:" => produce "MyTest.cpp:43:" * * Thoses are the two compilers currently <em>supported</em> (gcc format is used if |
From: Baptiste L. <bl...@us...> - 2006-06-29 19:53:47
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15557 Modified Files: ChangeLog NEWS Log Message: * src/msvc6/testrunner/MsDevCallerListCtrl.cpp: applied correction provided to fix bug #1498175 (double click on failure does not goto failure). Index: NEWS =================================================================== RCS file: /cvsroot/cppunit/cppunit/NEWS,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** NEWS 4 Mar 2006 21:47:05 -0000 1.95 --- NEWS 29 Jun 2006 19:53:40 -0000 1.96 *************** *** 1,2 **** --- 1,20 ---- + New in CppUnit 1.11.6: + ---------------------- + + * Portability: + + - autogen.sh can now be run on Mac OS X (patch #1449380 + contributed by Sander Temme). + + * MFC Test runner: + + - fixed bug #1498175: double click on failure would sometime + not goto failed assertion in visual studio. + + * Documentation: + + - now generated with doxygen 1.4.7 new 'tabs' style. + + New in CppUnit 1.11.4: ---------------------- Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.247 retrieving revision 1.248 diff -C2 -d -r1.247 -r1.248 *** ChangeLog 29 Jun 2006 18:38:09 -0000 1.247 --- ChangeLog 29 Jun 2006 19:53:40 -0000 1.248 *************** *** 4,7 **** --- 4,17 ---- hidden virtual function warning. + * autogen.sh: applied patch #1449380 contributed by Sander Temme + to allow running autogen on Mac OS X. + + * doc/header.html: updated to handle new tabs css required for + html doc generated with doxygen 1.4.7. + + * src/msvc6/testrunner/MsDevCallerListCtrl.cpp: applied correction + provided to fix bug #1498175 (double click on failure does not + goto failure). + 2006-03-04 Baptiste Lepilleur <gai...@fr...> * contrib/xml-xsl/report.xsl: reported correction posted on the wiki. |
From: Baptiste L. <bl...@us...> - 2006-06-29 19:53:45
|
Update of /cvsroot/cppunit/cppunit/src/msvc6/testrunner In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15557/src/msvc6/testrunner Modified Files: MsDevCallerListCtrl.cpp Log Message: * src/msvc6/testrunner/MsDevCallerListCtrl.cpp: applied correction provided to fix bug #1498175 (double click on failure does not goto failure). Index: MsDevCallerListCtrl.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/msvc6/testrunner/MsDevCallerListCtrl.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MsDevCallerListCtrl.cpp 10 Sep 2004 07:53:18 -0000 1.5 --- MsDevCallerListCtrl.cpp 29 Jun 2006 19:53:40 -0000 1.6 *************** *** 218,232 **** void MsDevCallerListCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) { ! CPoint pt; ! GetCursorPos( &pt); ! ScreenToClient( &pt); ! ! // some dirty hack to get some selection ! // should get the border-width + 1, but WINDOWINFO ! // is not supported in Win95 ! pt.x = 5; - UINT flags = 0; - int hotItem = HitTest( pt, &flags); CString lineNumber = GetItemText( hotItem, m_lineNumberSubItem); CString fileName = GetItemText( hotItem, m_fileNameSubItem); --- 218,225 ---- void MsDevCallerListCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) { ! // get index of selected item ! POSITION pos = GetFirstSelectedItemPosition(); ! int hotItem = GetNextSelectedItem(pos); CString lineNumber = GetItemText( hotItem, m_lineNumberSubItem); CString fileName = GetItemText( hotItem, m_fileNameSubItem); |
From: Baptiste L. <bl...@us...> - 2006-06-29 19:41:24
|
Update of /cvsroot/cppunit/cppunit/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9075/doc Modified Files: other_documentation.dox Log Message: - updated e-mail. Index: other_documentation.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit/doc/other_documentation.dox,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** other_documentation.dox 30 Jul 2005 06:57:03 -0000 1.17 --- other_documentation.dox 29 Jun 2006 19:41:20 -0000 1.18 *************** *** 36,40 **** \author Michael Feathers (mfe...@ob...) \author Jerome Lacoste (lac...@al...) ! \author Baptiste Lepilleur <gai...@fr...> \author Bastiaan Bakker <bas...@li...> \author Steve Robbins <sm...@so...> --- 36,40 ---- \author Michael Feathers (mfe...@ob...) \author Jerome Lacoste (lac...@al...) ! \author Baptiste Lepilleur <bl...@us...> \author Bastiaan Bakker <bas...@li...> \author Steve Robbins <sm...@so...> |
From: Baptiste L. <bl...@us...> - 2006-06-29 19:38:08
|
Update of /cvsroot/cppunit/cppunit/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7233/doc Modified Files: header.html Log Message: * doc/header.html: updated to handle new tabs css required for html doc generated with doxygen 1.4.7. Index: header.html =================================================================== RCS file: /cvsroot/cppunit/cppunit/doc/header.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** header.html 30 Sep 2001 22:36:08 -0000 1.3 --- header.html 29 Jun 2006 19:38:04 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- </title> <link href="doxygen.css" rel="stylesheet" type="text/css"> + <link href="tabs.css" rel="stylesheet" type="text/css"> </head> |
From: Baptiste L. <bl...@us...> - 2006-06-29 18:58:38
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13257 Modified Files: ChangeLog Log Message: * include/cppunit/ui/text/TextTestRunner.h * src/cppunit/TextTestRunner.cpp: applied patch #1210013 to remove hidden virtual function warning. Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** ChangeLog 4 Mar 2006 21:47:05 -0000 1.246 --- ChangeLog 29 Jun 2006 18:38:09 -0000 1.247 *************** *** 1,2 **** --- 1,7 ---- + 2006-06-29 Baptiste Lepilleur <gai...@fr...> + * include/cppunit/ui/text/TextTestRunner.h + * src/cppunit/TextTestRunner.cpp: applied patch #1210013 to remove + hidden virtual function warning. + 2006-03-04 Baptiste Lepilleur <gai...@fr...> * contrib/xml-xsl/report.xsl: reported correction posted on the wiki. *************** *** 9,13 **** * cppunit.pc.in: * configure.in: ! * Makefile.am: integrated patch from Rober Leight to generate pkg-config. 2006-02-04 Baptiste Lepilleur <gai...@fr...> --- 14,18 ---- * cppunit.pc.in: * configure.in: ! * Makefile.am: integrated patch from Robert Leight to generate pkg-config. 2006-02-04 Baptiste Lepilleur <gai...@fr...> |
From: Baptiste L. <bl...@us...> - 2006-06-29 18:57:08
|
Update of /cvsroot/cppunit/cppunit/src/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13257/src/cppunit Modified Files: TextTestRunner.cpp Log Message: * include/cppunit/ui/text/TextTestRunner.h * src/cppunit/TextTestRunner.cpp: applied patch #1210013 to remove hidden virtual function warning. Index: TextTestRunner.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/cppunit/TextTestRunner.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TextTestRunner.cpp 13 Oct 2005 20:13:16 -0000 1.19 --- TextTestRunner.cpp 29 Jun 2006 18:38:10 -0000 1.20 *************** *** 134,136 **** --- 134,144 ---- + void + TextTestRunner::run( TestResult &controller, + const std::string &testPath ) + { + TestRunner::run( controller, testPath ); + } + + CPPUNIT_NS_END |
From: Baptiste L. <bl...@us...> - 2006-06-29 18:56:47
|
Update of /cvsroot/cppunit/cppunit/include/cppunit/ui/text In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13257/include/cppunit/ui/text Modified Files: TextTestRunner.h Log Message: * include/cppunit/ui/text/TextTestRunner.h * src/cppunit/TextTestRunner.cpp: applied patch #1210013 to remove hidden virtual function warning. Index: TextTestRunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/ui/text/TextTestRunner.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextTestRunner.h 2 Sep 2002 06:25:43 -0000 1.3 --- TextTestRunner.h 29 Jun 2006 18:38:10 -0000 1.4 *************** *** 79,82 **** --- 79,86 ---- TestResult &eventManager() const; + public: // overridden from TestRunner (to avoid hidden virtual function warning) + virtual void run( TestResult &controller, + const std::string &testPath = "" ); + protected: virtual void wait( bool doWait ); |
From: Baptiste L. <bl...@us...> - 2006-06-29 18:48:45
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16377 Modified Files: autogen.sh Log Message: * autogen.sh: applied patch #1449380 to allow running autogen on Mac OS X. Index: autogen.sh =================================================================== RCS file: /cvsroot/cppunit/cppunit/autogen.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** autogen.sh 20 Jun 2001 14:17:37 -0000 1.4 --- autogen.sh 29 Jun 2006 18:45:37 -0000 1.5 *************** *** 7,11 **** aclocal $ACLOCAL_FLAGS || \ aclocal $ACLOCAL_FLAGS -I /usr/local/share/aclocal ! libtoolize --force autoheader automake --add-missing --- 7,20 ---- aclocal $ACLOCAL_FLAGS || \ aclocal $ACLOCAL_FLAGS -I /usr/local/share/aclocal ! ! for l in libtoolize glibtoolize; ! do ! ($l --version) < /dev/null > /dev/null 2>&1 && { ! LIBTOOLIZE=$l ! break ! } ! done ! ! $LIBTOOLIZE --force autoheader automake --add-missing |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:32:24
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20596/include/cpptl Modified Files: forwards.h Added Files: _stlimpl.h smallmap.h Log Message: * added CppTL:SmallMap, a std::map like container that use a sorted vector to hold item. --- NEW FILE: _stlimpl.h --- #ifndef CPPTL__STLIMPL_H_INCLUDED # define CPPTL__STLIMPL_H_INCLUDED # include "config.h" // add include for malloc/free /* Notes: we need to prefix some (all) functions with cpptl_ because some STL implementations are bugged: namespace A { void copy(); struct X { X( int x ) : x_( x ) {} int x_; }; } std::vector<X> a; // failed to compile because std::vector template find A::copy() // with ADL instead of std::copy(). */ // Make exception related code optional # ifndef CPPTL_NO_EXCEPTION_SUPPORT # define CPPTL_TRY_BEGIN # define CPPTL_TRY_END_CLEANUP( expression ) # else # define CPPTL_TRY_BEGIN try # define CPPTL_TRY_END_CLEANUP( expression ) catch ( ... ) { expression; throw; } # endif namespace CppTL { namespace Impl { // iterator stuffs template<class T> struct ConstIteratorTraits { typedef T &reference; typedef T *pointer; }; template<class T> struct NonConstIteratorTraits { typedef T &reference; typedef T *pointer; }; // algorithm for use when implementing containers // algorithms template<class T> inline void construct( T &object, const T &value ) { new (&object) T(value); } template<class T> inline void destruct( T &object ) { object.~T(); } template<class T,class OutputIt> inline void destruct_range( OutputIt first, OutputIt last ) { for ( ; first != last; ++first ) ::CppTL::Impl::destruct( *first ); } template<class InputIt,class OutputIt> void cpptl_copy( InputIt first, InputIt last, OutputIt firstDestIt ) { for ( ; first != last; ++first, ++firstDestIt ) *first = *firstDestIt; } template<class InputIt,class OutputIt> void copy_backwards( InputIt first, InputIt last, OutputIt endDestIt ) { if ( first != last ) { do { --last; --endDestIt; *endDestIt = *last; } while ( first != last ); } } template<class InputIt,class OutputIt> void copy_with_construct( InputIt first, InputIt last, OutputIt firstDestIt ) { for ( ; first != last; ++first, ++firstDestIt ) { CPPTL_TYPENAME InputIt::reference old = *first; ::CppTL::Impl::construct(*firstDestIt, *first ); } } template<class OutputIt, class ValueType> void copy_with_construct_value( OutputIt firstDestIt, unsigned int count, const ValueType &value ) { while ( count-- >= 0 ) { new (*firstDestIt)( value ); ++firstDestIt; } } template<class InputIt,class OutputIt> void copy_and_destroy( InputIt first, InputIt last, OutputIt firstDestIt ) { for ( ; first != last; ++first, ++firstDestIt ) { CPPTL_TYPENAME InputIt::reference old = *first; ::CppTL::Impl::construct(*firstDestIt, old ); ::CppTL::Impl::destruct( old ); } } template<class InputIt,class OutputIt> void copy_backwards_and_destroy( InputIt first, InputIt last, OutputIt endDestIt ) { if ( first != last ) { do { --last; --endDestIt; CPPTL_TYPENAME InputIt::reference old = *last; ::CppTL::Impl::construct( *endDestIt, old ); ::CppTL::Impl::destruct( old ); } while ( first != last ); } } } } // namespace CppTL { namespace Impl { namespace CppTL { // Common predicates template<class T> struct LessPred { bool operator()( const T &a, const T &b ) const { return a < b; } }; // Pair template<class A, class B> class Pair { public: typedef A first_type; typedef B second_type; Pair() { } Pair( const first_type &a, const second_type &b ) : first( a ) , second( b ) { } first_type first; second_type second; }; // Common allocators template<class T> class MallocAllocator { public: typedef unsigned int size_t; T *allocate() { return static_cast<T*>( malloc( sizeof(T) ) ); } void release( T *object ) { free( object ); } T *allocateArray( size_t count ) { return static_cast<T*>( malloc( sizeof(T) * count ) ); } void releaseArray( T *array, size_t allocatedSize ) { free( array ); } void swap( MallocAllocator &other ) { } }; } // namespace CppTL #endif // CPPTL__STLIMPL_H_INCLUDED --- NEW FILE: smallmap.h --- #ifndef CPPTL_VECTOR_H_INCLUDED # define CPPTL_VECTOR_H_INCLUDED # include "_stlimpl.h" // Notes: exception handling is bugged: // In case where an exception is thrown by a copy constructor while copying a range, // All destructors are not called correctly. namespace CppTL { template<class Item> class SmallMapBase { public: typedef unsigned int size_t; SmallMapBase() : data_( 0 ) , size_( 0 ) , capacity_( 0 ) { } SmallMapBase( Item *data, size_t size, size_t capacity ) : data_( data ) , size_( size ) , capacity_( capacity ) { } Item *data_; size_t size_; size_t capacity_; }; template<class T> class SmallMapIteratorBase { public: typedef unsigned int size_t; typedef int difference_type; typedef SmallMapIteratorBase<T> SelfType; typedef T Item; size_t index() const { CPPTL_ASSERT_MESSAGE( map_ != 0, "SmallMapIterator::index(): invalid iterator" ); return current_ - map_->data_; } bool operator ==( const SelfType &other ) const { return isEqual( other ); } bool operator !=( const SelfType &other ) const { return !isEqual( other ); } bool operator <( const SelfType &other ) const { return isLess( other ); } bool operator <=( const SelfType &other ) const { return !other.isLess( *this ); } bool operator >=( const SelfType &other ) const { return !isLess( other ); } bool operator >( const SelfType &other ) const { return other.isLess( *this ); } protected: SmallMapIteratorBase() : map_( 0 ) , current_( 0 ) { } SmallMapIteratorBase( const SmallMapBase<Item> &map, Item *current ) : map_( &map ) , current_( current ) { } T &deref() const { CPPTL_ASSERT_MESSAGE( current_ != 0, "SmallMapIterator: dereferencing invalid iterator" ); return *current_; } void increment() { CPPTL_ASSERT_MESSAGE( map_ && ( current_ < map_->data_ + map_->size_ ), "SmallMapIterator::increment: incrementing beyond end" ); ++current_; } void decrement() { CPPTL_ASSERT_MESSAGE( map_ && ( current_ > map_->data_ ), "SmallMapIterator::decrement: decrementing beyond beginning" ); --current_; } void advance( difference_type n ) { CPPTL_ASSERT_MESSAGE( map_ && map_->size_ && ( current_+n < map_->data_ + map_->size_ && current+n >= map_->data_), "SmallMapIterator::advance: advancing beyond end or beginning" ); current_ += n; } difference_type computeDistance( const SelfType &other ) const { CPPTL_ASSERT_MESSAGE( map_->data_ == other.map_->data_, "Comparing iterator on different container." ); return current_ - other.current_; } bool isEqual( const SmallMapIteratorBase &other ) const { return current_ == other.current_; } bool isLess( const SmallMapIteratorBase &other ) const { return current_ < other.current_; } protected: const SmallMapBase<Item> *map_; Item *current_; }; template<class T, class Traits> class SmallMapIterator : public SmallMapIteratorBase<T> { public: typedef unsigned int size_t; typedef int difference_type; typedef T value_type; typedef CPPTL_TYPENAME Traits::reference reference; typedef CPPTL_TYPENAME Traits::pointer pointer; typedef SmallMapIterator<T,Traits> SelfType; typedef SmallMapIteratorBase<T> SuperClass; typedef SmallMapIterator< T, ::CppTL::Impl::NonConstIteratorTraits<T> > NonConstSmallMapIterator; SmallMapIterator() { } // This constructor ensure that it is possible to construct a // const iterator from a non const iterator. SmallMapIterator( const NonConstSmallMapIterator &other ) : SuperClass( other ) { } SmallMapIterator( const SmallMapBase<Item> &map, Item *current ) : SuperClass( map, current ) { } SmallMapIterator( const SmallMapBase<Item> &map, size_t currentIndex ) : SuperClass( map, map.data_ + currentIndex ) { } SelfType &operator++() { increment(); return *this; } SelfType operator++( int ) { SelfType temp( *this ); ++*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType operator--( int ) { SelfType temp( *this ); --*this; return temp; } SelfType &operator +=( difference_type n ) { advance( n ); return *this; } SelfType operator +( difference_type n ) const { SelfType temp( *this ); return temp += n; } SelfType &operator -=( difference_type n ) { advance( -n ); return *this; } SelfType operator -( difference_type n ) const { SelfType temp( *this ); return temp -= n; } reference operator[]( difference_type n ) const { return *( *this + n ); } reference operator *() const { return deref(); } pointer operator->() const { return &deref(); } difference_type operator -( const SelfType &other ) const { return computeDistance( other ); } }; /// Store elements in a sorted vector. template< class Key , class Value , class PredLess = CppTL::LessPred<Key> , class Allocator = CppTL::MallocAllocator< Pair<Key,Value> > > class SmallMap : private SmallMapBase< Pair<Key,Value> > { public: typedef Pair<Key,Value> Item; typedef Item value_type; typedef Key key_type; typedef Value mapped_type; typedef SmallMapIterator<Item, ::CppTL::Impl::NonConstIteratorTraits<Item> > iterator; typedef SmallMapIterator<Item, ::CppTL::Impl::ConstIteratorTraits<Item> > const_iterator; typedef SmallMap<Key, Value, PredLess, Allocator> SelfType; typedef SmallMapBase< Pair<Key,Value> > SuperClass; SmallMap() { } SmallMap( const SmallMap &other ) : SuperClass( 0, other.size_, other.size_ ) , allocator_( other.allocator_ ) { data_ = allocator_.allocateArray( size_ ); CPPTL_TRY_BEGIN { ::CppTL::Impl::copy_with_construct( other.begin(), other.end(), data_ ); } CPPTL_TRY_END_CLEANUP( allocator.releaseArray( data_, size_ ) ) } ~SmallMap() { } SelfType &operator =( const SmallMap &other ) { SelfType temp( other ); swap( temp ); return *this; } size_t size() const { return size_; } const_iterator find( const Key &key ) const { Item *found = lookUp( key ); if ( found ) return const_iterator( *this, found ); return end(); } iterator find( const Key &key ) { Item *found = lookUp( key ); if ( found ) return iterator( *this, found ); return end(); } iterator lower_bound( const Key &key ) { size_t index = insertionIndex( key, 0 ); return iterator( *this, index ); } iterator upper_bound( const Key &key ) { size_t index = insertionIndex( key, 0 ); return iterator( *this, index ); } Pair<iterator,iterator> equal_range( const Key &key ) { size_t index = insertionIndex( key, 0 ); iterator it( *this, index ); return Pair<iterator,iterator>( it, it ); } const_iterator lower_bound( const Key &key ) const { size_t index = insertionIndex( key, 0 ); return const_iterator( *this, index ); } const_iterator upper_bound( const Key &key ) const { size_t index = insertionIndex( key, 0 ); return const_iterator( *this, index ); } Pair<const_iterator,const_iterator> equal_range( const Key &key ) const { size_t index = insertionIndex( key, 0 ); const_iterator it( *this, index ); return Pair<const_iterator,const_iterator>( it, it ); } void clear() { SelfType temp; swap( temp ); } iterator begin() { return iterator( *this, data_ ); } iterator end() { return iterator( *this, size_ ); } const_iterator begin() const { return const_iterator( *this, data_ ); } const_iterator end() const { return const_iterator( *this, size_ ); } size_t count( const Key &key ) const { return lookUp( key) ? 1 : 0; } bool empty() const { return size_ == 0; } // equal_range iterator erase( iterator where ) { CPPTL_ASSERT_MESSAGE( where >= begin() && where < end(), "SmallMap<T>::erase(): invalid iterator" ); ::CppTL::Impl::copy_and_destroy( where+1, end(), where ); --size_; return where; } iterator erase( iterator first, iterator last ) { size_t whereIndex = first.index(); size_t count = last - first; ::CppTL::Impl::copy_and_destroy( last, end(), first ); size_ -= count; return iterator( *this, whereIndex ); } iterator erase( const Key &key ) { Item *found = lookUp( key ); if ( found ) return erase( iterator( *this, found ) ); return end(); } Value &operator[]( const Key &key ) { typedef Pair<iterator,bool> ResultType; size_t whereIndex = insertionIndex( key, 0 ); if ( whereIndex < size_ && !less_( key, data_[whereIndex].first ) ) { return data_[whereIndex].second; } return doInsert( whereIndex, Item( key, Value() ) )->second; } Pair<iterator,bool> insert( const Item &item ) { typedef Pair<iterator,bool> ResultType; size_t whereIndex = insertionIndex( item.first, 0 ); if ( whereIndex < size_ && !less_( item.first, data_[whereIndex].first ) ) { return ResultType( iterator( *this, whereIndex ), false ); } return ResultType( doInsert( whereIndex, item ), true ); } iterator insert( iterator where, const Item &item ) { size_t whereIndex = insertionIndex( item.first, where.index() ); if ( size_ == capacity_ ) { if ( reserve( 1, whereIndex, &item ) ) // element was inserted when increasing capacity. return iterator( *this, whereIndex ); } ++size_; iterator itWhere( *this, whereIndex ); ::CppTL::Impl::copy_backwards_and_destroy( itWhere, end()-1, end() ); ::CppTL::Impl::construct( *itWhere, item ); return itWhere; } void insert( const_iterator first , const_iterator last ) { reserve( last - first ); iterator itHint = begin(); for ( ; first != last; ++first ) itHint = insert( itHint, *first ).first; } void swap( SelfType &other ) { CppTL::swap( data_, other.data_ ); CppTL::swap( size_, other.size_ ); CppTL::swap( capacity_, other.capacity_ ); allocator_.swap( other.allocator_ ); CppTL::swap( less_, other.less_ ); } bool operator <( const SelfType &other ) const { if ( size_ < other.size_ ) return true; if ( size_ > other.size_ || size_ == 0 ) return false; Item *i1 = data_, *i2 = other.data_; Item *i1end = data_ + size_; for ( ; i1 != i1end; ++i1, ++i2 ) { if ( itemIsLess( *i1, *i2 ) ) return true; if ( itemIsLess( *i2, *i1 ) ) return false; } return false; } bool operator ==( const SelfType &other ) const { if ( size_ != other.size_ ) return false; Item *i1 = data_, *i2 = other.data_; Item *i1end = data_ + size_; for ( ; i1 != i1end; ++i1, ++i2 ) { if ( itemIsLess( *i1, *i2 ) || itemIsLess( *i2, *i1 ) ) return false; } return true; } private: // Ensure capacity is large enough to add count elements. // Optionaly, insert a new item in the middle at position insertIndex. bool reserve( size_t count, size_t insertIndex = 0, const Item *item = 0) { if ( size_ + count <= capacity_ ) return false; const size_t initialCapacity = 8; const size_t minCapacityIncrement = 8; size_t newCapacity = size_ + count; newCapacity += CPPTL_MAX( newCapacity / 4, minCapacityIncrement ); newCapacity = CPPTL_MAX( initialCapacity, newCapacity ); Item *newData = allocator_.allocateArray( newCapacity ); CPPTL_TRY_BEGIN { if ( !item ) insertIndex = size_; ::CppTL::Impl::copy_and_destroy( begin(), begin() + insertIndex, newData ); if ( item ) { new (newData+insertIndex) Item( *item ); ::CppTL::Impl::copy_and_destroy( begin() + insertIndex, end(), newData + (insertIndex+1) ); } } CPPTL_TRY_END_CLEANUP( allocator_.release( newData, newCapacity ) ); if ( data_ ) allocator_.releaseArray( data_, capacity_ ); data_ = newData; capacity_ = newCapacity; if ( item ) ++size_; return true; } size_t insertionIndex( const Key &key, size_t min = 0 ) const { size_t max = size_; while ( min != max ) { size_t mid = (max+min) / 2; if ( less_( data_[mid].first, key ) ) min = mid + 1; else max = mid; } return min; } Item *lookUp( const Key &key ) const { size_t pos = insertionIndex( key, 0 ); if ( pos < size_ && !less_( key, data_[pos].first ) ) return data_ + pos; return 0; } iterator doInsert( size_t whereIndex, const Item &item ) { if ( size_ == capacity_ ) { if ( reserve( 1, whereIndex, &item ) ) // element was inserted when increasing capacity. return begin() + whereIndex; } ++size_; iterator itWhere( *this, whereIndex ); iterator itEnd = end(); if ( whereIndex != size_ - 1 ) ::CppTL::Impl::copy_backwards_and_destroy( itWhere, itEnd-1, itEnd ); ::CppTL::Impl::construct( *itWhere, item); return itWhere; } bool itemIsLess( const Item &a, const Item &b ) const { return less_( a.first, b.first ) || ( !less_(b.first, a.first) && a.second < b.second ); } private: Allocator allocator_; PredLess less_; }; } // namespace CppTL #endif // CPPTL_VECTOR_H_INCLUDED Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/forwards.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** forwards.h 20 Jul 2005 21:06:49 -0000 1.6 --- forwards.h 5 Jun 2006 12:02:56 -0000 1.7 *************** *** 44,48 **** --- 44,53 ---- class SharedPtr; + // _stlimpl.h + template<class T> + class MallocAllocator; + template<class T> + struct LessPred; } // namespace CppTL |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:32:15
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20596/src/cpputtest Modified Files: SConscript main.cpp Log Message: * added CppTL:SmallMap, a std::map like container that use a sorted vector to hold item. Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/main.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** main.cpp 11 Nov 2005 20:54:15 -0000 1.26 --- main.cpp 5 Jun 2006 12:02:56 -0000 1.27 *************** *** 8,11 **** --- 8,12 ---- #include "registrytest.h" #include "testfixturetest.h" + #include "smallmaptest.h" //#include "formattest.h" *************** *** 110,113 **** --- 111,115 ---- allSuite->add( AssertEnumTest::suite() ); allSuite->add( ReflectionTest::suite() ); + allSuite->add( SmallMapTest::suite() ); // allSuite->add( FormatTest::suite() ); // allSuite->add( CommandLineOptionsTest::suite() ); Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/SConscript,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SConscript 11 Nov 2005 20:54:15 -0000 1.15 --- SConscript 5 Jun 2006 12:02:56 -0000 1.16 *************** *** 7,10 **** --- 7,11 ---- main.cpp registrytest.cpp + smallmaptest.cpp testbasicassertion.cpp testexceptionguard.cpp |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:32:14
|
Update of /cvsroot/cppunit/cppunit2/src/opentest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22211/src/opentest Modified Files: sharedmemorytransport.cpp Log Message: * a bit of clean-up Index: sharedmemorytransport.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentest/sharedmemorytransport.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sharedmemorytransport.cpp 11 Mar 2006 11:46:25 -0000 1.11 --- sharedmemorytransport.cpp 5 Jun 2006 12:05:57 -0000 1.12 *************** *** 849,852 **** --- 849,853 ---- CppTL::Mutex::ScopedLockGuard guard( messagesToDispatchLock_ ); + OPENTEST_SHMEM_LOG( "Pushing %d unserialized messages messagesToDispatch_ queue.", int(messages.size()) ); messagesToDispatch_.insert( messagesToDispatch_.end(), messages.begin(), |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:32:13
|
Update of /cvsroot/cppunit/cppunit2/devtools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10345/devtools Log Message: Directory /cvsroot/cppunit/cppunit2/devtools added to the repository |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:32:13
|
Update of /cvsroot/cppunit/cppunit2/scons-tools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10384/scons-tools Log Message: Directory /cvsroot/cppunit/cppunit2/scons-tools added to the repository |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:53
|
Update of /cvsroot/cppunit/cppunit2/src/jsontestrunner In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23953/src/jsontestrunner Log Message: Directory /cvsroot/cppunit/cppunit2/src/jsontestrunner added to the repository |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:52
|
Update of /cvsroot/cppunit/cppunit2/src/cpptl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/src/cpptl Modified Files: json_reader.cpp json_value.cpp Log Message: - synchronized with lastest jsoncpp. Index: json_value.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpptl/json_value.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** json_value.cpp 9 Nov 2005 23:16:05 -0000 1.2 --- json_value.cpp 5 Jun 2006 13:22:58 -0000 1.3 *************** *** 7,13 **** --- 7,15 ---- # include <cpptl/enumerator.h> #endif + #include <stddef.h> // size_t #define JSON_ASSERT_UNREACHABLE assert( false ) #define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw + #define JSON_ASSERT_MESSAGE( condition, message ) assert( condition && message ); // @todo <= change this into an exception throw namespace Json { *************** *** 18,21 **** --- 20,187 ---- const Value::UInt Value::maxUInt = Value::UInt(-1); + // A "safe" implementation of strdup. Allow null pointer to be passed. + // Also avoid warning on msvc80. + + inline char *safeStringDup( const char *czstring ) + { + if ( czstring ) + { + const size_t length = (unsigned int)( strlen(czstring) + 1 ); + char *newString = static_cast<char *>( malloc( length ) ); + memcpy( newString, czstring, length ); + return newString; + } + return 0; + } + + inline char *safeStringDup( const std::string &str ) + { + if ( !str.empty() ) + { + const size_t length = str.length(); + char *newString = static_cast<char *>( malloc( length + 1 ) ); + memcpy( newString, str.c_str(), length ); + newString[length] = 0; + return newString; + } + return 0; + } + + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class ValueIteratorBase + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + + ValueIteratorBase::ValueIteratorBase() + { + } + + + ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) + : current_( current ) + { + } + + + Value & + ValueIteratorBase::deref() const + { + return current_->second; + } + + + void + ValueIteratorBase::increment() + { + ++current_; + } + + + void + ValueIteratorBase::decrement() + { + --current_; + } + + + ValueIteratorBase::difference_type + ValueIteratorBase::computeDistance( const SelfType &other ) const + { + # ifdef JSON_USE_CPPTL_SMALLMAP + return current_ - other.current_; + # else + return difference_type( std::distance( current_, other.current_ ) ); + # endif + } + + + bool + ValueIteratorBase::isEqual( const SelfType &other ) const + { + return current_ == other.current_; + } + + + void + ValueIteratorBase::copy( const SelfType &other ) + { + current_ = other.current_; + } + + + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class ValueConstIterator + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + + ValueConstIterator::ValueConstIterator() + { + } + + + ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) + : ValueIteratorBase( current ) + { + } + + ValueConstIterator & + ValueConstIterator::operator =( const ValueIteratorBase &other ) + { + copy( other ); + return *this; + } + + + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class ValueIterator + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + + ValueIterator::ValueIterator() + { + } + + + ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) + : ValueIteratorBase( current ) + { + } + + ValueIterator::ValueIterator( const ValueConstIterator &other ) + : ValueIteratorBase( other ) + { + } + + ValueIterator::ValueIterator( const ValueIterator &other ) + : ValueIteratorBase( other ) + { + } + + ValueIterator & + ValueIterator::operator =( const SelfType &other ) + { + copy( other ); + return *this; + } + + + + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class Value::CommentInfo + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + Value::CommentInfo::CommentInfo() *************** *** 36,43 **** if ( comment_ ) free( comment_ ); ! comment_ = text ? strdup( text ) : 0; } // Notes: index_ indicates if the string was allocated when --- 202,216 ---- if ( comment_ ) free( comment_ ); ! comment_ = safeStringDup( text ); } + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class Value::CZString + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// // Notes: index_ indicates if the string was allocated when *************** *** 51,55 **** Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) ! : cstr_( allocate == duplicate ? strdup(cstr) : cstr ) , index_( allocate ) { --- 224,228 ---- Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) ! : cstr_( allocate == duplicate ? safeStringDup(cstr) : cstr ) , index_( allocate ) { *************** *** 57,61 **** Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? strdup( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) --- 230,234 ---- Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? safeStringDup( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) *************** *** 66,70 **** Value::CZString::~CZString() { ! if ( index_ == duplicate ) free( const_cast<char *>( cstr_ ) ); } --- 239,243 ---- Value::CZString::~CZString() { ! if ( cstr_ && index_ == duplicate ) free( const_cast<char *>( cstr_ ) ); } *************** *** 116,119 **** --- 289,299 ---- + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // class Value::Value + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// + // ////////////////////////////////////////////////////////////////// *************** *** 121,124 **** --- 301,305 ---- : type_( type ) , comments_( 0 ) + , allocated_( 0 ) { switch ( type ) *************** *** 173,186 **** Value::Value( const char *value ) : type_( stringValue ) , comments_( 0 ) { ! value_.string_ = value ? strdup( value ) : 0; } Value::Value( const std::string &value ) : type_( stringValue ) , comments_( 0 ) { ! value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); } --- 354,369 ---- Value::Value( const char *value ) : type_( stringValue ) + , allocated_( true ) , comments_( 0 ) { ! value_.string_ = safeStringDup( value ); } Value::Value( const std::string &value ) : type_( stringValue ) + , allocated_( true ) , comments_( 0 ) { ! value_.string_ = safeStringDup( value ); } *************** *** 188,194 **** Value::Value( const CppTL::ConstString &value ) : type_( stringValue ) , comments_( 0 ) { ! value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); } # endif --- 371,378 ---- Value::Value( const CppTL::ConstString &value ) : type_( stringValue ) + , allocated_( true ) , comments_( 0 ) { ! value_.string_ = safeStringDup( value ); } # endif *************** *** 217,221 **** case stringValue: if ( other.value_.string_ ) ! value_.string_ = strdup( other.value_.string_ ); else value_.string_ = 0; --- 401,408 ---- case stringValue: if ( other.value_.string_ ) ! { ! value_.string_ = safeStringDup( other.value_.string_ ); ! allocated_ = true; ! } else value_.string_ = 0; *************** *** 253,257 **** break; case stringValue: ! free( value_.string_ ); break; case arrayValue: --- 440,445 ---- break; case stringValue: ! if ( allocated_ ) ! free( value_.string_ ); break; case arrayValue: *************** *** 278,283 **** Value::swap( Value &other ) { ! std::swap( type_, other.type_ ); std::swap( value_, other.value_ ); } --- 466,476 ---- Value::swap( Value &other ) { ! ValueType temp = type_; ! type_ = other.type_; ! other.type_ = temp; std::swap( value_, other.value_ ); + bool temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; } *************** *** 984,987 **** --- 1177,1242 ---- + Value::const_iterator + Value::begin() const + { + switch ( type_ ) + { + case arrayValue: + case objectValue: + if ( value_.map_ ) + return const_iterator( value_.map_->begin() ); + // fall through default if no valid map + default: + return const_iterator(); + } + } + + Value::const_iterator + Value::end() const + { + switch ( type_ ) + { + case arrayValue: + case objectValue: + if ( value_.map_ ) + return const_iterator( value_.map_->end() ); + // fall through default if no valid map + default: + return const_iterator(); + } + } + + + Value::iterator + Value::begin() + { + switch ( type_ ) + { + case arrayValue: + case objectValue: + if ( value_.map_ ) + return iterator( value_.map_->begin() ); + // fall through default if no valid map + default: + return iterator(); + } + } + + Value::iterator + Value::end() + { + switch ( type_ ) + { + case arrayValue: + case objectValue: + if ( value_.map_ ) + return iterator( value_.map_->end() ); + // fall through default if no valid map + default: + return iterator(); + } + } + + // class PathArgument // ////////////////////////////////////////////////////////////////// Index: json_reader.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpptl/json_reader.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** json_reader.cpp 1 Feb 2006 18:26:16 -0000 1.2 --- json_reader.cpp 5 Jun 2006 13:22:58 -0000 1.3 *************** *** 47,54 **** bool collectComments ) { - collectComments_ = collectComments; document_ = document; ! begin_ = document_.c_str(); ! end_ = begin_ + document_.length(); current_ = begin_; lastValueEnd_ = 0; --- 47,64 ---- bool collectComments ) { document_ = document; ! const char *begin = document_.c_str(); ! const char *end = begin + document_.length(); ! return parse( begin, end, root, collectComments ); ! } ! ! bool ! Reader::parse( const char *beginDoc, const char *endDoc, ! Value &root, ! bool collectComments ) ! { ! begin_ = beginDoc; ! end_ = endDoc; ! collectComments_ = collectComments; current_ = begin_; lastValueEnd_ = 0; |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:33
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/src/cpput Modified Files: exceptionguard.cpp testinfo.cpp Log Message: - synchronized with lastest jsoncpp. Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** testinfo.cpp 11 Nov 2005 20:54:15 -0000 1.20 --- testinfo.cpp 5 Jun 2006 13:22:58 -0000 1.21 *************** *** 463,467 **** void log( const CppTL::ConstString &log ) { ! TestInfo::threadInstance().log( log ); } --- 463,467 ---- void log( const CppTL::ConstString &log ) { ! TestInfo::threadInstance().log( log.c_str() ); } Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** exceptionguard.cpp 13 Nov 2005 10:12:01 -0000 1.10 --- exceptionguard.cpp 5 Jun 2006 13:22:58 -0000 1.11 *************** *** 91,95 **** fault.setMessages( messages ); fault.setTestDataType( "unexpected-exception-fault" ); ! fault.setTestData( "expection-type", exceptionType ); fault.setTestData( "expection-message", what ); TestInfo::threadInstance().handleUnexpectedException( fault ); --- 91,95 ---- fault.setMessages( messages ); fault.setTestDataType( "unexpected-exception-fault" ); ! fault.setTestData( "expection-type", exceptionType.c_str() ); fault.setTestData( "expection-message", what ); TestInfo::threadInstance().handleUnexpectedException( fault ); |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:32
|
Update of /cvsroot/cppunit/cppunit2/src/opentesttest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/src/opentesttest Modified Files: mockhelper.h remoteinterfacestest.cpp Log Message: - synchronized with lastest jsoncpp. Index: mockhelper.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentesttest/mockhelper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mockhelper.h 8 Nov 2005 20:25:50 -0000 1.3 --- mockhelper.h 5 Jun 2006 13:22:58 -0000 1.4 *************** *** 104,113 **** const Json::Value &> comparator; CppUT::RefStringizer<const Json::Value &> stringizer; ! CppUT::checkCustomHeterogeneousSequenceEqual( expectations_.enumValues(), ! actuals_.enumValues(), ! stringizer, ! stringizer, ! comparator, ! message ); clearEvents(); recordExpectedEvents(); --- 104,115 ---- const Json::Value &> comparator; CppUT::RefStringizer<const Json::Value &> stringizer; ! ! CppUT::checkCustomHeterogeneousSequenceEqual( ! CppTL::Enum::range( expectations_.begin(), expectations_.end(), CppTL::Type<const Json::Value &>() ), ! CppTL::Enum::range( actuals_.begin(), actuals_.end(), CppTL::Type<const Json::Value &>() ), ! stringizer, ! stringizer, ! comparator, ! message ); clearEvents(); recordExpectedEvents(); Index: remoteinterfacestest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentesttest/remoteinterfacestest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** remoteinterfacestest.cpp 11 Dec 2005 17:16:09 -0000 1.4 --- remoteinterfacestest.cpp 5 Jun 2006 13:22:58 -0000 1.5 *************** *** 40,44 **** virtual void runTests( const OpenTest::TestPlans &plan ) { ! logEvent( OpenTest::String("runTests( " + CppTL::toString( plan.testPlans_.size() ) + ")") ); } --- 40,44 ---- virtual void runTests( const OpenTest::TestPlans &plan ) { ! logEvent( OpenTest::String("runTests( " + CppTL::toString( plan.testPlans_.size() ) + ")").c_str() ); } |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:31
|
Update of /cvsroot/cppunit/cppunit2/include/json In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/include/json Modified Files: config.h forwards.h reader.h value.h writer.h Log Message: - synchronized with lastest jsoncpp. Index: config.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/config.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.h 7 Nov 2005 22:43:07 -0000 1.1 --- config.h 5 Jun 2006 13:22:58 -0000 1.2 *************** *** 3,10 **** /// If defined, indicates that json library is embedded in CppTL library. ! # define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library ! # define JSON_USE_CPPTL 1 --- 3,11 ---- /// If defined, indicates that json library is embedded in CppTL library. ! //# define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library ! //# define JSON_USE_CPPTL 1 ! //# define JSON_USE_CPPTL_SMALLMAP 1 Index: value.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/value.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** value.h 7 Nov 2005 22:43:07 -0000 1.1 --- value.h 5 Jun 2006 13:22:58 -0000 1.2 *************** *** 4,10 **** # include "forwards.h" # include <string> - # include <map> # include <vector> # ifdef JSON_USE_CPPTL # include <cpptl/forwards.h> --- 4,14 ---- # include "forwards.h" # include <string> # include <vector> + # ifndef JSON_USE_CPPTL_SMALLMAP + # include <map> + # else + # include <cpptl/smallmap.h> + # endif # ifdef JSON_USE_CPPTL # include <cpptl/forwards.h> *************** *** 13,18 **** namespace Json { - class Value; - /** \brief Type of the value held by a Value object. */ --- 17,20 ---- *************** *** 75,78 **** --- 77,82 ---- typedef int Int; typedef unsigned int UInt; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; static const Value null; *************** *** 80,84 **** --- 84,121 ---- static const Int maxInt; static const UInt maxUInt; + private: + class CZString + { + public: + enum DuplicationPolicy + { + noDuplication = 0, + duplicate, + duplicateOnCopy + }; + CZString( int index ); + CZString( const char *cstr, DuplicationPolicy allocate ); + CZString( const CZString &other ); + ~CZString(); + CZString &operator =( const CZString &other ); + bool operator<( const CZString &other ) const; + bool operator==( const CZString &other ) const; + int index() const; + const char *c_str() const; + private: + void swap( CZString &other ); + const char *cstr_; + int index_; + }; + + public: + # ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map<CZString, Value> ObjectValues; + # else + typedef CppTL::SmallMap<CZString, Value> ObjectValues; + # endif + + public: Value( ValueType type = nullValue ); Value( Int value ); *************** *** 209,212 **** --- 246,255 ---- std::string toStyledString() const; + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + private: struct CommentInfo *************** *** 220,248 **** }; - struct CZString - { - enum DuplicationPolicy - { - noDuplication = 0, - duplicate, - duplicateOnCopy - }; - CZString( int index ); - CZString( const char *cstr, DuplicationPolicy allocate ); - CZString( const CZString &other ); - ~CZString(); - CZString &operator =( const CZString &other ); - bool operator<( const CZString &other ) const; - bool operator==( const CZString &other ) const; - int index() const; - const char *c_str() const; - private: - void swap( CZString &other ); - const char *cstr_; - int index_; - }; - - typedef std::map<CZString, Value> ObjectValues; - struct MemberNamesTransform { --- 263,266 ---- *************** *** 263,271 **** ObjectValues *map_; } value_; ! ValueType type_; CommentInfo *comments_; }; /** \brief Experimental and untested: represents an element of the "path" to access a node. */ --- 281,440 ---- ObjectValues *map_; } value_; ! ValueType type_ : 8; ! bool allocated_ : 1; CommentInfo *comments_; }; + /** \brief Experimental and untested: base class for Value iterators. + * + */ + class ValueIteratorBase + { + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; + + ValueIteratorBase(); + explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); + + bool operator ==( const SelfType &other ) const + { + return isEqual( other ); + } + + bool operator !=( const SelfType &other ) const + { + return !isEqual( other ); + } + + difference_type operator -( const SelfType &other ) const + { + return computeDistance( other ); + } + + protected: + Value &deref() const; + + void increment(); + + void decrement(); + + difference_type computeDistance( const SelfType &other ) const; + + bool isEqual( const SelfType &other ) const; + + void copy( const SelfType &other ); + + private: + Value::ObjectValues::iterator current_; + }; + + /** \brief Experimental and untested: const iterator for object and array value. + * + */ + class ValueConstIterator : public ValueIteratorBase + { + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef const Value &reference; + typedef const Value *pointer; + typedef ValueConstIterator SelfType; + + ValueConstIterator(); + /*! \internal Use by Value to create an iterator. + */ + explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); + SelfType &operator =( const ValueIteratorBase &other ); + + SelfType operator++( int ) + { + SelfType temp( *this ); + ++*this; + return temp; + } + + SelfType operator--( int ) + { + SelfType temp( *this ); + --*this; + return temp; + } + + SelfType &operator--() + { + decrement(); + return *this; + } + + SelfType &operator++() + { + increment(); + return *this; + } + + reference operator *() const + { + return deref(); + } + }; + + + /** \brief Experimental and untested: iterator for object and array value. + */ + class ValueIterator : public ValueIteratorBase + { + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef Value &reference; + typedef Value *pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator( const ValueConstIterator &other ); + ValueIterator( const ValueIterator &other ); + /*! \internal Use by Value to create an iterator. + */ + explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); + + SelfType &operator =( const SelfType &other ); + + SelfType operator++( int ) + { + SelfType temp( *this ); + ++*this; + return temp; + } + + SelfType operator--( int ) + { + SelfType temp( *this ); + --*this; + return temp; + } + + SelfType &operator--() + { + decrement(); + return *this; + } + + SelfType &operator++() + { + increment(); + return *this; + } + + reference operator *() const + { + return deref(); + } + }; + + + /** \brief Experimental and untested: represents an element of the "path" to access a node. */ Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/forwards.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forwards.h 7 Nov 2005 22:43:07 -0000 1.1 --- forwards.h 5 Jun 2006 13:22:58 -0000 1.2 *************** *** 7,15 **** class FastWriter; - class Path; - class PathArgument; class Reader; class StyledWriter; class Value; } // namespace Json --- 7,20 ---- class FastWriter; class Reader; class StyledWriter; + + // value.h + class Path; + class PathArgument; class Value; + class ValueIteratorBase; + class ValueIterator; + class ValueConstIterator; } // namespace Json Index: reader.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/reader.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reader.h 7 Nov 2005 22:43:07 -0000 1.1 --- reader.h 5 Jun 2006 13:22:58 -0000 1.2 *************** *** 5,9 **** # include "value.h" # include <deque> - # include <map> # include <stack> # include <string> --- 5,8 ---- *************** *** 37,40 **** --- 36,51 ---- bool collectComments = true ); + /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them back during + * serialization, \c false to discard comments. + * \return \c true if the document was successfully parsed, \c false if an error occurred. + */ + bool parse( const char *beginDoc, const char *endDoc, + Value &root, + bool collectComments = true ); + /** \brief Returns a user friendly string that list errors in the parsed document. * \return Formatted error message with the list of errors with their location in Index: writer.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/writer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** writer.h 7 Nov 2005 22:43:07 -0000 1.1 --- writer.h 5 Jun 2006 13:22:58 -0000 1.2 *************** *** 3,7 **** # include "value.h" ! # include <deque> # include <string> --- 3,7 ---- # include "value.h" ! # include <vector> # include <string> |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:31:06
|
Update of /cvsroot/cppunit/cppunit/devtools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15857/devtools Added Files: cvs-root-update.py Log Message: * added simple script to update cvs root (handle new sourceforge cvs server naming) --- NEW FILE: cvs-root-update.py --- # Explore directory recursively and replace cvs root for access by the specified developper. # Put together by a newbie to python, use at your own risk! import os import sys def updateCVSRoot( developper, dirName, fileNames ): print "Exploring: ", os.path.abspath( dirName ) if ( fileNames.count( 'Root' ) > 0 ) and os.path.basename(dirName) == 'CVS': cvsroot_path = os.path.join( dirName, 'Root' ) new_root = ':ext:%s...@cp...:/cvsroot/cppunit' % developper file( cvsroot_path, 'wt' ).write( new_root ) print 'Updated:', cvsroot_path if __name__ == '__main__': developper = sys.argv[1] os.path.walk( ".", updateCVSRoot, developper ) |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:07:44
|
Update of /cvsroot/cppunit/cppunit2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13273 Modified Files: .cvsignore sconstruct Log Message: * added doc and doc-dist target to generate doc and doc tarball. Index: sconstruct =================================================================== RCS file: /cvsroot/cppunit/cppunit2/sconstruct,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** sconstruct 5 Jun 2006 13:22:57 -0000 1.27 --- sconstruct 5 Jun 2006 14:03:23 -0000 1.28 *************** *** 2,5 **** --- 2,10 ---- import os.path + CPPUNIT_VERSION = '0.1' + DIST_DIR = '#dist' + + + options = Options() ##options.Add( 'platform', 'platform used to build cppunit 2: suncc, vacpp, mingw, msvc6, msvc7, msvc71, msvc80, linux-gcc', 'mingw' ) *************** *** 18,21 **** --- 23,27 ---- print "Building using PLATFORM =", platform + rootbuild_dir = Dir('#buildscons') build_dir = os.path.join( '#buildscons', platform ) bin_dir = os.path.join( '#bin', platform ) *************** *** 32,36 **** env = Environment( ENV = {'PATH' : os.environ['PATH']}, ! tools=[] ) #, tools=['default'] ) if platform == 'suncc': --- 38,43 ---- env = Environment( ENV = {'PATH' : os.environ['PATH']}, ! toolpath = ['scons-tools'], ! tools=['doxygen', 'srcdist', 'substinfile', 'targz'] ) if platform == 'suncc': *************** *** 80,84 **** LIBPATH = lib_dir ) env.Append( CPPDEFINES = [ "CPPTL_NO_AUTOLINK" ] ) # naming convention are not respected ! env_testing = env.Copy( ) env_testing.Append( LIBS = ['cpput','opentest','cpptl'] ) --- 87,94 ---- LIBPATH = lib_dir ) env.Append( CPPDEFINES = [ "CPPTL_NO_AUTOLINK" ] ) # naming convention are not respected ! env['CPPUNIT_VERSION'] = CPPUNIT_VERSION ! env['BUILD_DIR'] = env.Dir(build_dir) ! env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir) ! env['DIST_DIR'] = DIST_DIR env_testing = env.Copy( ) env_testing.Append( LIBS = ['cpput','opentest','cpptl'] ) *************** *** 153,154 **** --- 163,165 ---- #buildProjectInDirectory( 'src/qttestdriver' ) buildProjectInDirectory( 'test/shmem_test' ) + buildProjectInDirectory( 'doc' ) Index: .cvsignore =================================================================== RCS file: /cvsroot/cppunit/cppunit2/.cvsignore,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** .cvsignore 5 Jun 2006 13:22:57 -0000 1.6 --- .cvsignore 5 Jun 2006 14:03:23 -0000 1.7 *************** *** 7,8 **** --- 7,9 ---- dependencies env.bat + dist |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:07:42
|
Update of /cvsroot/cppunit/cppunit2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100 Modified Files: .cvsignore sconstruct Log Message: - synchronized with lastest jsoncpp. Index: sconstruct =================================================================== RCS file: /cvsroot/cppunit/cppunit2/sconstruct,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** sconstruct 5 Jun 2006 12:02:56 -0000 1.26 --- sconstruct 5 Jun 2006 13:22:57 -0000 1.27 *************** *** 96,99 **** --- 96,100 ---- buildCppUnitExample = buildExample + buildJSONTests = buildExample def buildLibary( env, target_sources, target_name ): *************** *** 127,131 **** env.Install( bin_dir, exe ) ! Export( 'env env_testing env_cpptl buildExample buildCppUnitExample buildLibary buildLibraryUnitTest buildQTApplication' ) def buildProjectInDirectory( target_directory ): --- 128,132 ---- env.Install( bin_dir, exe ) ! Export( 'env env_testing env_cpptl buildExample buildCppUnitExample buildLibary buildLibraryUnitTest buildQTApplication buildJSONTests' ) def buildProjectInDirectory( target_directory ): Index: .cvsignore =================================================================== RCS file: /cvsroot/cppunit/cppunit2/.cvsignore,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .cvsignore 8 Aug 2005 22:11:14 -0000 1.5 --- .cvsignore 5 Jun 2006 13:22:57 -0000 1.6 *************** *** 6,7 **** --- 6,8 ---- gcc-options.txt dependencies + env.bat |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:06:00
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13273/doc Added Files: doxyfile.in Removed Files: doxyfile Log Message: * added doc and doc-dist target to generate doc and doc tarball. --- doxyfile DELETED --- --- NEW FILE: doxyfile.in --- # Doxyfile 1.4.3 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "CppUnit 2" PROJECT_NUMBER = %CPPUNIT_VERSION% OUTPUT_DIRECTORY = %DOC_TOPDIR% OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the FULL_PATH_NAMES = YES STRIP_FROM_PATH = %TOPDIR% STRIP_FROM_INC_PATH = %TOPDIR%/include JAVADOC_AUTOBRIEF = YES INHERIT_DOCS = YES TAB_SIZE = 3 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = YES GENERATE_TODOLIST = YES GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = cppunit2-doxygen-warning.log #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput ./fake_stl . # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h testrunner.h reflectionimpl10.h thread.cpp EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = cppunit2-doc-html-%CPPUNIT_VERSION% HTML_FILE_EXTENSION = .html HTML_HEADER = header.html HTML_FOOTER = footer.html #HTML_STYLESHEET = #HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = cppunit2.chm HHC_LOCATION = "c:\Program Files\HTML Help Workshop\hhc.exe" GENERATE_CHI = YES BINARY_TOC = YES TOC_EXPAND = YES DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = YES TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = ../include INCLUDE_FILE_PATTERNS = *.h PREDEFINED = "_MSC_VER=1400" \ _CPPRTTI _WIN32 EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = YES TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = D:\wut\prg\Graphwiz\Graphviz\bin\dot.exe DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO |
From: Baptiste L. <bl...@us...> - 2006-06-06 03:05:54
|
Update of /cvsroot/cppunit/cppunit2/scons-tools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/scons-tools Added Files: doxygen.py srcdist.py substinfile.py targz.py Log Message: - synchronized with lastest jsoncpp. --- NEW FILE: doxygen.py --- import os import os.path import glob from fnmatch import fnmatch def DoxyfileParse(file_contents): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ data = {} import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno last_backslash_lineno = lineno token = lex.get_token() key = token # the first token should be a key last_token = "" key_token = False next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: key = token key_token = False else: if token == "+=": if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]: continue if len(v) == 1: data[k] = v[0] return data def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] data = DoxyfileParse(node.get_contents()) if data.get("RECURSIVE", "NO") == "YES": recursive = True else: recursive = False file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for node in data.get("INPUT", []): if os.path.isfile(node): sources.add(node) elif os.path.isdir(node): if recursive: for root, dirs, files in os.walk(node): for f in files: filename = os.path.join(root, f) pattern_check = reduce(lambda x, y: x or bool(fnmatch(filename, y)), file_patterns, False) exclude_check = reduce(lambda x, y: x and fnmatch(filename, y), exclude_patterns, True) if pattern_check and not exclude_check: sources.append(filename) else: for pattern in file_patterns: sources.extend(glob.glob("/".join([node, pattern]))) sources = map( lambda path: env.File(path), sources ) return sources def DoxySourceScanCheck(node, env): """Check if we should scan this file""" return os.path.isfile(node.path) def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents()) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) ) # don't clobber targets for node in targets: env.Precious(node) # set up cleaning stuff for node in targets: env.Clean(node, node) return (targets, source) def generate(env): """ Add builders and construction variables for the Doxygen tool. This is currently for Doxygen 1.4.6. """ doxyfile_scanner = env.Scanner( DoxySourceScan, "DoxySourceScan", scan_check = DoxySourceScanCheck, ) doxyfile_builder = env.Builder( action = env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}"), emitter = DoxyEmitter, target_factory = env.fs.Entry, single_source = True, source_scanner = doxyfile_scanner, ) env.Append(BUILDERS = { 'Doxygen': doxyfile_builder, }) env.AppendUnique( DOXYGEN = 'doxygen', ) def exists(env): """ Make sure doxygen exists. """ return env.Detect("doxygen") --- NEW FILE: targz.py --- """tarball Tool-specific initialization for tarball. """ ## Commands to tackle a command based implementation: ##to unpack on the fly... ##gunzip < FILE.tar.gz | tar xvf - ##to pack on the fly... ##tar cvf - FILE-LIST | gzip -c > FILE.tar.gz import os.path import SCons.Builder import SCons.Node.FS import SCons.Util try: import gzip import tarfile internal_targz = 1 except ImportError: internal_targz = 0 TARGZ_DEFAULT_COMPRESSION_LEVEL = 9 if internal_targz: def targz(target, source, env): def archive_name( path ): path = os.path.normpath( os.path.abspath( path ) ) common_path = os.path.commonprefix( (base_dir, path) ) archive_name = path[len(common_path):] return archive_name def visit(tar, dirname, names): for name in names: path = os.path.join(dirname, name) if os.path.isfile(path): tar.add(path, archive_name(path) ) compression = env.get('TARGZ_COMPRESSION_LEVEL',TARGZ_DEFAULT_COMPRESSION_LEVEL) base_dir = os.path.normpath( env.get('TARGZ_BASEDIR', env.Dir('.')).abspath ) target_path = str(target[0]) fileobj = gzip.GzipFile( target_path, 'wb', compression ) tar = tarfile.TarFile(os.path.splitext(target_path)[0], 'w', fileobj) for source in source: source_path = str(source) if source.isdir(): os.path.walk(source_path, visit, tar) else: tar.add(source_path, archive_name(source_path) ) # filename, arcname tar.close() targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR']) def makeBuilder( emitter = None ): return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'), source_factory = SCons.Node.FS.Entry, source_scanner = SCons.Defaults.DirScanner, suffix = '$TARGZ_SUFFIX', multi = 1) TarGzBuilder = makeBuilder() def generate(env): """Add Builders and construction variables for zip to an Environment. The following environnement variables may be set: TARGZ_COMPRESSION_LEVEL: integer, [0-9]. 0: no compression, 9: best compression (same as gzip compression level). TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative to something other than top-dir). """ env['BUILDERS']['TarGz'] = TarGzBuilder env['TARGZ_COM'] = targzAction env['TARGZ_COMPRESSION_LEVEL'] = TARGZ_DEFAULT_COMPRESSION_LEVEL # range 0-9 env['TARGZ_SUFFIX'] = '.tar.gz' env['TARGZ_BASEDIR'] = env.Dir('.') # Sources archive name are made relative to that directory. def exists(env): return internal_targz --- NEW FILE: srcdist.py --- import os import os.path import glob from fnmatch import fnmatch import targz ##def DoxyfileParse(file_contents): ## """ ## Parse a Doxygen source file and return a dictionary of all the values. ## Values will be strings and lists of strings. ## """ ## data = {} ## ## import shlex ## lex = shlex.shlex(instream = file_contents, posix = True) ## lex.wordchars += "*+./-:" ## lex.whitespace = lex.whitespace.replace("\n", "") ## lex.escape = "" ## ## lineno = lex.lineno ## last_backslash_lineno = lineno ## token = lex.get_token() ## key = token # the first token should be a key ## last_token = "" ## key_token = False ## next_key = False ## new_data = True ## ## def append_data(data, key, new_data, token): ## if new_data or len(data[key]) == 0: ## data[key].append(token) ## else: ## data[key][-1] += token ## ## while token: ## if token in ['\n']: ## if last_token not in ['\\']: ## key_token = True ## elif token in ['\\']: ## pass ## elif key_token: ## key = token ## key_token = False ## else: ## if token == "+=": ## if not data.has_key(key): ## data[key] = list() ## elif token == "=": ## data[key] = list() ## else: ## append_data( data, key, new_data, token ) ## new_data = True ## ## last_token = token ## token = lex.get_token() ## ## if last_token == '\\' and token != '\n': ## new_data = False ## append_data( data, key, new_data, '\\' ) ## ## # compress lists of len 1 into single strings ## for (k, v) in data.items(): ## if len(v) == 0: ## data.pop(k) ## ## # items in the following list will be kept as lists and not converted to strings ## if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]: ## continue ## ## if len(v) == 1: ## data[k] = v[0] ## ## return data ## ##def DoxySourceScan(node, env, path): ## """ ## Doxygen Doxyfile source scanner. This should scan the Doxygen file and add ## any files used to generate docs to the list of source files. ## """ ## default_file_patterns = [ ## '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', ## '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', ## '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', ## '*.py', ## ] ## ## default_exclude_patterns = [ ## '*~', ## ] ## ## sources = [] ## ## data = DoxyfileParse(node.get_contents()) ## ## if data.get("RECURSIVE", "NO") == "YES": ## recursive = True ## else: ## recursive = False ## ## file_patterns = data.get("FILE_PATTERNS", default_file_patterns) ## exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) ## ## for node in data.get("INPUT", []): ## if os.path.isfile(node): ## sources.add(node) ## elif os.path.isdir(node): ## if recursive: ## for root, dirs, files in os.walk(node): ## for f in files: ## filename = os.path.join(root, f) ## ## pattern_check = reduce(lambda x, y: x or bool(fnmatch(filename, y)), file_patterns, False) ## exclude_check = reduce(lambda x, y: x and fnmatch(filename, y), exclude_patterns, True) ## ## if pattern_check and not exclude_check: ## sources.append(filename) ## else: ## for pattern in file_patterns: ## sources.extend(glob.glob("/".join([node, pattern]))) ## sources = map( lambda path: env.File(path), sources ) ## return sources ## ## ##def DoxySourceScanCheck(node, env): ## """Check if we should scan this file""" ## return os.path.isfile(node.path) def srcDistEmitter(source, target, env): ## """Doxygen Doxyfile emitter""" ## # possible output formats and their default values and output locations ## output_formats = { ## "HTML": ("YES", "html"), ## "LATEX": ("YES", "latex"), ## "RTF": ("NO", "rtf"), ## "MAN": ("YES", "man"), ## "XML": ("NO", "xml"), ## } ## ## data = DoxyfileParse(source[0].get_contents()) ## ## targets = [] ## out_dir = data.get("OUTPUT_DIRECTORY", ".") ## ## # add our output locations ## for (k, v) in output_formats.items(): ## if data.get("GENERATE_" + k, v[0]) == "YES": ## targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) ) ## ## # don't clobber targets ## for node in targets: ## env.Precious(node) ## ## # set up cleaning stuff ## for node in targets: ## env.Clean(node, node) ## ## return (targets, source) return (target,source) def generate(env): """ Add builders and construction variables for the SrcDist tool. """ ## doxyfile_scanner = env.Scanner( ## DoxySourceScan, ## "DoxySourceScan", ## scan_check = DoxySourceScanCheck, ## ) srcdist_builder = targz.makeBuilder( srcDistEmitter ) env['BUILDERS']['SrcDist'] = srcdist_builder def exists(env): """ Make sure srcdist exists. """ return True --- NEW FILE: substinfile.py --- import re from SCons.Script import * # the usual scons stuff you get in a SConscript def generate(env): """ Add builders and construction variables for the SubstInFile tool. Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT from the source to the target. The values of SUBST_DICT first have any construction variables expanded (its keys are not expanded). If a value of SUBST_DICT is a python callable function, it is called and the result is expanded as the value. If there's more than one source and more than one target, each target gets substituted from the corresponding source. """ def do_subst_in_file(targetfile, sourcefile, dict): """Replace all instances of the keys of dict with their values. For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'}, then all instances of %VERSION% in the file will be replaced with 1.2345 etc. """ try: f = open(sourcefile, 'rb') contents = f.read() f.close() except: raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile for (k,v) in dict.items(): contents = re.sub(k, v, contents) try: f = open(targetfile, 'wb') f.write(contents) f.close() except: raise SCons.Errors.UserError, "Can't write target file %s"%targetfile return 0 # success def subst_in_file(target, source, env): if not env.has_key('SUBST_DICT'): raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set." d = dict(env['SUBST_DICT']) # copy it for (k,v) in d.items(): if callable(v): d[k] = env.subst(v()).replace('\\','\\\\') elif SCons.Util.is_String(v): d[k] = env.subst(v).replace('\\','\\\\') else: raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v)) for (t,s) in zip(target, source): return do_subst_in_file(str(t), str(s), d) def subst_in_file_string(target, source, env): """This is what gets printed on the console.""" return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t)) for (t,s) in zip(target, source)]) def subst_emitter(target, source, env): """Add dependency from substituted SUBST_DICT to target. Returns original target, source tuple unchanged. """ d = env['SUBST_DICT'].copy() # copy it for (k,v) in d.items(): if callable(v): d[k] = env.subst(v()) elif SCons.Util.is_String(v): d[k]=env.subst(v) Depends(target, SCons.Node.Python.Value(d)) return target, source ## env.Append(TOOLS = 'substinfile') # this should be automaticaly done by Scons ?!? subst_action = SCons.Action.Action( subst_in_file, subst_in_file_string ) env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter) def exists(env): """ Make sure tool exists. """ return True |