CppUnit::CompilerOutputter Class Reference
[Writing test result]
Outputs a TestResultCollector in a compiler compatible format.
More...
#include <CompilerOutputter.h>
Inheritance diagram for CppUnit::CompilerOutputter:
[legend]Collaboration diagram for CppUnit::CompilerOutputter:
[legend]List of all members.
Detailed Description
Outputs a TestResultCollector in a compiler compatible format.
Printing the test results in a compiler compatible format (assertion location has the same format as compiler error), allow you to use your IDE to jump to the assertion failure.
For example, when running the test in a post-build with VC++, if an assertion fails, you can jump to the assertion by pressing F4 (jump to next error).
You should use defaultOutputter() to create an instance.
Heres is an example of usage (from examples/cppunittest/CppUnitTestMain.cpp):
int main( int argc, char* argv[] ) {
bool selfTest = (argc > 1) &&
(std::string("-selftest") == argv[1]);
CppUnit::TextUi::TestRunner runner;
runner.addTest( CppUnitTest::suite() );
if ( selfTest )
{
runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
&runner.result(),
std::cerr ) );
}
bool wasSucessful = runner.run( "", !selfTest );
return wasSucessful ? 0 : 1;
}
Member Typedef Documentation
Constructor & Destructor Documentation
CppUnit::CompilerOutputter::CompilerOutputter |
( |
TestResultCollector * |
result, |
|
|
std::ostream & |
stream |
|
) |
|
|
CppUnit::CompilerOutputter::CompilerOutputter |
( |
const CompilerOutputter & |
copy |
) |
[private] |
|
|
Prevents the use of the copy constructor.
|
Member Function Documentation
|
Creates an instance of an outputter that matches your current compiler. |
void CppUnit::CompilerOutputter::operator= |
( |
const CompilerOutputter & |
copy |
) |
[private] |
|
|
Prevents the use of the copy operator.
|
void CppUnit::CompilerOutputter::printDefaultMessage |
( |
Exception * |
thrownException |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailedTestName |
( |
TestFailure * |
failure |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailureDetail |
( |
TestFailure * |
failure |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailureLocation |
( |
SourceLine |
sourceLine |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailureMessage |
( |
TestFailure * |
failure |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailureReport |
( |
|
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailuresList |
( |
|
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printFailureType |
( |
TestFailure * |
failure |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printNotEqualMessage |
( |
Exception * |
thrownException |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printStatistics |
( |
|
) |
[virtual] |
|
void CppUnit::CompilerOutputter::printSucess |
( |
|
) |
[virtual] |
|
std::string CppUnit::CompilerOutputter::wrap |
( |
std::string |
message |
) |
[virtual] |
|
void CppUnit::CompilerOutputter::write |
( |
|
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following files: