aboutsummaryrefslogtreecommitdiff
path: root/include/test/__meta__.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/test/__meta__.h')
-rw-r--r--include/test/__meta__.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/test/__meta__.h b/include/test/__meta__.h
new file mode 100644
index 0000000..305698a
--- /dev/null
+++ b/include/test/__meta__.h
@@ -0,0 +1,19 @@
+#ifndef INC_TEST___META___H
+#define INC_TEST___META___H
+
+#include <lib/bool.h>
+#include <stdio.h>
+
+#ifdef TEST_SHOW_PASS
+#define _TEST_PASS(s,sub,n) fprintf(stderr, "(%4X) \x1b[92mPASS\x1b[0m %s/%s\n", ++n, s, sub)
+#else
+#define _TEST_PASS(s,sub,n) ++n
+#endif
+
+#define _TEST_FAIL(s,sub,n) fprintf(stderr, "(%4X) \x1b[91mFAIL\x1b[0m %s/%s\n", ++n, s, sub)
+
+#ifndef _TEST_RESULT
+#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