![]() |
Shamrock 2025.10.0
Astrophysical Code
|
main include file for testing More...
#include "details/Test.hpp"
Include dependency graph for shamtest.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | shamtest::details::TestStaticInit |
| helper class to statically register tests More... | |
| struct | shamtest::TestConfig |
| Configuration of the test runner. More... | |
Namespaces | |
| namespace | shamtest |
| namespace containing stuff related to the test library | |
| namespace | shamtest::details |
| implementation details of the test library | |
Macros | |
| #define | TestStart(type, name, func_name, node_cnt) |
| Macro to declare a test. | |
| #define | TEX_REPORT(src) shamtest::details::current_test.tex_output += src; |
| Macro to write stuff to the tex test report. | |
| #define | STDSTRINGIFY(x) std::string(#x) |
| #define | REQUIRE_NAMED(name, a) |
| Assert macro for test write the conditional, the name of the assert will be the condition Named variant. | |
| #define | REQUIRE_EQUAL_CUSTOM_COMP_NAMED(name, _a, _b, comp) |
| Assert macro for test to test for equalities using a custom comparison function Named variant. | |
| #define | REQUIRE_EQUAL_NAMED(name, a, b) |
| Assert macro for test to test for equalities Named variant. | |
| #define | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED(name, _a, _b, prec, dist) |
| Assert macro for test, testing equality between two variables, with a given precision and a custom distance function. | |
| #define | REQUIRE_FLOAT_EQUAL_NAMED(name, a, b, prec) REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED(name, a, b, prec, std::abs) |
| Assert macro for test, testing equality between two variables, with a given precision. | |
| #define | REQUIRE(a) REQUIRE_NAMED("", a) |
| Assert macro for test write the conditional, the name of the assert will be the condition. | |
| #define | REQUIRE_EQUAL_CUSTOM_COMP(a, b, comp) REQUIRE_EQUAL_CUSTOM_COMP_NAMED("", a, b, comp) |
| Assert macro for test to test for equalities using a custom comparison function. | |
| #define | REQUIRE_EQUAL(a, b) REQUIRE_EQUAL_NAMED("", a, b) |
| Assert macro for test to test for equalities. | |
| #define | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST(name, a, b, prec, dist) REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED("", a, b, prec, dist) |
| Assert macro for test, testing equality between two variables, with a given precision and a custom distance function. | |
| #define | REQUIRE_FLOAT_EQUAL(a, b, prec) REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED("", a, b, prec, std::abs) |
| Assert macro for test, testing equality between two variables, with a given precision. | |
| #define | REQUIRE_EXCEPTION_THROW(call, exception_type) |
| Assert macro for test, testing that a given call throws a specific exception type. | |
Functions | |
| int | shamtest::run_all_tests (int argc, char *argv[], TestConfig cfg) |
| run all the tests | |
| void | shamtest::gen_test_list (std::string_view outfile) |
| output test list to a file | |
| shamtest::details::TestAssertList & | shamtest::asserts () |
| current test asserts | |
| shamtest::details::TestDataList & | shamtest::test_data () |
| current test data | |
| std::string & | shamtest::test_tex_out () |
| Get current tex output from a test. | |
| std::string | shamtest::details::format_assert_name (std::string s) |
| Format a string that is an assert name. | |
Variables | |
| std::vector< Test > | shamtest::details::static_init_vec_tests {} |
| Static init vector containing the list of all the tests in the code see : programming guide : Static init function registering. | |
main include file for testing
Definition in file shamtest.hpp.
| #define REQUIRE | ( | a | ) | REQUIRE_NAMED("", a) |
Assert macro for test write the conditional, the name of the assert will be the condition.
Usage :
Definition at line 292 of file shamtest.hpp.
| #define REQUIRE_EQUAL | ( | a, | |
| b | |||
| ) | REQUIRE_EQUAL_NAMED("", a, b) |
Assert macro for test to test for equalities.
Usage :
Definition at line 312 of file shamtest.hpp.
| #define REQUIRE_EQUAL_CUSTOM_COMP | ( | a, | |
| b, | |||
| comp | |||
| ) | REQUIRE_EQUAL_CUSTOM_COMP_NAMED("", a, b, comp) |
Assert macro for test to test for equalities using a custom comparison function.
Usage :
Definition at line 302 of file shamtest.hpp.
| #define REQUIRE_EQUAL_CUSTOM_COMP_NAMED | ( | name, | |
| _a, | |||
| _b, | |||
| comp | |||
| ) |
Assert macro for test to test for equalities using a custom comparison function Named variant.
Usage :
Definition at line 208 of file shamtest.hpp.
| #define REQUIRE_EQUAL_NAMED | ( | name, | |
| a, | |||
| b | |||
| ) |
Assert macro for test to test for equalities Named variant.
Usage :
Definition at line 237 of file shamtest.hpp.
| #define REQUIRE_EXCEPTION_THROW | ( | call, | |
| exception_type | |||
| ) |
Assert macro for test, testing that a given call throws a specific exception type.
Usage :
| call | Call that is expected to throw the specified exception type |
| exception_type | Exception type that is expected to be thrown |
Definition at line 348 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL | ( | a, | |
| b, | |||
| prec | |||
| ) | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED("", a, b, prec, std::abs) |
Assert macro for test, testing equality between two variables, with a given precision.
Usage :
Definition at line 334 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL_CUSTOM_DIST | ( | name, | |
| a, | |||
| b, | |||
| prec, | |||
| dist | |||
| ) | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED("", a, b, prec, dist) |
Assert macro for test, testing equality between two variables, with a given precision and a custom distance function.
Usage :
Definition at line 323 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED | ( | name, | |
| _a, | |||
| _b, | |||
| prec, | |||
| dist | |||
| ) |
Assert macro for test, testing equality between two variables, with a given precision and a custom distance function.
Usage :
Definition at line 251 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL_NAMED | ( | name, | |
| a, | |||
| b, | |||
| prec | |||
| ) | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST_NAMED(name, a, b, prec, std::abs) |
Assert macro for test, testing equality between two variables, with a given precision.
Usage :
Definition at line 280 of file shamtest.hpp.
| #define REQUIRE_NAMED | ( | name, | |
| a | |||
| ) |
Assert macro for test write the conditional, the name of the assert will be the condition Named variant.
Usage :
Definition at line 183 of file shamtest.hpp.
| #define STDSTRINGIFY | ( | x | ) | std::string(#x) |
Definition at line 150 of file shamtest.hpp.
| #define TestStart | ( | type, | |
| name, | |||
| func_name, | |||
| node_cnt | |||
| ) |
Macro to declare a test.
Example :
Definition at line 131 of file shamtest.hpp.
| #define TEX_REPORT | ( | src | ) | shamtest::details::current_test.tex_output += src; |
Macro to write stuff to the tex test report.
Usage :
Definition at line 148 of file shamtest.hpp.