cppunit-devel Mailing List for CppUnit - C++ port of JUnit (Page 27)
Brought to you by:
blep
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
(21) |
May
(96) |
Jun
(109) |
Jul
(42) |
Aug
(6) |
Sep
(106) |
Oct
(60) |
Nov
(20) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(7) |
Feb
(11) |
Mar
(49) |
Apr
(124) |
May
(30) |
Jun
(37) |
Jul
(53) |
Aug
(33) |
Sep
(21) |
Oct
(22) |
Nov
(19) |
Dec
(15) |
2003 |
Jan
(34) |
Feb
(25) |
Mar
(11) |
Apr
(12) |
May
(16) |
Jun
(24) |
Jul
(23) |
Aug
(23) |
Sep
(42) |
Oct
(7) |
Nov
(32) |
Dec
(33) |
2004 |
Jan
(41) |
Feb
(41) |
Mar
(24) |
Apr
(25) |
May
(18) |
Jun
(13) |
Jul
(11) |
Aug
(15) |
Sep
(22) |
Oct
(10) |
Nov
(15) |
Dec
(9) |
2005 |
Jan
(4) |
Feb
(15) |
Mar
(11) |
Apr
(16) |
May
(29) |
Jun
(17) |
Jul
(27) |
Aug
(12) |
Sep
(9) |
Oct
(10) |
Nov
(5) |
Dec
(6) |
2006 |
Jan
(2) |
Feb
(6) |
Mar
(7) |
Apr
(2) |
May
(1) |
Jun
(5) |
Jul
(8) |
Aug
(6) |
Sep
(10) |
Oct
(11) |
Nov
(15) |
Dec
(2) |
2007 |
Jan
(12) |
Feb
(22) |
Mar
(10) |
Apr
(7) |
May
(1) |
Jun
(8) |
Jul
(4) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Baptiste L. <bl...@cl...> - 2003-01-23 22:50:27
|
There is no clean way to do that. Are you sure that what you're trying to do could not be achieved using a TestListener ? The code below does not work because the instance of the TestResult being used is not the one used to run the test. Baptiste. ----- Original Message ----- From: "Eugene Zozulya" <eug...@th...> To: <cpp...@li...> Sent: Friday, January 10, 2003 4:01 PM Subject: [Cppunit-devel] How to check the test result in the tearDown() Hi all, Is any way to know the test result in the tearDown() except using the flags? The following doesn't work (might be stupid, but I've tried...): // cppunit-1.9.10 class MyTest: public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( MyTest ); CPPUNIT_TEST( MyTestCase ); CPPUNIT_TEST_SUITE_END(); public: virtual void setUp(); virtual void tearDown(); void MyTestCase(); private: fstream m_OutFile; CPPUNIT_NS::TestResultCollector *m_pResult; } CategMapTest::MyTest() { m_OutFile.open("MyTest.out", ios::out | ios::app); m_pResult = new CPPUNIT_NS::TestResultCollector(); CPPUNIT_NS::TestResult().addListener( m_pResult ); } CategMapTest::~MyTest() { m_OutFile.close(); delete m_pResult; } void MyTest::setUp() { } void MyTest::MyTestCase() { CPPUNIT_ASSERT(false); } void MyTest::tearDown() { static int l_count=0; m_OutFile << " test " << ++l_count << " - " << m_pResult->wasSuccessful() << " - " << m_pResult->runTests() << " - " << m_pResult->testErrors() << " - " << m_pResult->testFailures() << " - " << m_pResult->testFailuresTotal() << endl; } Any suggestions would be appreciated. Thanks, Eugene ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld =omething 2 See! http://www.vasoftware.com _______________________________________________ Cppunit-devel mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppunit-devel |
From: Baptiste L. <gai...@fr...> - 2003-01-23 22:46:59
|
----- Original Message ----- From: "Duane Murphy" <dua...@ma...> To: "Baptiste Lepilleur" <gai...@fr...>; "CppUnit Developers" <cpp...@li...> Sent: Wednesday, January 08, 2003 5:35 PM Subject: Re: [Cppunit-devel] Bug or misunderstanding? > --- At Tue, 7 Jan 2003 10:38:34 +0100, Baptiste Lepilleur wrote: > > >> > >> Others that work on CppUnit can speak up for why it is this way. I have > >> long considered this a bug. CppUnit likes calling new() :-). They > >> instiate a new Fixture() for each test case. You will have to work around > >> it somehow. > > > >This is a normal behavior. It provides maximum isolation between each test > >case of the fixture. As far as I know JUnit behave the same way. > > There is a chance I missed something, but from my brief review of the > JUnit code and especially the JUnit articles and examples I have read, it > appeared to me that the point of the Fixture was indeed to manage the a > set of tests and not a single test. If it was meant to manage a single > test that what is the point of setUp() and tearDown()? I could just as > easily do these in a constructor or a destructor. I believe you're mistaken concerning JUnit. Give a look at TestSuite.createTest(), and you'll see that the constructor is called for each test (there is no choice, since the name of the method to be called is stored in the test case name (see TestCase documentation)...). It could indeed be the constructor and destructor, but using virtual method is more flexible: - setUp/tearDown can be called multiple time (that is what is done when you click the 'run' button in the MFC/QT test runner). - setUp and tearDown can call virtual method, which are implemented in subclass. This is not possible in constructor/destructor. That being said, I think it will be possible to support both mode in CppUnit 2.0: using a single fixture instance is indeed useful when initialization cost much. > >> CppUnit likes calling new() :-). > > > >What do you mean ? > > I find the use of new() to be a liability. It is the leading cause of > memory leaks and object lifetime errors. I have in fact had bugs with > CppUnit where the lifetime of an object was indeed shorter that I had > expected. > > I avoid pointers and unmanaged memory as much as possible. I use > references and shared pointers (from boost) for all of my memory > management. This makes the code safer, more stable, and easier to read > and understand. I believe you meant to say "CppUnit use delete a lot" ;-). I'm also a fair user of boost and boost::shared_ptr. CppUnit 2.0 makes use of smart-pointer. In fact, I borrowed the 'no template member' shared_ptr implementation and modified it to be more portable and provide a static_cast. For instance, the TestFactoryRegistry code is much simpler (doesn't have all that memory management code). > I view projects like CppUnit() as "industry examples." Maybe this is too > strong of an expectation, but I would expect to see "best practices" in a > widely used framework like CppUnit. I view memory management as a best > practice. Keep in mind that I'm still fairly young to the world of C++. I started learning 5 years ago, and I only have 3,5 years of professionnal experience. I learned a lot during the last year, and I believe some of this will be reflected in CppUnit 2.0. Anyway, I intend CppUnit 2.0 to go through a review phase when I'll have a basic version done, so features/style... can be discussed at length. Baptiste. > > ...Duane |
From: <wa...@ma...> - 2003-01-23 14:28:30
|
SGk6DQogICBJIGZvbGxvdyB0aGUgaW5zdGFsbCBzdGVwIGluICJpbnN0bGwtdW54dCIgdG8gaW5z dGFsbCBjcHB1bml0Lg0KDQpGaXJzdCBpIGVudGVyIC4vY29uZmlndXJlIC0tZGlzYWJsZS1zaGFy ZWQgb24gdGhlIHNoZWxsIG9mIHRoZSBjeWd3aW4uDQoNCml0IHJ1bmVkIHdpdGhvdXQgZXJyb3Jz LiBTZWNvbmQsIGkgcHJlc3MgIm1ha2UiLCBlcnJvcnMgb2NjdXJlZCwgdGhlIHNoZWxsDQoNCnBy aW50ZWQgIi8uLi9pbmNsdWRlL2NwcHVuaXQvUG9ydGFiaWxpdHkuaDo4MTogI2Vycm9yIENhbm5v dCBkZWZpbmUNCg0KIENwcFVuaXQ6Ok9TdHJpbmdTdHJlYW0uIiBhbmQgdGhlIG1ha2UgIHN0b3Bw ZWQuIEkgd2FzIGVhZ2VyIHRvIGNvbXBpbGUNCg0KdGhlIHBhY2thZ2UuIENhbiB5b3UgZ2l2ZSBh IHNvbHV0aW9uIHRvIG1lPyBvciBzb21lIGFkdmlzZT8gdGhhbmsgeW91DQoNCnZlcnkgbXVjaC4N Cg0KDQpCZXN0IFJlZ2FyZHMhDQp0ZXN0IGRlcHQuIEVhc3Rjb210ZA0KTHVuIFdhbmcNCm9mZmlj ZTogNTA3DQp0ZWyjqG+jqTogICAgODYtMTAtNjI5NzMzMjItNTU3Nw0KdGhlIHNlY29uZCBTdHJl ZXQsU2hhbmdkaSBJbmZvcm1hdGlvbiBJbmR1c3RyeSBCYXNlDQpIYWlkaWFuIERpc3RyaWN0LEJl aWppbmcsQ2hpbmENClBvc3QgQ29kZToxMDAwODUNCg== |
From: <Eri...@qi...> - 2003-01-23 12:40:44
|
Hi, I am currently thinking of automatic unit testing either by commercial tools or by using a programmatic framework, which I can influence. A while ago I played around with version 1.5 of cppunit provided by the xP-website. Today I realized that there is a lot going on on cppunit development and downloaded the snapshot 1.9.10. I followed the instructions given in the documention to compile the projects and setup the MSVC environment. In the next step I compiled the HostApp example and ran it. Unfortunatly, I could not select a testsuite in the TestRunner combobox. I debugged a little bit and found out, that there has to be a history of tests in the registry. If there is no history, all buttons besides the close button are disabled. I added an entry "HistoryTest1" with value "All Tests". Now I can see this suite in the combobox and run it. (I like the double-click feature very much! :) ) I deleted all files and started from scratch using the documentation, only to get this effect again. Do I miss something? Best Regards, Erik Steiner ---------- Erik Steiner, Dipl.-Ing. Senior Software Engineer, R&D Instrumentation QIAGEN GmbH * QIAGEN Strasse 1 * 40724 Hilden - Germany Phone +49 21 03 29 -1 65 64 Fax: - 2 65 64 Homepage: <http://www.qiagen.com> |
From: d <ege...@ho...> - 2003-01-23 06:16:07
|
Hi! =20 I' ve read the CppUnit Documentation yesterday very carefully. While I = was reading the chapter about the TestFactoryRegistry I asked my self if the passed parameter at CPPUNIT_TEST_SUITE_REGISTRATION( ) should be ComplexNumberTest class. I have to know what is the right parameter, because I have to write a = summary about that page in German. Thanx, Ege |
From: Alexandre C. <ac...@in...> - 2003-01-20 10:15:55
|
Perhaps it is not the good place for that.. Just wondering if with all the CppUnit framework (the windows one) we = can not make a TestCollector like JUnit based on each test DLL. I explain: creates a particular TestSuite called TestCollectorSuite that gather all = the existing DLL from a root directory and construct a hirarchical suite = of tests.=20 This could be automaticaly load all DLL tests from a root directory = instead of choosing a particular DLL (i think about the msvc6 GUI). good or bad idee ? |
From: Philippe F. <P....@OB...> - 2003-01-17 10:20:08
|
Hi, For my personal need, I have extended the CppUnit::TextUi::TestRunner. The extension is very simple, the goal for me was just to be able to provide my own outputter and progress listener. See: --- ExtendedTestRunner.h namespace CppUnit { class ExtendedTestRunner : public TextUi::TestRunner { public: ExtendedTestRunner( Outputter *outputter =NULL, TestListener * progressListener =NULL) : TextUi::TestRunner( outputter), m_progressListener( progressListener) { if (m_progressListener == NULL) { m_progressListener = new TextTestProgressListener(); } } virtual bool runTest( Test *test, bool doPrintProgress ); virtual void setTestProgressListener( TestListener * listener) { delete m_progressListener; m_progressListener = listener; } virtual void setTestResultCollector( TestResultCollector * result) { delete m_result; m_result = result; } protected: TestListener * m_progressListener; }; }; // CppUnit ------- ExtendedTestRunner.cpp namespace CppUnit { bool ExtendedTestRunner::runTest( Test *test, bool doPrintProgress ) { if ( doPrintProgress ) m_eventManager->addListener( m_progressListener ); test->run( m_eventManager ); if ( doPrintProgress ) m_eventManager->removeListener( m_progressListener ); return m_result->wasSuccessful(); } }; ------------------------------ I don't remember if adding a virtual method and a new protected member breaks binary compatbility. If not, I suggest to add my method directly the TextUi::TestRunner . Else, I would be happy to see this small class included directly into CppUnit. I have other personal improvements, but I won't talk about them until they are ready. regards, Philippe |
From: Will H. <hub...@si...> - 2003-01-16 16:46:26
|
Hello, i would like to integrate the TestRunnerDSPlugInD.dll into my = Testrunner application, but unfortunately i haven't it managed yet.=20 By double -clicking of a failure line in the testrunner GUI the = reported file is not opened in VC++ as proposed. I can't see any = function from the plugin is used. I' m using the libraries cppunitd.lib and testrunnerd.lib in my = application.=20 What is wrong here ? In the documentation is stated that the plugin works with = testrunner.lib. But this library is not part of the release 1.8.0=20 Is there any documention how i can get it work successfully or can you = give me another hint? Thanks in advance=20 Mit freundlichem Gru=DF / Kind regards Hubert Will Siemens VDO Automotive AG SV C RS TG Osterhofener Stra=DFe 19 - Business Park 93055 Regensburg Germany Tel.: 0941 - 790 - 8667 Fax.: 0941 - 790 - 5714 |
From: Strebel, D. O. <Oli...@Dr...> - 2003-01-16 16:46:19
|
Hi all! First of all I want to say a big THANK YOU for this very useful piece of software. It was of great help for me in another project. We are now using CppUnit with MFC TestRunner. In the present project we have to use an Oracle Library oci.lib which is compiled with the Mutlithreaded C-Runtime Library and not the Multithreaded DLL C-Runtime Library, resulting in the linker problems similar to those=20 mentioned in the second question of your FAQ. This afternoon I managed to hack out quickly a static=20 TestRunner-library using your source code by stripping away all the AFX_DLL stuff and was able to get=20 it linked and working properly with my code. So I have two questions: 1. Is there a simpler way to overcome this awful library clashes at link time? 2. If not: Will there be a statically TestRunner library available in = future releases? Sincerely yours, Dr. Oliver Strebel CC RCO TC J=FCrgen Ponto Platz 1 21. Floor 60301 Frankfurt Germany Tel.: 069/26316924 Fax: 069/26311838 E-Mail: Oli...@Dr... The opinions herein are my own and do not necessarily reflect those of Dresdner Bank AG.=20 |
From: Eugene Z. <eug...@th...> - 2003-01-10 15:01:16
|
Hi all, Is any way to know the test result in the tearDown() except using the = flags? The following doesn't work (might be stupid, but I've tried...): // cppunit-1.9.10 class MyTest: public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( MyTest ); CPPUNIT_TEST( MyTestCase ); CPPUNIT_TEST_SUITE_END(); public: virtual void setUp(); virtual void tearDown(); void MyTestCase(); private: fstream m_OutFile; CPPUNIT_NS::TestResultCollector *m_pResult; } CategMapTest::MyTest() { m_OutFile.open("MyTest.out", ios::out | ios::app); m_pResult =3D new CPPUNIT_NS::TestResultCollector(); CPPUNIT_NS::TestResult().addListener( m_pResult ); } CategMapTest::~MyTest() { m_OutFile.close(); delete m_pResult; } void MyTest::setUp() { } void MyTest::MyTestCase() { CPPUNIT_ASSERT(false); } void MyTest::tearDown() { static int l_count=3D0; m_OutFile << " test " << ++l_count=20 << " - " << m_pResult->wasSuccessful()=20 << " - " << m_pResult->runTests() << " - " << m_pResult->testErrors() << " - " << m_pResult->testFailures() << " - " << m_pResult->testFailuresTotal() << endl; } Any suggestions would be appreciated. Thanks, Eugene=20 |
From: Duane M. <dua...@ma...> - 2003-01-08 16:35:57
|
--- At Tue, 7 Jan 2003 10:38:34 +0100, Baptiste Lepilleur wrote: >> >> Others that work on CppUnit can speak up for why it is this way. I have >> long considered this a bug. CppUnit likes calling new() :-). They >> instiate a new Fixture() for each test case. You will have to work around >> it somehow. > >This is a normal behavior. It provides maximum isolation between each test >case of the fixture. As far as I know JUnit behave the same way. There is a chance I missed something, but from my brief review of the JUnit code and especially the JUnit articles and examples I have read, it appeared to me that the point of the Fixture was indeed to manage the a set of tests and not a single test. If it was meant to manage a single test that what is the point of setUp() and tearDown()? I could just as easily do these in a constructor or a destructor. >> CppUnit likes calling new() :-). > >What do you mean ? I find the use of new() to be a liability. It is the leading cause of memory leaks and object lifetime errors. I have in fact had bugs with CppUnit where the lifetime of an object was indeed shorter that I had expected. I avoid pointers and unmanaged memory as much as possible. I use references and shared pointers (from boost) for all of my memory management. This makes the code safer, more stable, and easier to read and understand. I view projects like CppUnit() as "industry examples." Maybe this is too strong of an expectation, but I would expect to see "best practices" in a widely used framework like CppUnit. I view memory management as a best practice. ...Duane |
From: Philippe F. <P....@OB...> - 2003-01-07 13:11:08
|
Hi, I want to write my custom test outputter with the following characteristics: 1. the name of the test being run is printed 2. the full failure is reported during the test run 3. a percentage of the number of test failed is printed at the end. 1 & 2 can be done using TestResultCollecter or using a custom TestListener 3 can be done using TestResult or an Outputter But how do I glue this together ? TestRunner should be my interface. But it turns out that TestRunner does have enough methods to customise the progress reporter. So I have to inherit from TestRunner to do what I want. This is a pity because internally, TestRunner has everything I need. For the next version of cppunit, I suggest to add a few methods, that would behave basically like setOutputter: provide a sensible text default but allow for customisation. I need: setTestProgressListener( TestListener ); and probably setTestResultCollecter( TestResultCollecter ); This won't break binary compatibility. Do you want the patches ? regards, Philippe |
From: ritesh <rit...@pa...> - 2003-01-07 11:25:34
|
Hi I am learning CppUnit. I have learnt with Gui and command line output. How to get out put in Xml. Please tell me if any cookbook is available. Thanks & Regards - Ritesh Mittal |
From: Baptiste L. <gai...@fr...> - 2003-01-07 09:33:34
|
----- Original Message ----- From: "Duane Murphy" <dua...@ma...> To: <Seb...@en...>; "CppUnit Developers" <cpp...@li...> Sent: Friday, December 20, 2002 12:00 AM Subject: Re: [Cppunit-devel] Bug or misunderstanding? > --- At Fri, 20 Dec 2002 11:45:45 +1300, > Seb...@en... wrote: > > >Hi, > > > >I'm just starting on a new project and we are going to use CppUnit as a > >framework for our tests. Right now I'm working on the UI part of the > >application and so I started out with creating a Fixture that contains a > >UserInterface object as a member and has a static suite() function just as > >described in the CookBook. The suite creates two (for now) TestCallers and > >pass in test methods of the fixture. I expected one Fixture (and therefor > >one UserInterface) to be created and that all the testmethods are called on > >this one object (framed by calles to setUp() and tearDown() which reset the > >UI object to a > >known state.) > > > >However, it turned out that for each TestCaller instantiated one Fixture > >was instantiated and the testmethods were each called on a different > >Fixture object. This resulted in multiple UI objects to be created and > >since they create threads each calling a display driver which only expects > >calls from one UI at a time ..... I think you can imagine ... > > > >My understanding came from the following text from the CookBook: > > > >"Ordinarily, you'll have many little test cases that you'll want to run on > >the same set of objects. To do this use a fixture. [...] A fixture is > >a known set of objects that serves as a base for a set of test cases." > > > > > >Now my question is: Am I doing something wrong or is this a bug in CppUnit > >or is this intended behaviour (in which case I think the docu should be > >updated.)? > > > >Also if this is intended, can you give me just a pointer on how to do this > >kind of thing? Should I subclass TestSuite and keep the persistent objects > >there? > > Others that work on CppUnit can speak up for why it is this way. I have > long considered this a bug. CppUnit likes calling new() :-). They > instiate a new Fixture() for each test case. You will have to work around > it somehow. This is a normal behavior. It provides maximum isolation between each test case of the fixture. As far as I know JUnit behave the same way. > CppUnit likes calling new() :-). What do you mean ? Baptiste. [...] > ...Duane |
From: Ross B. <r.b...@18...> - 2003-01-06 15:02:17
|
Hi, We needed to build a RPM of CppUnit to distribute around the office, but the .spec file is a little simple and does not use the groovy macros for clever installs (thus files appear in the wrong location on RH7x/RH8). Attached is a new .spec.in file (based on the file from cppunit-1.8.0) which works a lot better for me. Assuming the 1.9.x changes didn't radically re-arrange the installed files it should work fine. Regards, Ross -- Ross Burton Software Engineer OneEighty Software Ltd Tel: +44 20 8680 8712 Cygnet House Fax: +44 20 8680 8453 12-14 Sydenham Road r.b...@18... Croydon, Surrey CR9 2ET, UK http://www.180sw.com./ ==================================================================== Under the Regulation of Investigatory Powers (RIP) Act 2000 together with any and all Regulations in force pursuant to the Act OneEighty Software Ltd reserves the right to monitor any or all incoming or outgoing communications as provided for under the Act |
From: Philippe F. <P....@OB...> - 2003-01-06 10:49:01
|
> I thought you might be interested to know that I have started last week a port > of "Mock Objects for Java" (http://www.mockobjects.com) to C++. You can read the previous threads on the subject: http://sourceforge.net/mailarchive/forum.php?thread_id=987792&forum_id=6698 http://sourceforge.net/mailarchive/forum.php?thread_id=1007108&forum_id=6698 Although I haven't used it yet, I think easymock is easier to use than mockobjects. What do you think of the issues raised in the threads I list ? regards, Philippe |
From: Phlip <pl...@sy...> - 2003-01-05 07:03:54
|
Philippe Fremy sez: > Hi, > > in the first version of cppunit, IIRC, one could write something like that > : > > CPPUNIT_ASSERT_EQUALS( a, 2 ) > > and get an error message like > > " 'a' was expected to be 2 but was actually 3" > > Now the error message is more along > > " expected: 2 > but was: 3 > " > > There is a loss of information, the name of what was being tested. And I > like to have it back. > > Was it removed because getting a string for this argument was dependant on > a macro trick ? Just to fan some flames here, but that's not a macro "trick", it's a very healthy established practice called "Stringerization". There's no reason not to do it. I have often gone to great lengths to reproduce the trick in interpretive languages. This CppUnit knock-off uses it (and puts it in the Output window of VC++): http://c2.com/cgi/wiki?VisualCeePlusPlus #define CPPUNIT_SQUEAK(q) { std::ostringstream z; z << __FILE__ << '(' << __LINE__ << ") : Failed; " << q << '\n'; cout << z.str() << std::flush; ::OutputDebugString?(z.str().c_str()); worked = false; } #define CPPUNIT_ASSERT_EQUAL(alpha, omega) if ((alpha) != (omega)) CPPUNIT_SQUEAK(#alpha " != " #omega << "; " << alpha << " != " << omega) Observe those lines output in "file(#): message" format, meaning VC++ will navigate to the line that failed the test on an <F4>. Putting the \ back on the lines is left as an exercize for the user. I'm not sure if CppUnit has these features either. My minimal implementation turns VC++ into the test window, and permits very easy round-trip navigation. -- Phlip http://www.greencheese.org/EvolutionaryPsychology -- I'l have my Web site call your Web site... -- |
From: Philippe F. <pf...@no...> - 2003-01-04 23:09:59
|
Hi, in the first version of cppunit, IIRC, one could write something like that : CPPUNIT_ASSERT_EQUALS( a, 2 ) and get an error message like " 'a' was expected to be 2 but was actually 3" Now the error message is more along " expected: 2 but was: 3 " There is a loss of information, the name of what was being tested. And I like to have it back. Was it removed because getting a string for this argument was dependant on a macro trick ? regards, Philippe -- Free the mallocs! |
From: Philippe F. <pf...@no...> - 2003-01-04 23:02:12
|
Hi, I am using cppunit on a gentoo linux 1.4 rc1 box. I got a SIGABORT signal. gcc version is 3.2.1 hilippe@werewindle ~/work/kompare/kdesdk/kompare-phil/libdiff2/unittests $ gdb unittests GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) run Starting program: /home/philippe/work/kompare/kdesdk/kompare-phil/libdiff2/unittests/unittests .. Program received signal SIGABRT, Aborted. 0x40176c91 in kill () from /lib/libc.so.6 (gdb) backtrace #0 0x40176c91 in kill () from /lib/libc.so.6 #1 0x40176a78 in raise () from /lib/libc.so.6 #2 0x4017811c in abort () from /lib/libc.so.6 #3 0x400f1dd3 in __cxxabiv1::__terminate(void (*)()) () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/libstdc++.so.5 #4 0x400f1e14 in __cxxabiv1::__unexpected(void (*)()) () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/libstdc++.so.5 #5 0x400f1fbe in __cxa_rethrow () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/libstdc++.so.5 #6 0x40020f56 in CppUnit::Asserter::failNotEqual(std::string, std::string, CppUnit::SourceLine, std::string) (expected=Cannot access memory at address 0x0 ) at Asserter.cpp:40 #7 0x0804a872 in void CppUnit::TestAssert::assertEquals<int>(int const&, int const&, CppUnit::SourceLine, std::string const&) (expected=@0xbffff078, actual=@0xbfffee54, sourceLine=Cannot access memory at address 0xffffffff ) at /usr/include/cppunit/TestAssert.h:43 #8 0x0804a4de in TestDiffIgnoreFiles::testTwo() (this=0x804c828) at /usr/include/g++-v32/bits/stl_alloc.h:630 #9 0x0804a20f in CppUnit::TestCaller<TestDiffIgnoreFiles, CppUnit::NoExceptionExpected>::runTest() (this=0x40278214) at /usr/include/cppunit/TestCaller.h:166 #10 0x400258d5 in CppUnit::TestCase::run(CppUnit::TestResult*) (this=0x804c838, result=0x804bd08) at TestCase.cpp:30 #11 0x4002eb7d in CppUnit::TestSuite::run(CppUnit::TestResult*) (this=0x804bf68, result=0x804bd08) at TestSuite.cpp:44 #12 0x4002eb7d in CppUnit::TestSuite::run(CppUnit::TestResult*) (this=0x804b4a0, result=0x804bd08) at TestSuite.cpp:44 #13 0x4002e11a in CppUnit::TextUi::TestRunner::runTest(CppUnit::Test*, bool) ( this=0xbffff3b0, test=0x804b4a0, doPrintProgress=true) at TestRunner.cpp:135 #14 0x4002de27 in CppUnit::TextUi::TestRunner::runTestByName(std::string, bool) ( this=0xbffff210, testName=Cannot access memory at address 0x87bd13c ) at TestRunner.cpp:81 #15 0x4002dd52 in CppUnit::TextUi::TestRunner::run(std::string, bool, bool, bool) ( this=0xbffff210, testName=Cannot access memory at address 0x0 ) at TestRunner.cpp:69 #16 0x08049f26 in main (argc=1, argv=0xbffff444) at /usr/include/g++-v32/bits/stl_alloc.h:630 #17 0x40162e54 in __libc_start_main () from /lib/libc.so.6 (gdb) Looks like there is something wrong. My test cases are very simple : #include <cppunit/extensions/HelperMacros.h> class TestDiffIgnoreFiles : public CppUnit::TestFixture { public: CPPUNIT_TEST_SUITE( TestDiffIgnoreFiles ); CPPUNIT_TEST( testOne ); CPPUNIT_TEST( testTwo ); CPPUNIT_TEST_SUITE_END(); protected: void testOne(); void testTwo(); }; #include "TestDiffIgnoreFiles.h" void TestDiffIgnoreFiles::testOne() { CPPUNIT_ASSERT_EQUAL( 0, 0 ); } void TestDiffIgnoreFiles::testTwo() { CPPUNIT_ASSERT_EQUAL( 0, 1 ); } main.cpp: #include <cppunit/ui/text/TestRunner.h> #include <cppunit/ui/qt/TestRunner.h> #include "TestDiffIgnoreFiles.h" int main( int argc, char **argv) { CppUnit::TextUi::TestRunner runner; //CppUnit::QtUi::TestRunner runner; runner.addTest( TestDiffIgnoreFiles::suite() ); runner.run(); return 0; } Or did I forgot something ? regards, Philippe -- Free the mallocs! |
From: Reed, A. <and...@cs...> - 2002-12-31 13:45:20
|
Hi, I'm after a RogueWave (stop laughing!) version of CppUnit (rather than the STL version). Do you know if such a thing exists? I note from some WikiWiki pages (http://c2.com/cgi/wiki?RwCppUnit) that people have at least started down this line but there is no simple way I can see to contact them. So I thought I'd ask you! Any info on a working product, or who to contact about obtaining one, would be most gratefully received. Thanks, Andy Reed. and...@cs... +44 (0)20 7888 2166 This message is for the named person's use only. It may contain sensitive and private proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. CREDIT SUISSE GROUP and each legal entity in the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT business units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. Unless otherwise stated, any pricing information given in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation. |
From: Andrei S. <as...@Kn...> - 2002-12-27 02:18:36
|
I get missing files error for: =20 #include <ObjModel\addauto.h> =20 Is there DSPlugIn for .net studio? =20 Thanks! =20 =20 |
From: Luigi B. <lui...@fa...> - 2002-12-23 11:44:25
|
Hi all, I've been reading CppUnit's LGPL license and it seems to allow the use I intend to do, but as it's not my field I though I'd better ask for confirmation. I'm planning to use CppUnit for building a test suite for the QuantLib library (http://quantlib.org). The latter is released under a modified BSD license which, I'm told, is GPL compatible. I would not distribute CppUnit itself nor a compiled test-suite binary; instead, I would include in the QuantLib tarball the sources for our test-cases which would be compiled by the user if CppUnit is installed on her machine (by the way, thanks for the Autoconf macro). Also, I would state that CppUnit is released under LGPL and include a copy of the license. As far as my legalese goes, this seems to comply with section 5 of the LGPL. Is it really so? And whether I'm covered or not, are the CppUnit developers happy with the above arrangement or is there any preferred way to go? Thanks in advance, Luigi |
From: Ewald A. <mo...@ew...> - 2002-12-23 08:56:33
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I thought you might be interested to know that I have started last week a port of "Mock Objects for Java" (http://www.mockobjects.com) to C++. In case you don't know mock objects already: you may think of it as a complement to unit test: unit test usually test code from the outside whereas mock objects can be used to test from the inside. See the above link for more on this. The homepage is located at http://mockpp.sf.net. It is all very early and not really worth downloading yet but if you would like to comment on it you are welcome. CC me in this case as I am not on your devel list. As far as I know cppunit is also a port from Javas junit. Did you have any problems with the classes "Object" and "Field"? Do you have the one or the other hint for this or other problems in porting from Java to C++? As far as I can say for now, there will be a lot of templates because there is no "Object" class in C++. cheers Ewald - -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+Bs6VXyQcrD0ZXUYRAgzOAJ4zwCNc0t+wSTvOAbt2tC6da5lAvgCbB1Ab TgzwZCDr6EE8sBUz1GyYpKU= =LflN -----END PGP SIGNATURE----- |
From: <wil...@us...> - 2002-12-22 19:11:55
|
I've been having good luck with C++Builder 5 by using the \cppunit\contrib\bc5\bcc-makefile.zip files. To: "cppunit" <cpp...@li...> Subject: [Cppunit-devel] cppunit and C++ Builder Security Level:? Internal Hello Has somebody use cpunit with C++ Builder ? greetings Igor |
From: Igor C. <Igo...@co...> - 2002-12-21 10:53:38
|
Hello Has somebody use cpunit with C++ Builder ? greetings Igor |