Some more
This commit is contained in:
@@ -14,14 +14,15 @@ typedef struct mcu_test_case_s {
|
||||
#define RUN_TEST_CASES(cases) \
|
||||
for (size_t i = 0; i < sizeof(cases)/sizeof(mcu_test_case_t); i++) { \
|
||||
mcu_test_case_t* test_case = &(cases)[i]; \
|
||||
printf("(%s): ", test_case->short_name); \
|
||||
const char* sn = test_case->short_name; \
|
||||
printf("Running test case: %s\n", test_case->short_name); \
|
||||
int ret = (test_case->test_fn)(); \
|
||||
if (ret) { \
|
||||
printf("FAIL - Returned non zero (%d)\n", ret); \
|
||||
printf("REASON: %s\n", test_case->error_types[ret]); \
|
||||
if (ret) { \
|
||||
printf("(%s) FAIL - Returned non zero (%d)\n", sn, ret); \
|
||||
printf("(%s) REASON: %s\n", sn, test_case->error_types[ret]); \
|
||||
exit(1); \
|
||||
} else { \
|
||||
printf("PASS\n"); \
|
||||
printf("(%s) PASS\n", sn); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user