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 | |
parent | 7193114b152d3a5b714a22f54ed89950c0ba9aba (diff) |
Start work on the testing framework
Diffstat (limited to 'asl/testing')
-rw-r--r-- | asl/testing/BUILD.bazel | 13 | ||||
-rw-r--r-- | asl/testing/testing.cpp | 14 | ||||
-rw-r--r-- | asl/testing/testing.hpp | 15 |
3 files changed, 42 insertions, 0 deletions
diff --git a/asl/testing/BUILD.bazel b/asl/testing/BUILD.bazel new file mode 100644 index 0000000..2942073 --- /dev/null +++ b/asl/testing/BUILD.bazel @@ -0,0 +1,13 @@ +cc_library(
+ name = "testing",
+ hdrs = [
+ "testing.hpp",
+ ],
+ srcs = [
+ "testing.cpp",
+ ],
+ deps = [
+ "//asl",
+ ],
+ visibility = ["//visibility:public"],
+)
diff --git a/asl/testing/testing.cpp b/asl/testing/testing.cpp new file mode 100644 index 0000000..a2fe152 --- /dev/null +++ b/asl/testing/testing.cpp @@ -0,0 +1,14 @@ +#include "asl/testing/testing.hpp"
+
+int asl::testing::register_test(
+ const char* suite_name,
+ const char* case_name,
+ TestFunction* fn)
+{
+ return 0;
+}
+
+int main(int argc, char* argv[])
+{
+ return 0;
+}
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()
|