From b8bb4d08ef489bc81e9c00ae43d19c3795e22072 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 13 Sep 2022 23:26:34 +0300 Subject: chore: setup primitive testing framework --- src/unittest.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/unittest.h (limited to 'src/unittest.h') diff --git a/src/unittest.h b/src/unittest.h new file mode 100644 index 0000000..d2fd4ad --- /dev/null +++ b/src/unittest.h @@ -0,0 +1,18 @@ +#include +#include + +#define RED "\x1B[31m" +#define GRN "\x1B[32m" +#define RESET "\x1B[0m" + +#define PASS "PASS!" +#define FAIL "FAIL!" +#define DEFAULT_ASSERT_MESSAGE "Assertion failed!" + +#define draw(COLOR, TEXT) COLOR TEXT RESET + +bool assert(bool expression, const char* message); + +void unit_test(bool expression, const char* subject); + +bool report(); -- cgit v1.2.3