aboutsummaryrefslogtreecommitdiff
path: root/include/test/__meta__.h
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-03-07 23:48:17 -0800
committerChristian C <cc@localhost>2025-03-07 23:48:17 -0800
commit9be81ef43c8cfabe72fba16651dbfe62ed0f1123 (patch)
treee767747b5fd49b3bb2c2693328844b5ea0368b52 /include/test/__meta__.h
parentafad16ce636dd54fa1fdedd100eb93f1d7b508d6 (diff)
Testing suite
Diffstat (limited to 'include/test/__meta__.h')
-rw-r--r--include/test/__meta__.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/test/__meta__.h b/include/test/__meta__.h
index 05a202f..b4cc360 100644
--- a/include/test/__meta__.h
+++ b/include/test/__meta__.h
@@ -4,11 +4,16 @@
#include <lib/bool.h>
#include <stdio.h>
-#define _TEST_PASS(s,n) fprintf(stderr, "%s/%02X: \x1b[92mPASS\x1b[0m\n", s, ++n)
-#define _TEST_FAIL(s,n) fprintf(stderr, "%s/%02X: \x1b[91mFAIL\x1b[0m\n", s, ++n)
+#ifdef TEST_SHOW_PASS
+#define _TEST_PASS(s,sub,n) fprintf(stderr, "%s/%s/%02X: \x1b[92mPASS\x1b[0m\n", s, sub, ++n)
+#else
+#define _TEST_PASS(s,sub,n) ++n
+#endif
+
+#define _TEST_FAIL(s,sub,n) fprintf(stderr, "%s%s/%02X: \x1b[91mFAIL\x1b[0m\n", s, sub, ++n)
#ifndef _TEST_RESULT
-#define _TEST_RESULT(docstring,result,n,n_success) if (!result) {_TEST_FAIL(docstring, n);} else {_TEST_PASS(docstring,n);n_success++;}
+#define _TEST_RESULT(main_string,subtest_string,result,n,n_success) if (!result) {_TEST_FAIL(main_string,subtest_string, n);} else {_TEST_PASS(main_string,subtest_string,n);n_success++;}
#endif
#endif