Some more

This commit is contained in:
2025-02-04 15:32:09 +02:00
parent 049b901278
commit 61c25ffcb9
3 changed files with 73 additions and 29 deletions

View File

@@ -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); \
} \
}