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