A simple testing class. More...
#include <SpartaTester.hpp>
Public Member Functions | |
bool | expectAllReached (uint32_t expected_reached, const uint32_t line, const char *file) |
bool | expect (bool val, const char *test_type, const uint32_t line, const char *file) |
bool | expectEqual (uint8_t v1, uint8_t v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
template<typename T > | |
bool | expectEqual (const T &v1, const T &v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
template<typename T , typename U = T> | |
bool | expectEqual (const T &v1, const U &v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
template<typename T , typename U > | |
std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value &&(std::is_signed< T >::value!=std::is_signed< U >::value), bool >::type | compare (const T &t, const U &u) |
template<typename T , typename U > | |
std::enable_if<!(std::is_integral< T >::value &&std::is_integral< U >::value &&(std::is_signed< T >::value!=std::is_signed< U >::value)), bool >::type | compare (const T &t, const U &u) |
template<typename T > | |
bool | expectEqual (const T &v1, const std::nullptr_t, bool expected, const char *test_type, const uint32_t line, const char *file) |
template<typename T > | |
bool | expectEqual (const std::nullptr_t, const T &v1, bool expected, const char *test_type, const uint32_t line, const char *file) |
template<typename T > | |
std::enable_if< std::is_floating_point< T >::value, bool >::type | expectEqualWithinTolerance (const T &v1, const T &v2, const T &tol, const char *test_type, const uint32_t line, const char *file) |
void | throwTestFailed (const char *test_type, const uint32_t line, const char *file, const char *exception_what="") |
void | expectFilesEqual (const std::string &a, const std::string &b, bool expected, uint32_t line, const char *file, const bool ignore_commented_lines=true) |
Compares two files. | |
void | fileComparisonFailed (const std::string &a, const std::string &b, const uint32_t line, const char *file, const std::string &error) |
void | reachedMethod (const std::string &method_title) |
Static Public Member Functions | |
static SpartaTester * | getInstance () |
static std::unique_ptr< SpartaTester > | makeTesterWithUserCError (std::ostream &cerr) |
static uint32_t | getErrorCode (const SpartaTester *tester=getInstance()) |
A simple testing class.
The user of this framework should not have to instantiate this class directly. You can if you want to, but you should use the TEST_INIT macro.
Example usage:
Definition at line 51 of file SpartaTester.hpp.
|
inline |
Definition at line 54 of file SpartaTester.hpp.
|
inline |
Definition at line 155 of file SpartaTester.hpp.
|
inline |
Definition at line 164 of file SpartaTester.hpp.
|
inline |
Definition at line 80 of file SpartaTester.hpp.
|
inline |
Definition at line 57 of file SpartaTester.hpp.
|
inline |
Definition at line 191 of file SpartaTester.hpp.
|
inline |
Definition at line 171 of file SpartaTester.hpp.
|
inline |
Definition at line 112 of file SpartaTester.hpp.
|
inline |
Definition at line 132 of file SpartaTester.hpp.
|
inline |
Definition at line 92 of file SpartaTester.hpp.
|
inline |
Definition at line 213 of file SpartaTester.hpp.
|
inline |
Compares two files.
a | filename 1 |
b | filename 2 |
expected | Expected file equality. true expects files to match, |
ignore_commented_lines | Do not compare text for lines that begin with '#' false expects differences. |
Does | not throw |
Tracks line and col positions for error printouts. Newlines mode is always '
'.
Definition at line 268 of file SpartaTester.hpp.
|
inline |
Definition at line 368 of file SpartaTester.hpp.
|
inlinestatic |
Definition at line 389 of file SpartaTester.hpp.
|
inlinestatic |
Definition at line 380 of file SpartaTester.hpp.
|
inlinestatic |
Definition at line 385 of file SpartaTester.hpp.
|
inline |
Definition at line 376 of file SpartaTester.hpp.
|
inline |
Definition at line 239 of file SpartaTester.hpp.