diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-09-13 23:26:34 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-09-13 23:29:12 +0300 |
commit | b8bb4d08ef489bc81e9c00ae43d19c3795e22072 (patch) | |
tree | d8bdd3b6bf0ff594aa1e72c0cc07d292334e7015 /src/unittest.h | |
parent | 7a4d16e5ebd45b15b0c4925894c25a81c2e135c6 (diff) | |
download | j1chess-b8bb4d08ef489bc81e9c00ae43d19c3795e22072.tar.gz |
chore: setup primitive testing framework
Diffstat (limited to 'src/unittest.h')
-rw-r--r-- | src/unittest.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 <stdio.h> +#include <stdbool.h> + +#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(); |