Avoiding dots in output to CppUnit
c++, cppunit, unit-testing
Solution
Depending on how you call run you can specify the right parameter to skip the output.
The method signature is:
bool TextTestRunner::run( std::string testName,
bool doWait,
bool doPrintResult,
bool doPrintProgress )
with `doPrintResult = false` and `doPrintProgress = false` you can suppress all output.
The other way is to use TestRunner or your own subclass of it. This is also not that difficult and it just depends on the structure of your tests which one is easier to implement.
P.S. Just to make it a bit more clear, `ui::text::TestRunner` is just an alias for `TextTestRunner`. The old access way through `TextUi::TestRunner` is deprecated and `TextTestRunner` should be used directly.
Problem
When CppUnit tests are run, there are dots in the output of the xml or the text file. ``` freopen("UnitTest-Results.xml", "a", stdout); CppUnit::TextUi::TestRunner runner; runner.addTest(pSuite); // Change the default outputter to a Text Outputter. runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), std::cout)); ``` The output is: ``` ......................... OK (25 tests) ``` How do I choose not to print the dots in the output file ? Thanks