{
int test_success;
unsigned total = 0, executed = 0, skipped = 0, succeeded = 0, failed = 0;
+ const char *status;
if (suite->suite_name) {
printf(" + ------------------------------------------------------- +\n");
suite->unit_test_cases[total].teardown();
if (test_success == TEST_SUCCESS)
- printf(" + TestCase [%2d] : %s\n", total,
- suite->unit_test_cases[total].success_msg ?
- suite->unit_test_cases[total].success_msg :
- "passed");
+ status = "succeeded";
else
- printf(" + TestCase [%2d] : %s\n", total,
- suite->unit_test_cases[total].fail_msg ?
- suite->unit_test_cases[total].fail_msg :
- "failed");
+ status = "failed";
+
+ printf(" + TestCase [%2d] : %s %s\n", total,
+ suite->unit_test_cases[total].name, status);
total++;
}
int (*setup)(void);
void (*teardown)(void);
int (*testcase)(void);
- const char *success_msg;
- const char *fail_msg;
+ const char *name;
unsigned enabled;
};
-#define TEST_CASE(fn) { NULL, NULL, fn, #fn " succeeded", #fn " failed", 1 }
+#define TEST_CASE(fn) { NULL, NULL, fn, #fn, 1 }
-#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, name " succeeded", \
- name " failed", 1 }
+#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, name, 1 }
-#define TEST_CASE_ST(setup, teardown, testcase) \
- { setup, teardown, testcase, #testcase " succeeded", \
- #testcase " failed ", 1 }
+#define TEST_CASE_ST(setup, teardown, testcase) \
+ { setup, teardown, testcase, #testcase, 1 }
-#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, #fn " succeeded", \
- #fn " failed", 0 }
+#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, #fn, 0 }
-#define TEST_CASE_ST_DISABLED(setup, teardown, testcase) \
- { setup, teardown, testcase, #testcase " succeeded", \
- #testcase " failed ", 0 }
+#define TEST_CASE_ST_DISABLED(setup, teardown, testcase) \
+ { setup, teardown, testcase, #testcase, 0 }
-#define TEST_CASES_END() { NULL, NULL, NULL, NULL, NULL, 0 }
+#define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
#define TEST_HEXDUMP(file, title, buf, len) rte_hexdump(file, title, buf, len)