I don't know how everyone use CppUnit, but myself, I use the helper
macros to automatically create and register the TestSuite.
The advantage is that the only file you need to recompile is the test
you modified. The disavantage being that you can only see what test are in a
suite at runtime (and you may forget adding a test to a suite).
From what I understood of the source file generated by the Ruby program
(correct me if I'm wrong), all tests are included by the same generated cpp
file and suite are created.
The advantage is that you can easily see the content of each test suite,
and you can not to forget adding a test to a suite. The disadvantage being
that you must regenerate and recompile that file each time you add a test
(which I think make TFD much more difficult). You also lack the
"flexibility" that the macro bring (expect a test to throw an exception for
example, though much progress can still be done in that area).
Notes that on the VC++ platform, there is a few command to help create
test case using macro (in the contrib directory).
I'll gladly welcome any submission you'll make. Even though I see more
disavantage generating the TestSuite hierarchy, it's obviously working well
for many.
Baptiste.
----- Original Message -----
From: "Hitoshi Katta" <ka...@di...>
To: <cpp...@li...>
Sent: Sunday, March 24, 2002 4:40 PM
Subject: [Cppunit-devel] a command which automatically add all test methods
to a TestSuite
> Why don't you make a command which automatically add all test methods to
> a TestSuite. In Japan some people use their own Ruby program for this
> purpose.
>
> http://www.diana.dti.ne.jp/~katta/programs/ruby/index_e.html#CppTools
> http://www.s34.co.jp/cpptechdoc/article/cppunit/index.html
> http://oita.cool.ne.jp/ja6hfa/ja6hfa/cppunit/complement_cppunit.html
>
> Regards
>
> KATTA Hitoshi
> ka...@di...
|