views:

61

answers:

2

Does CppUnit have the ability to generate an html or xml file of its test cases and test results?

+3  A: 

To output the result of a test in xml format use the XmlOutputter.

Regarding generating the list of test cases to run, see this post.

Ando
+1  A: 

Since you tagged the question using VC++6.0, something else valuable to know is this handy string:

outputter.setLocationFormat("%p(%l) : ");

If you have a post-build step that executes your unit test, and that post build step uses the CompilerOutputter class to display its results, the stdout resulting from the test shows up in your output window like this:

compiling and linking ... bla bla bla
Calling post build step: Run unit tests
........F.....
c:\path\to\code\testFlintstones.cpp(42) : Assert (fred.kiss(wilma)) failed.

If you double-click on the error line, it will automatically open the editor to line 42 in the testFlinstones code. It's like magic. Weak, lame, parlor tricks magic, but magic.

John Deters