Thread: [Cppunit-devel] GCC'ism
Brought to you by:
blep
From: John C. <joh...@ta...> - 2002-01-21 21:01:48
|
I'm using CppUnit-1.6.2 under the GNU gcc compiler and I would like to inject one or two slight gcc'isms into it. In CPPUNIT_ASSERT macros I would like to use the __PRETTY_FUNCTION__ keyword, this allows one to immediately see which function had the assert failure, and more importantantly which instantiation of a template test function had the failure. (Very useful if you are using templates and CppUnit to enforce Bug Compatibility between two implementations...) In the TextTestResult I would like to reformat the error messages to look (at least to emacs) like gcc compiler error messages. This would enable an Emacs user to put the cursor over the offended assert failure, hit enter and Emacs would bring up that file at that source line. What is the favoured manner of making such environment specific changes to CppUnit? Preprocessor conditionals? #if __GNUC__ Do this #else Do that #endif Autoconf enable/disable feature? configure --enable-pretty-function --enable-emacs-support What is the favoured manner of receiving such changes? --As a request, you will do it. --No yuck, don't want that feature, only C++ pure as the driven snowy standard please! --As a patch on 1.6.2. --As a patch on latest CVS version. --Here is access to the CVS tree, do it yourself. Thanks, John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : joh...@ta... New Zealand Zeitgeist shutting down for corrective maintenance, please log off. |
From: Baptiste L. <gai...@fr...> - 2002-04-15 23:27:02
|
Are others interested in the __PRETTY_FUNCTION__ support ? I was digging in the ML archive when I found that very old mail (that apparently went unanswered :-( ). Suggested implementation: extending SourceLine (that's a 10mn change since everything is centralized there. What a foresight ;-) ). The big bad thing that will take time is detecting gcc and adding the necessary autoconf/configure thingy. Well, and may be figuring out how to extend the Outputters... ;-) > What is the favoured manner of receiving such changes? Sending me a zip of the modified files, based on the lastest release or CVS... Baptiste. ----- Original Message ----- From: "John Carter" <joh...@ta...> To: <Cpp...@li...> Sent: Monday, January 21, 2002 11:01 PM Subject: [Cppunit-devel] GCC'ism > I'm using CppUnit-1.6.2 under the GNU gcc compiler and I would like to > inject one or two slight gcc'isms into it. > > In CPPUNIT_ASSERT macros I would like to use the __PRETTY_FUNCTION__ > keyword, this allows one to immediately see which function had the > assert failure, and more importantantly which instantiation of a > template test function had the failure. (Very useful if you are using > templates and CppUnit to enforce Bug Compatibility between two > implementations...) > > In the TextTestResult I would like to reformat the error messages to look > (at least to emacs) like gcc compiler error messages. This would enable an > Emacs user to put the cursor over the offended assert failure, hit enter > and Emacs would bring up that file at that source line. > > What is the favoured manner of making such environment specific changes to > CppUnit? Preprocessor conditionals? > > #if __GNUC__ > Do this > #else > Do that > #endif > > Autoconf enable/disable feature? > configure --enable-pretty-function --enable-emacs-support > > What is the favoured manner of receiving such changes? > --As a request, you will do it. > --No yuck, don't want that feature, only C++ pure as the driven snowy standard please! > --As a patch on 1.6.2. > --As a patch on latest CVS version. > --Here is access to the CVS tree, do it yourself. > > Thanks, > > John Carter Phone : (64)(3) 358 6639 > Tait Electronics Fax : (64)(3) 359 4632 > PO Box 1645 Christchurch Email : joh...@ta... > New Zealand > > Zeitgeist shutting down for corrective maintenance, please log off. > > > _______________________________________________ > Cppunit-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppunit-devel > |
From: Volker B. <vbo...@te...> - 2002-04-16 07:28:08
|
On Tue, 16 Apr 2002, Baptiste Lepilleur wrote: > Are others interested in the __PRETTY_FUNCTION__ support ? I was digging = in > the ML archive when I found that very old mail (that apparently went > unanswered :-( ). >=20 > Suggested implementation: extending SourceLine (that's a 10mn change sinc= e > everything is centralized there. What a foresight ;-) ). >=20 > The big bad thing that will take time is detecting gcc and adding the > necessary autoconf/configure thingy. Well, and may be figuring out how to > extend the Outputters... ;-) the following configure.in excerpt detects gcc and show how to use the result: AC_PROG_CXX if test X"$GXX" =3D Xyes; then echo "we're using GNU g++" fi On the other hand testing #ifdef __GNUC__ should be enough... As you see in /usr/include/assert.h there is some gcc-version dependency but this can be safely ignored I think. > ----- Original Message ----- > From: "John Carter" <joh...@ta...> [...] > > Autoconf enable/disable feature? > > configure --enable-pretty-function --enable-emacs-support I would vote for making it optional since often the template arguments makes output hard to read. Regards Volker --=20 Volker Boerchers <vbo...@te...> System Engineer TECON Systems AG, Perlengraben 2, 50676 K=F6ln, http://www.tecon.de Tel: +49-221-92007-55, Fax: +49-221-92007-77 |