Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Thyra::TestResultsPrinter Class Reference

Control printing of test results. More...

#include <Thyra_TestingToolsDecl.hpp>

Public Member Functions

 TestResultsPrinter (const RCP< FancyOStream > &out, const bool show_all_tests)
 
 ~TestResultsPrinter ()
 Print the test results on destruction if not already printed. More...
 
RCP< FancyOStreamreplaceOStream (const RCP< FancyOStream > &out)
 Replace the underlying output stream (used for unit testing this class). More...
 
RCP< FancyOStreamgetTestOStream ()
 Return the stream used for testing. More...
 
void printTestResults (const bool this_result, const Ptr< bool > &success)
 Print the test result. More...
 

Detailed Description

Control printing of test results.

This class is designed to help control printing of test results and to help summarize test results. The idea is that by default, we might want to limit output when the test passes but allow it to be printed in full if the test fails. However, we want to ahve a testing mode show_all_tests==true where the test results are printed to the direct std::ostream object in real time to aid in debugging. To accomplish this, when show_all_tests==false, the output from the test is sent to disconnected std::ostringstream object and then is only printed if the test fails. Otherwise, the detailed output from the test is never printed to the direct std::ostream object.

ToDo: Fill in detailed documentation!

Definition at line 207 of file Thyra_TestingToolsDecl.hpp.

Constructor & Destructor Documentation

Thyra::TestResultsPrinter::TestResultsPrinter ( const RCP< FancyOStream > &  out,
const bool  show_all_tests 
)

Definition at line 58 of file Thyra_TestingTools.cpp.

Thyra::TestResultsPrinter::~TestResultsPrinter ( )

Print the test results on destruction if not already printed.

Definition at line 73 of file Thyra_TestingTools.cpp.

Member Function Documentation

RCP< FancyOStream > Thyra::TestResultsPrinter::replaceOStream ( const RCP< FancyOStream > &  out)

Replace the underlying output stream (used for unit testing this class).

Definition at line 94 of file Thyra_TestingTools.cpp.

RCP< FancyOStream > Thyra::TestResultsPrinter::getTestOStream ( )

Return the stream used for testing.

Definition at line 102 of file Thyra_TestingTools.cpp.

void Thyra::TestResultsPrinter::printTestResults ( const bool  this_result,
const Ptr< bool > &  success 
)

Print the test result.

Definition at line 108 of file Thyra_TestingTools.cpp.


The documentation for this class was generated from the following files: