Loading...
Searching...
No Matches
Go to the documentation of this file.
12#define INTRO_TEST_FUNCTION printf("Running %s:\n", __func__)
13#define PRINT_TEST_RESULTS(result) \
14 if (result) {system("printf \"[\033[0;32m Pass \033[0m] \"");}\
15 else {system("printf \"[\033[0;31m Fail \033[0m] \"");}\
16 printf("%s\n", __func__)
19#define UNIT_TEST_START printf("[ .... ] %s", __func__); fflush(stdout);
20#define UNIT_TEST_END(result, errcode) \
21 printf("\r");fflush(stdout);\
22 if (result) {system("printf \"[\033[0;32m Pass \033[0m] \"");}\
23 else {system("printf \"[\033[0;31m Fail \033[0m] \"");}\
24 printf("%s", __func__);\
25 if (!result) printf(" - [%d]", errcode);\
31#define LAUNCH_TEST(unit_test_function, pass_counter, fail_counter) \
32 if (!unit_test_function()) pass_counter++; \
35#define PRINT_GRADE(p, f) printf("Grade - %.2f%% (%d/%d)\n", (float) ((p/(p+f)) * 100), (int) p, (int) (p+f));
37#define TEST_SUITE_START int pass = 0, fail = 0;\
40#define LAUNCH_TEST_SET(foo) foo(&pass, &fail);\
41 printf("[+ %d, - %d]\n", pass, fail);\
42 tp += pass; tf += fail;\
45#define TEST_SUITE_END PRINT_GRADE(tp, tf)