1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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, "%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(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
|