MADNESS  0.10.1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
madness::test_output Struct Reference

small class for pretty printing of test output More...

#include <test_utilities.h>

Public Member Functions

 test_output (std::string line)
 
 ~test_output ()
 
void checkpoint (bool success, std::string message, double time=-1.0)
 
void checkpoint (double error, double tol, std::string message, double time=-1.0)
 
void checkpoint (double value, double reference, double tol, std::string message, double time=-1.0)
 
int end (bool success=true)
 
bool get_final_success () const
 
void print_and_clear_log ()
 
void print_success_fail (std::ostream &os, bool success, double time, double error)
 
void set_cout_to_logger ()
 
void set_cout_to_terminal (bool newline=true)
 newline for use by user, not for internal use (e.g. checkpoint()) More...
 

Static Public Member Functions

static std::string ltrim_to_length (std::string line, long length=70)
 

Public Attributes

std::stringstream logger
 

Private Attributes

bool cout_set_to_logger =false
 
bool final_success =true
 
bool have_checkpoints =false
 
std::streambuf * stream_buffer_cout
 
double time_begin =0.0
 
double time_last_checkpoint =0.0
 

Detailed Description

small class for pretty printing of test output

Constructor & Destructor Documentation

◆ test_output()

madness::test_output::test_output ( std::string  line)
inline

◆ ~test_output()

madness::test_output::~test_output ( )
inline

Member Function Documentation

◆ checkpoint() [1/3]

void madness::test_output::checkpoint ( bool  success,
std::string  message,
double  time = -1.0 
)
inline

◆ checkpoint() [2/3]

void madness::test_output::checkpoint ( double  error,
double  tol,
std::string  message,
double  time = -1.0 
)
inline

◆ checkpoint() [3/3]

void madness::test_output::checkpoint ( double  value,
double  reference,
double  tol,
std::string  message,
double  time = -1.0 
)
inline

◆ end()

int madness::test_output::end ( bool  success = true)
inline

◆ get_final_success()

bool madness::test_output::get_final_success ( ) const
inline

References final_success.

◆ ltrim_to_length()

static std::string madness::test_output::ltrim_to_length ( std::string  line,
long  length = 70 
)
inlinestatic

References length.

Referenced by test_output(), checkpoint(), and end().

◆ print_and_clear_log()

void madness::test_output::print_and_clear_log ( )
inline

References logger, and set_cout_to_terminal().

Referenced by checkpoint(), and end().

◆ print_success_fail()

void madness::test_output::print_success_fail ( std::ostream &  os,
bool  success,
double  time,
double  error 
)
inline

References madness::error().

Referenced by checkpoint(), and end().

◆ set_cout_to_logger()

void madness::test_output::set_cout_to_logger ( )
inline

◆ set_cout_to_terminal()

void madness::test_output::set_cout_to_terminal ( bool  newline = true)
inline

Member Data Documentation

◆ cout_set_to_logger

bool madness::test_output::cout_set_to_logger =false
private

◆ final_success

bool madness::test_output::final_success =true
private

Referenced by checkpoint(), end(), and get_final_success().

◆ have_checkpoints

bool madness::test_output::have_checkpoints =false
private

Referenced by checkpoint(), and end().

◆ logger

std::stringstream madness::test_output::logger

◆ stream_buffer_cout

std::streambuf* madness::test_output::stream_buffer_cout
private

◆ time_begin

double madness::test_output::time_begin =0.0
private

Referenced by test_output(), and end().

◆ time_last_checkpoint

double madness::test_output::time_last_checkpoint =0.0
private

Referenced by test_output(), and checkpoint().


The documentation for this struct was generated from the following file: