Thread: [Cppunit-devel] CppUnitW 1.2 merge
Brought to you by:
blep
From: Bastiaan B. <bas...@li...> - 2001-04-29 15:08:16
|
Hi Baptiste (and everyone else), I've merged most of CppUnitW 1.2, with some exceptions: * TestFactoryRegistry used auto_ptr. I had to change that to ordinary pointers: auto_ptr's cannot be used inside STL containers (see for example: http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html ). With MSVC++ it may work (by accident), but with g++ is doesn't even compile. For now, I've only changed pointer types and not done anything about the memory management: very likely it will leak now. Please have a look at it. * I've put the typeinfo stuff in TestSuite and TestFactoryRegistry inside "#ifdef USE_TYPEINFO ". RTTI is still rather new and may not be supported properly on all platforms. Since it's only used to create TestSuites with names direved from a class name, I did not not feel dependence of the core library on RTTI was justified. Also deriving the class name through type_info is an unreliable method. Once again the C++ comittee managed to kill a useful feature: not only may the string returned by type_info.name() differ from compiler to compiler (e.g. g++ returns some really ugly mangled name), but differ with different runs of the program as well. Of course this renders the whole method useful. If someone can explain why the comittee has done this, please do! * Changed TestSuite.getTests() to return a const ref. * Moved TestFactoryRegistry.cpp from src/cppunit/extensions to src/cppunit. It is part of the main library anyway and is much easier to configure automake for it. Please give it a try and let me know where I messed up. Thanks, Bastiaan |
From: Baptiste L. <bl...@cl...> - 2001-05-03 19:33:57
|
> I've merged most of CppUnitW 1.2, with some exceptions: Thanks, this is excellent !!! > > * TestFactoryRegistry used auto_ptr. I had to change that to ordinary > pointers: auto_ptr's cannot be used inside STL containers (see for > example: http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html ). > With MSVC++ it may work (by accident), but with g++ is doesn't even > compile. For now, I've only changed pointer types and not done anything > about the memory management: very likely it will leak now. Please have a > look at it. Thanks for pointing that out. I aware of this limitation (and even with VC++ your going into trouble if you're using sort(). It's also one of the reason auto_ptr had such an hard time getting into stl). I did this as a quick hack to test the thing and completly forgot to clean it up. I'll send a patch tomorrow I hope to fix the leaks. Though there is still some problem when doing: TestFactoryRegistry::getRegistry().registerFactory( "Functionnal tests", TestFactoryRegistry::getRegistry( "Functionnal" ) ); Since the registry owns the factories, it will be destroyed twice (owned by getRegistry( aName ) and registerFactory() ). I'm still turning this around to see how I can fix that. > > * I've put the typeinfo stuff in TestSuite and TestFactoryRegistry > inside "#ifdef USE_TYPEINFO ". RTTI is still rather new and may not be I would rather use CU_USE_TYPEINFO or something like that (CU_NO_TYPEINFO would be easier for us since we wouldn't need to declare it in each project). Prefixes are a great help when you have tens of precompiler define and you need to figure out which library they are related to (and with VC++ you a 40 chars edit field to see them all :-( ). > supported properly on all platforms. Since it's only used to create > TestSuites with names direved from a class name, I did not not feel > dependence of the core library on RTTI was justified. Also deriving the I agree with that. since it has been available with VC++ for years (it was there in VC++ 5.0), I though it was a rather comon feature by now. Well I guessed wrong... ;-( > class name through type_info is an unreliable method. Once again the C++ > comittee managed to kill a useful feature: not only may the string > returned by type_info.name() differ from compiler to compiler (e.g. g++ > returns some really ugly mangled name), but differ with different runs > of the program as well. Of course this renders the whole method useful. Yukk! Do raw_name() and name() return the same thing (raw_name is not supposed to be human readable, but name() is supposed to be....) ? > If someone can explain why the comittee has done this, please do! Damn. I though this one bit was at least well specified. I guess the use will mainly be for VC++ user. I'll add another constructor to TestSuiteBuilder so the suite name can be specified by hand. > > * Changed TestSuite.getTests() to return a const ref. Well, I find the original one easier to use, but I won't arg about that. > > * Moved TestFactoryRegistry.cpp from src/cppunit/extensions to > src/cppunit. It is part of the main library anyway and is much easier to > configure automake for it. I'll need to fix the VC++ project. Will be in the patch to. > > Please give it a try and let me know where I messed up. So did I... TestAssert.cpp is missing. There is also a few minor things (include path in TestRegistry.cpp, typo in TestRunnerModel.cpp). I'll put those in the patch. Other than that it works just fine. Hopefully, I make the patch tomorrow and we'll soon have a working version ! Thanks a lot Baastian. Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |
From: Baptiste L. <bl...@cl...> - 2001-05-05 21:43:09
Attachments:
cppunitw1_2-mergefix.patch.gz
|
Well, I finally made the patch. It includes: - compilation fix (include path, USE_TYPEINFO, TestFactoryRegistry.cpp move, ...). - CU_TEST_SUITE_REGISTRATION macro can be use on any class which have a static suite() method - partial memory leaks fix for TestFactoryRegistry: getRegistry() will not leak, but getRegistry( name) will. When this is integrated, we could probably try for a tarball to check if all files are correctly included. See ya, Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |
From: Bastiaan B. <bas...@li...> - 2001-05-06 00:08:25
|
Baptiste Lepilleur wrote: > Well, I finally made the patch. It includes: > > - compilation fix (include path, USE_TYPEINFO, TestFactoryRegistry.cpp move, > ...). > - CU_TEST_SUITE_REGISTRATION macro can be use on any class which have a > static suite() method > - partial memory leaks fix for TestFactoryRegistry: getRegistry() will not > leak, but getRegistry( name) will. > > When this is integrated, we could probably try for a tarball to check if all > files are correctly included. > Merged like a charm. The dist tarball seems OK. I've put it in http://www.cryptoforge.net/cppunit/cppunit-1.5.5.tar.gz for testing. A+, Bastiaan > > See ya, > Baptiste. > > --- > Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html > Author of The Text Reformatter, a tool for fanfiction readers and writers. > Language: English, French (Well, I'm French). > > ------------------------------------------------------------------------ > Name: cppunitw1_2-mergefix.patch.gz > cppunitw1_2-mergefix.patch.gz Type: application/x-compressed > Encoding: base64 |
From: Baptiste L. <bl...@cl...> - 2001-05-06 11:13:07
|
> Merged like a charm. The dist tarball seems OK. I've put it in > http://www.cryptoforge.net/cppunit/cppunit-1.5.5.tar.gz for testing. "Seems" is the word. Everything is there but VC++ refuses to open any of the workspaces or project file. I finally found out the problem: they are in the Unix format... How can this be solved ? - A unix & a windows dist ? - I think I remember a flag for tar that allows conversion of text file to the local OS format, but I wasn't able to find that one (perhaps it's not on windows version of tar?). Any ideas ? The good news is that once this is fixed it can be released (I converted the file by hand and it worked just fine). Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |
From: Bastiaan B. <bas...@li...> - 2001-05-06 12:40:58
|
Baptiste Lepilleur wrote: > > Merged like a charm. The dist tarball seems OK. I've put it in > > http://www.cryptoforge.net/cppunit/cppunit-1.5.5.tar.gz for testing. > > "Seems" is the word. Everything is there but VC++ refuses to open any of > the workspaces or project file. I finally found out the problem: they are in > the Unix format... > Hehe, I should have known that this was going to happen: only two days ago somebody mailed me about the same problem with log4cpp. > > How can this be solved ? > - A unix & a windows dist ? > - I think I remember a flag for tar that allows conversion of text file to > the local OS format, but I wasn't able to find that one (perhaps it's not on > windows version of tar?). > > Any ideas ? > Yup, the solution is rather simple: I added " perl -pi -e 's/\n/\r\n/g' `find $(distdir) -name '*.ds?'` " to the dist-hook target, so all *.ds? files are converted to CRLF endings before the tar ball is made. I've uploaded the new tar to cryptoforge. Please try it. > > The good news is that once this is fixed it can be released (I converted the > file by hand and it worked just fine). > Baptiste. > So the merge completed succesfully, that's good news indeed. However I do want to clean up two things before a release: * RTTI stuff * TestCaller (BoardGameTest problem) Bastiaan > > --- > Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html > Author of The Text Reformatter, a tool for fanfiction readers and writers. > Language: English, French (Well, I'm French). > > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > http://lists.sourceforge.net/lists/listinfo/cppunit-devel |
From: Baptiste L. <bl...@cl...> - 2001-05-07 09:17:33
|
> Yup, the solution is rather simple: I added " perl -pi -e 's/\n/\r\n/g' `find > $(distdir) -name '*.ds?'` " to the dist-hook target, so all *.ds? files are > converted to CRLF endings before the tar ball is made. > I've uploaded the new tar to cryptoforge. Please try it. It's working just fine. Let's try for a release. We still might want to do a windows and a unix version. For the windows version, all text file would be converted. VC++ doesn't have any problem with unix file, but notepad can't read unix text file. It would be a problem for user trying to read "changelog", or "install"... Not really a problem for me since the tool I'm using doesn't have a problem with unix file (Windows Commander). We could just wait until people ask for it, or set up a pool for that ;-) Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |