![]() |
Shamrock 2025.10.0
Astrophysical Code
|
main include file for testing More...
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 | ANY_WORLD_SIZE -1 |
| #define | _internal_new_test(type, name, func_name, func_ptr, class_name, node_cnt) |
| #define | NEW_TEST(type, name, node_cnt) |
| Macro to declare a test. | |
| #define | TEX_REPORT(src) |
| Macro to write stuff to the tex test report. | |
| #define | STDSTRINGIFY(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) |
| Assert macro for test, testing equality between two variables, with a given precision. | |
| #define | REQUIRE(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) |
| Assert macro for test to test for equalities using a custom comparison function. | |
| #define | REQUIRE_EQUAL(a, b) |
| Assert macro for test to test for equalities. | |
| #define | REQUIRE_FLOAT_EQUAL_CUSTOM_DIST(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(a, b, prec) |
| 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 _internal_new_test | ( | type, | |
| name, | |||
| func_name, | |||
| func_ptr, | |||
| class_name, | |||
| node_cnt ) |
Definition at line 124 of file shamtest.hpp.
| #define ANY_WORLD_SIZE -1 |
Definition at line 122 of file shamtest.hpp.
| #define NEW_TEST | ( | type, | |
| name, | |||
| node_cnt ) |
Macro to declare a test.
Example :
Definition at line 141 of file shamtest.hpp.
| #define REQUIRE | ( | a | ) |
Assert macro for test write the conditional, the name of the assert will be the condition.
Usage :
Definition at line 302 of file shamtest.hpp.
| #define REQUIRE_EQUAL | ( | a, | |
| b ) |
Assert macro for test to test for equalities.
Usage :
Definition at line 322 of file shamtest.hpp.
| #define REQUIRE_EQUAL_CUSTOM_COMP | ( | a, | |
| b, | |||
| comp ) |
Assert macro for test to test for equalities using a custom comparison function.
Usage :
Definition at line 312 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 218 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 247 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 358 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL | ( | a, | |
| b, | |||
| prec ) |
Assert macro for test, testing equality between two variables, with a given precision.
Usage :
Definition at line 344 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL_CUSTOM_DIST | ( | 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 333 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 261 of file shamtest.hpp.
| #define REQUIRE_FLOAT_EQUAL_NAMED | ( | name, | |
| a, | |||
| b, | |||
| prec ) |
Assert macro for test, testing equality between two variables, with a given precision.
Usage :
Definition at line 290 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 193 of file shamtest.hpp.
| #define STDSTRINGIFY | ( | x | ) |
Definition at line 160 of file shamtest.hpp.
| #define TEX_REPORT | ( | src | ) |
Macro to write stuff to the tex test report.
Usage :
Definition at line 158 of file shamtest.hpp.