unit_tests.hpp
Macros to facilitate unit testing.
- Todo:
Setup proper command line color handling (probably in its own file.)
Add EMP_TEST_BELOW, EMP_TEST_ABOVE, and EMP_TEST_RANGE to ensure that a value is in a certain range.
Consider adding EMP_TEST_ASSERT to ensure that the contained value is true.
Consider adding EMP_TEST_APPROX to compare within a tolerance level.
Note
Status: RESURGENT (Was deprecated; now back to ALPHA)
Defines
-
emp_test_main()
Functions
-
static UnitTestOutput &GetUnitTestOutput()
-
void ResolveUnitTest(bool pass, const std::string &test_input, const std::string &result, const std::string &exp_result, const std::string &filename, size_t line_num, bool is_require = false)
-
int ProcessUnitTestResults()
-
struct UnitTestOutput
- #include <unit_tests.hpp>
Public Members
-
UnitTestOutput::Mode verbose = UnitTestOutput::Mode::NORMAL
-
size_t num_tests = 0
-
size_t errors = 0
-
bool abort = false
-
UnitTestOutput::Mode verbose = UnitTestOutput::Mode::NORMAL