Re: Most user-friendly version of CppUnit

"Baptiste Lepilleur" <[email protected]> Tue, 12 Aug 2003 09:31:18 +0200
Newsgroups gmane.comp.lib.cppunit.devel
Message-ID <007d01c360a3$b88b79b0$9e10c2d4@gaia>
----- Original Message ----- 
From: "Noel Yap" <Noel.Yap-/PgpppG8B+R7qynMiXIxWgC/[email protected]>
To: "Martin Lescuyer" <mlescuyer-NmTC/[email protected]>
Cc: <[email protected]>; "Bob Johnson" <[email protected]>;
<[email protected]>
Sent: Tuesday, July 29, 2003 4:02 PM
Subject: Re: [Cppunit-devel] Most user-friendly version of CppUnit


> The macros certainly go a long way in making CppUnit a bit more user
friendly.
>
> Personally, I don't like the macros since:
> - IIRC, they get in the way of emacs fontification and indentation

Surely someone fixed this parsing issue. At worth, CPPUNIT macros should be
consider as function declaration with omitted return type. But this kind of
macros is already specific to CppUnit. A few libraries with similar macros
that come to mind: Qt, WxWindow, MFC. Fairly common stuffs.

> - they don't conform to our coding standards
> - I just don't like using macros for code generation purposes, there are
better tools out there for this

Those macros are designed to remove code duplication. They also help isolate
the test code from the underlying framework (switching to cppunit v2 will me
much simpler if you are using those macro, as it is fairly simple to write
an a portability layer for them).

I don't know of any better way to 'generate' code than those 'fairly' simple
macro. May be you would like to share (cppunit v2 is relying on a similar
scheme at the time).

>
> Noel
>
> Martin Lescuyer wrote:
> >
> > In addition, I'd say that helper macros help a lot when writing a new
> > testMethod, and makes its registration within a TestFixture and the
> > TestFixture into a TestSuite *VERY* easy.
> > Martin
> >
> > Just an illusion, but so good, so nice  !
> >
> > Noel Yap <Noel.Yap-/PgpppG8B+R7qynMiXIxWgC/[email protected]>
> > Sent by: cppunit-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > 28/07/2003 21:40
> > Please respond to Noel.Yap
> >
> >
> >         To:     Bob Johnson <[email protected]>
> >         cc:     [email protected],
[email protected]
> >         Subject:        Re: [Cppunit-devel] Most user-friendly version
of CppUnit
> >
> > Depending on what you're expecting, I'm not sure you'll be able to get
> > what you want since JUnit uses reflection to "know" the names of your
test
> > cases while C++ doesn't have reflection.
> >
> > I think, once you start using CppUnit, it's pretty easy to use.  In
order
> > to get automagic knowledge of test case names, in our build, I put
> > together a script using typical command-line tools (eg perl, sed, awk,
> > grep) so in practice, it's possible to get
> > what JUnit affords, but it'll take a little more work.
> >
> > HTH,
> > Noel



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01