[Cppunit-devel] Improvement suggestion for "post_build_check" example
Brought to you by:
blep
From: Bachmann, P. <bac...@im...> - 2006-04-06 10:05:20
|
Dear Developers of CppUnit, I've discovered a very small flaw with your example <http://cppunit.sourceforge.net/doc/lastest/cppunit_cookbook.html#post_b uild_check>: In my opinion you have to translate the return value e.g. as follows: #include <cstdlib> ... int main() { TextTestRunner runner; ... return runner.run() ? EXIT_SUCCESS : EXIT_FAILURE; } The point is, that "runner.run()" returns "true" on success, but "EXIT_SUCCESS" is "0" on many systems, so the calling shell will interpret the test run to have failed, if you pass the return value verbatim. Cheers, Philipp. --=20 Philipp Bachmann. Institute for Medical Informatics and Biostatistics (IMIB), Clarastrasse 15, CH-4058 Basel (BS), Switzerland. phone: +41 61 695 9292, fax: +41 61 695 9290 |