Changes in uspace/lib/pcut/src/report/tap.c [9b20126:9eb1ff5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/report/tap.c
r9b20126 r9eb1ff5 42 42 static int test_counter; 43 43 44 /** Counter of all failures. */ 45 static int failed_test_counter; 46 44 47 /** Counter for tests in a current suite. */ 45 48 static int tests_in_suite; … … 55 58 int tests_total = pcut_count_tests(all_items); 56 59 test_counter = 0; 60 failed_test_counter = 0; 57 61 58 62 printf("1..%d\n", tests_total); … … 75 79 */ 76 80 static void tap_suite_done(pcut_item_t *suite) { 77 printf("#> Finished suite %s (failed %d of %d).\n", 78 suite->name, failed_tests_in_suite, tests_in_suite); 81 if (failed_tests_in_suite == 0) { 82 printf("#> Finished suite %s (passed).\n", 83 suite->name); 84 } else { 85 printf("#> Finished suite %s (failed %d of %d).\n", 86 suite->name, failed_tests_in_suite, tests_in_suite); 87 } 79 88 } 80 89 … … 129 138 const char *fail_error_str = NULL; 130 139 131 if (outcome != TEST_OUTCOME_PASS) {140 if (outcome != PCUT_OUTCOME_PASS) { 132 141 failed_tests_in_suite++; 142 failed_test_counter++; 133 143 } 134 144 135 145 switch (outcome) { 136 case TEST_OUTCOME_PASS:146 case PCUT_OUTCOME_PASS: 137 147 status_str = "ok"; 138 148 fail_error_str = ""; 139 149 break; 140 case TEST_OUTCOME_FAIL:150 case PCUT_OUTCOME_FAIL: 141 151 status_str = "not ok"; 142 152 fail_error_str = " failed"; 143 153 break; 144 case TEST_OUTCOME_ERROR:154 default: 145 155 status_str = "not ok"; 146 156 fail_error_str = " aborted"; 147 break;148 default:149 /* Shall not get here. */150 157 break; 151 158 } … … 160 167 /** Report testing done. */ 161 168 static void tap_done(void) { 169 if (failed_test_counter == 0) { 170 printf("#> Done: all tests passed.\n"); 171 } else { 172 printf("#> Done: %d of %d tests failed.\n", failed_test_counter, test_counter); 173 } 162 174 } 163 175
Note:
See TracChangeset
for help on using the changeset viewer.