A class to manage testing and record success and failure. More...
Definition at line 48 of file test_mgr.h.
#include <test_mgr.h>
Public Member Functions | |
bool | report () |
Provide a report of all tests so far. More... | |
std::string | get_last_fail () |
Returns the description of the last test that failed. | |
void | set_output_level (int l) |
Set the output level. More... | |
int | get_ntests () |
Return the number of tests performed so far. | |
The testing methods | |
bool | test_rel (double result, double expected, double rel_error, std::string description) |
Test for ![]() | |
bool | test_abs (double result, double expected, double abs_error, std::string description) |
Test for ![]() | |
bool | test_fact (double result, double expected, double factor, std::string description) |
Test for ![]() | |
bool | test_str (std::string result, std::string expected, std::string description) |
Test for ![]() | |
bool | test_gen (bool value, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_rel_arr (int nv, const vec_t &result, const vec2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
bool | test_rel_arrgslgsl (int nv, gsl_vector *result, gsl_vector *expected, double rel_error, std::string description) |
Test for ![]() | |
template<class vec_t > | |
bool | test_rel_arrgsl (int nv, const vec_t &result, gsl_vector *expected, double rel_error, std::string description) |
Test for ![]() | |
bool | test_rel_matgslgsl (int nr, int nc, gsl_matrix *result, gsl_matrix *expected, double rel_error, std::string description) |
Test for ![]() | |
template<class mat_t > | |
bool | test_rel_matgsl (int nr, int nc, const mat_t &result, gsl_matrix *expected, double rel_error, std::string description) |
Test for ![]() | |
template<class mat_t > | |
bool | test_abs_matgsl (int nr, int nc, const mat_t &result, gsl_matrix *expected, double rel_error, std::string description) |
Test for ![]() | |
template<class mat_t , class mat2_t > | |
bool | test_rel_mat (int nr, int nc, const mat_t &result, const mat2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_abs_arr (int nv, const vec_t &result, const vec2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_fact_arr (int nv, const vec_t &result, const vec2_t &expected, double factor, std::string description) |
Test for ![]() | |
template<class vec_t > | |
bool | test_gen_arr (int nv, const vec_t &result, const vec_t &expected, std::string description) |
Test for equality of a generic array. | |
Data Fields | |
bool | success |
True if all tests have passed. | |
std::string | last_fail |
The description of the last failed test. | |
Protected Member Functions | |
void | process_test (bool ret, std::string d2, std::string description) |
A helper function for processing tests. | |
Protected Attributes | |
int | ntests |
The number of tests performed. | |
int | output_level |
The output level. | |
Friends | |
const test_mgr | operator+ (const test_mgr &left, const test_mgr &right) |
Add two test_mgr objects (if either failed, the sum fails) | |
bool o2scl::test_mgr::report | ( | ) |
Returns true if all tests have passed and false if at least one test failed.
|
inline |
Possible values:
Definition at line 90 of file test_mgr.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).
Hosted at
.