From 5b2bb4e025919d74090d23cbabadfeec3b1e9dc4 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 3 Aug 2021 17:47:00 +0200 Subject: a bad testing framework --- src/kernel/tests/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/kernel/tests/main.c (limited to 'src/kernel/tests/main.c') diff --git a/src/kernel/tests/main.c b/src/kernel/tests/main.c new file mode 100644 index 0000000..a7e9534 --- /dev/null +++ b/src/kernel/tests/main.c @@ -0,0 +1,19 @@ +#include +#include +#include + +bool _did_tests_fail; + +TEST(basic_math) { + TEST_IF(2 + 2 == 4); + TEST_IF(2 * 2 == 4); +} + +void tests_all() { + _did_tests_fail = false; + + TEST_RUN(basic_math); + + if (_did_tests_fail) + panic(); +} -- cgit v1.2.3