diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-10-16 22:54:34 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | 8c95db33be58a545dd2e030428bded0bd958c4b6 (patch) | |
tree | b78809fae2cec5eb2b9513b4960bfbbd697f3871 /asl/testing/testing.hpp | |
parent | 7193114b152d3a5b714a22f54ed89950c0ba9aba (diff) |
Start work on the testing framework
Diffstat (limited to 'asl/testing/testing.hpp')
-rw-r--r-- | asl/testing/testing.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/asl/testing/testing.hpp b/asl/testing/testing.hpp new file mode 100644 index 0000000..a489d61 --- /dev/null +++ b/asl/testing/testing.hpp @@ -0,0 +1,15 @@ +#pragma once
+
+namespace asl::testing
+{
+
+using TestFunction = void();
+int register_test(const char* suite_name, const char* case_name, TestFunction* fn);
+
+} // namespace asl::testing
+
+#define ASL_TEST(SUITE, CASE) \
+ static void asl_test_fn_##SUITE##_##CASE(); \
+ static const int asl_test_##SUITE##_##CASE = ::asl::testing::register_test( \
+ #SUITE, #CASE, asl_test_fn_##SUITE##_##CASE); \
+ void asl_test_fn_##SUITE##_##CASE()
|