开发者

Can CppUnit report results in HTML or XML format?

Does CppUnit have the ability to generate an html or xml file of its test cases and test re开发者_StackOverflowsults?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜