|
RSTools 3.1.0
Versatile C++20 utility library
|
Minimal unit-test framework: TEST_CASE(), CHECK() and RUN_ALL_TESTS(). More...
#include <iostream>#include <string_view>#include <source_location>#include <vector>#include <cassert>#include <exception>#include <chrono>Go to the source code of this file.
Namespaces | |
| namespace | RST |
| Root namespace of RSTools. | |
Macros | |
| #define | CHECK(e, ...) RST::RSTester::checkInternal(DECOMPOSE_CMP_OP(e, #e) __VA_OPT__(,) __VA_ARGS__) |
| Checks a condition; on failure, prints the expression and its operands and stops the test. | |
| #define | TEST_CASE(name) |
Defines and registers a test: TEST_CASE(my_test) { CHECK(1 + 1 == 2); }. | |
| #define | RUN_ALL_TESTS() RST::RSTester::TestRunner::getInstance().runAllTests() |
| Runs every registered test and returns the number of failures. | |
Minimal unit-test framework: TEST_CASE(), CHECK() and RUN_ALL_TESTS().
| #define CHECK | ( | e, | |
| ... | |||
| ) | RST::RSTester::checkInternal(DECOMPOSE_CMP_OP(e, #e) __VA_OPT__(,) __VA_ARGS__) |
Checks a condition; on failure, prints the expression and its operands and stops the test.
| #define TEST_CASE | ( | name | ) |
Defines and registers a test: TEST_CASE(my_test) { CHECK(1 + 1 == 2); }.
| #define RUN_ALL_TESTS | ( | ) | RST::RSTester::TestRunner::getInstance().runAllTests() |
Runs every registered test and returns the number of failures.