Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/report/tap.c

    r9eb1ff5 r9b20126  
    4242static int test_counter;
    4343
    44 /** Counter of all failures. */
    45 static int failed_test_counter;
    46 
    4744/** Counter for tests in a current suite. */
    4845static int tests_in_suite;
     
    5855        int tests_total = pcut_count_tests(all_items);
    5956        test_counter = 0;
    60         failed_test_counter = 0;
    6157
    6258        printf("1..%d\n", tests_total);
     
    7975 */
    8076static 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);
    8879}
    8980
     
    138129        const char *fail_error_str = NULL;
    139130
    140         if (outcome != PCUT_OUTCOME_PASS) {
     131        if (outcome != TEST_OUTCOME_PASS) {
    141132                failed_tests_in_suite++;
    142                 failed_test_counter++;
    143133        }
    144134
    145135        switch (outcome) {
    146         case PCUT_OUTCOME_PASS:
     136        case TEST_OUTCOME_PASS:
    147137                status_str = "ok";
    148138                fail_error_str = "";
    149139                break;
    150         case PCUT_OUTCOME_FAIL:
     140        case TEST_OUTCOME_FAIL:
    151141                status_str = "not ok";
    152142                fail_error_str = " failed";
    153143                break;
    154         default:
     144        case TEST_OUTCOME_ERROR:
    155145                status_str = "not ok";
    156146                fail_error_str = " aborted";
     147                break;
     148        default:
     149                /* Shall not get here. */
    157150                break;
    158151        }
     
    167160/** Report testing done. */
    168161static 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         }
    174162}
    175163
Note: See TracChangeset for help on using the changeset viewer.