|
Graphle 1.0.0
A C++20 header-only graph library
|
#include <vector>#include <string_view>#include <iostream>#include <source_location>#include <format>#include <functional>Go to the source code of this file.
Classes | |
| struct | graphle::test::assertion_failure |
| class | graphle::test::test_registry |
| struct | graphle::test::subtest_scope_handler |
Namespaces | |
| namespace | graphle |
| namespace | graphle::test |
Macros | |
| #define | GRAPHLE_CAT_1(A, B) A##B |
| #define | GRAPHLE_CAT(A, B) GRAPHLE_CAT_1(A, B) |
| #define | GRAPHLE_TEST_DONT_CATCH_ERRORS "Not Defined" |
| #define | TEST(Suite, Name) |
| #define | SUBTEST_SCOPE(Name) if (auto impl_scope_object = graphle::test::subtest_scope_handler { Name }; true) |
| #define | FAIL(...) throw graphle::test::assertion_failure { __VA_ARGS__ } |
| #define | ASSERT_TRUE(...) if (!bool(__VA_ARGS__)) FAIL(#__VA_ARGS__) |
| #define | ASSERT_FALSE(...) if (bool(__VA_ARGS__)) FAIL(#__VA_ARGS__) |
Typedefs | |
| template<typename R , typename... A> | |
| using | graphle::test::fn = R(*)(A...) |
Functions | |
| void | graphle::test::emit_test_success (std::string_view name) |
| void | graphle::test::emit_test_failure (std::string_view name, const auto &failure) |
| int | main (void) |
| #define ASSERT_FALSE | ( | ... | ) | if (bool(__VA_ARGS__)) FAIL(#__VA_ARGS__) |
Fails the current test if the given condition is true.
Definition at line 74 of file test_framework.hpp.
| #define ASSERT_TRUE | ( | ... | ) | if (!bool(__VA_ARGS__)) FAIL(#__VA_ARGS__) |
Fails the current test if the given condition is not true.
Definition at line 67 of file test_framework.hpp.
| #define FAIL | ( | ... | ) | throw graphle::test::assertion_failure { __VA_ARGS__ } |
Fails the current test with the given message.
Definition at line 60 of file test_framework.hpp.
| #define GRAPHLE_CAT | ( | A, | |
| B | |||
| ) | GRAPHLE_CAT_1(A, B) |
Definition at line 12 of file test_framework.hpp.
| #define GRAPHLE_CAT_1 | ( | A, | |
| B | |||
| ) | A##B |
Definition at line 11 of file test_framework.hpp.
| #define SUBTEST_SCOPE | ( | Name | ) | if (auto impl_scope_object = graphle::test::subtest_scope_handler { Name }; true) |
Defines a subscope of the current test which will have a separate success or error message logged.
Definition at line 51 of file test_framework.hpp.
| #define TEST | ( | Suite, | |
| Name | |||
| ) |
Defines a new test with the given suite and name which will be invoked when tests are run.
Definition at line 29 of file test_framework.hpp.
| int main | ( | void | ) |
Test framework entry point. Runs all registered tests.
Definition at line 224 of file test_framework.hpp.