Thread: [Cppunit-devel] Added cppunittest examples...
Brought to you by:
blep
From: Baptiste L. <bl...@cl...> - 2001-06-01 19:30:18
|
I needed something to test the TestListener, and a while ago I suggested creating unit tests for cppunit. Well, this is done. I added a new example named cppunittest. It implements unit test for TestCaller and TestListener. There is also a graphical test runner hidden in examples/msvc6. You will need to add a make file for unix though. I used only cppunit features that are not too advanced (no template method, no RTTI) to write the unit test. I think that project is (will become) an excellent example since it implement some real live test! So what do you think ? 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: Steve M. R. <ste...@vi...> - 2001-06-01 19:53:27
|
On Fri, Jun 01, 2001 at 09:43:46PM +0200, Baptiste Lepilleur wrote: > I needed something to test the TestListener, and a while ago I suggested > creating unit tests for cppunit. > > Well, this is done. I added a new example named cppunittest. It implements > unit test for TestCaller and TestListener. There is also a graphical test > runner hidden in examples/msvc6. > > You will need to add a make file for unix though. So I noticed :( Making all in cppunittest make[2]: Entering directory `/usr/local/src/devel/cppunit-cvs/examples/cppunittest' make[2]: *** No rule to make target `all'. Stop. make[2]: Leaving directory `/usr/local/src/devel/cppunit-cvs/examples/cppunittest' make[1]: *** [all-recursive] Error 1 -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |
From: Bastiaan B. <bas...@li...> - 2001-06-01 21:24:15
|
Steve M. Robbins wrote: >On Fri, Jun 01, 2001 at 09:43:46PM +0200, Baptiste Lepilleur wrote: > >>I needed something to test the TestListener, and a while ago I suggested >>creating unit tests for cppunit. >> >>Well, this is done. I added a new example named cppunittest. It implements >>unit test for TestCaller and TestListener. There is also a graphical test >>runner hidden in examples/msvc6. >> >>You will need to add a make file for unix though. >> > >So I noticed :( > >Making all in cppunittest >make[2]: Entering directory `/usr/local/src/devel/cppunit-cvs/examples/cppunittest' >make[2]: *** No rule to make target `all'. Stop. >make[2]: Leaving directory `/usr/local/src/devel/cppunit-cvs/examples/cppunittest' >make[1]: *** [all-recursive] Error 1 > > > I've added a Makefile.am to examples/cppunittest. Now it tries to compile the code, g++ gives an error though: TestCallerTest.cpp:24: ISO C++ forbids taking the address of a bound member function to form a pointer to member function I'll try to figure out what the problem is. Bastiaan |
From: Steve M. R. <ste...@vi...> - 2001-06-01 21:32:58
|
On Fri, Jun 01, 2001 at 11:34:35PM +0200, Bastiaan Bakker wrote: > I've added a Makefile.am to examples/cppunittest. Now it tries to > compile the code, g++ gives an error though: > > TestCallerTest.cpp:24: ISO C++ forbids taking the address of a bound > member function to form a pointer to member function You can't say "&foo" if foo is a member function of class X. Use "&X::foo", instead. -Steve -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |
From: Bastiaan B. <bas...@li...> - 2001-06-01 21:52:14
|
Steve M. Robbins wrote: >On Fri, Jun 01, 2001 at 11:34:35PM +0200, Bastiaan Bakker wrote: > > >>I've added a Makefile.am to examples/cppunittest. Now it tries to >>compile the code, g++ gives an error though: >> >>TestCallerTest.cpp:24: ISO C++ forbids taking the address of a bound >>member function to form a pointer to member function >> > >You can't say "&foo" if foo is a member function of class X. >Use "&X::foo", instead. > Yes, I figured that out too. I find the error messages somewhat cryptic sometimes, especially when the C++ nowhere contains the term 'bound member function'. Thanks, Bastiaan > >-Steve > > |
From: Bastiaan B. <bas...@li...> - 2001-06-01 22:02:24
|
Baptiste Lepilleur wrote: >I needed something to test the TestListener, and a while ago I suggested >creating unit tests for cppunit. > >Well, this is done. I added a new example named cppunittest. It implements >unit test for TestCaller and TestListener. There is also a graphical test >runner hidden in examples/msvc6. > >You will need to add a make file for unix though. > Done. > > >I used only cppunit features that are not too advanced (no template method, >no RTTI) to write the unit test. > Both the TestCallerTest and TestResultTest do rely on RTTI: they use the default constructor of TestBuilderSuite, which only exists if CU_USE_TYPEINFO has been defined. I've changed these to use the constructor with the name parameter. Test results on x86 RH Linux 7.1 i with g++ 2.96 RH 81 are 10 times OK. > >I think that project is (will become) an excellent example since it >implement some real live test! > >So what do you think ? > yes, I like it! It's much more interesting than the hierarchy example. Thanks, Bastiaan > >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). > > >_______________________________________________ >Cppunit-devel mailing list >Cpp...@li... >http://lists.sourceforge.net/lists/listinfo/cppunit-devel > |
From: Baptiste L. <bl...@cl...> - 2001-06-02 08:39:25
|
----- Original Message ----- From: "Bastiaan Bakker" <bas...@li...> To: <cpp...@li...> Sent: Saturday, June 02, 2001 12:12 AM Subject: Re: [Cppunit-devel] Added cppunittest examples... > Baptiste Lepilleur wrote: > Both the TestCallerTest and TestResultTest do rely on RTTI: they use the > default constructor of TestBuilderSuite, which only exists if > CU_USE_TYPEINFO has been defined. I've changed these to use the > constructor with the name parameter. > Test results on x86 RH Linux 7.1 i with g++ 2.96 RH 81 are 10 times OK. Thanks, I completly forgot about that one... I think I'll do two configurations like for the library, one with typeinfo (they need to be test) and one without. --- 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). |