From 2a10eaae094e48a157d55ec886aaa07b0d0be6c9 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 28 Oct 2024 23:52:48 +0100 Subject: Some work on test framework & option --- asl/testing/testing.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'asl/testing/testing.hpp') diff --git a/asl/testing/testing.hpp b/asl/testing/testing.hpp index 4fe44df..bf8f54e 100644 --- a/asl/testing/testing.hpp +++ b/asl/testing/testing.hpp @@ -36,3 +36,11 @@ struct Test #CASE, \ asl_test_fn_##CASE); \ void asl_test_fn_##CASE() + +#define ASL_TEST_ASSERT(EXPR) \ + if (EXPR) {} \ + else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); return; } + +#define ASL_TEST_EXPECT(EXPR) \ + if (EXPR) {} \ + else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); } -- cgit