Changeset c45dc5e1 in mainline


Ignore:
Timestamp:
2018-07-16T15:38:16Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c124c985
Parents:
802a8c8
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-16 15:37:33)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-16 15:38:16)
Message:

Tester: print the list of failed tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/tester.c

    r802a8c8 rc45dc5e1  
    3838#include <stdio.h>
    3939#include <stddef.h>
     40#include <stdlib.h>
    4041#include <str.h>
    4142#include <io/log.h>
     
    100101        unsigned int n = 0;
    101102
     103        char *failed_names = NULL;
     104
    102105        printf("\n*** Running all safe tests ***\n\n");
    103106
    104107        for (test = tests; test->name != NULL; test++) {
    105                 if (test->safe) {
    106                         printf("%s (%s)\n", test->name, test->desc);
    107                         if (run_test(test))
    108                                 i++;
    109                         else
    110                                 n++;
     108                if (!test->safe)
     109                        continue;
     110
     111                printf("%s (%s)\n", test->name, test->desc);
     112                if (run_test(test)) {
     113                        i++;
     114                        continue;
    111115                }
     116
     117                if (!failed_names) {
     118                        failed_names = str_dup(test->name);
     119                } else {
     120                        char *f = NULL;
     121                        asprintf(&f, "%s, %s", failed_names, test->name);
     122                        if (!f) {
     123                                printf("Out of memory.\n");
     124                                abort();
     125                        }
     126                        free(failed_names);
     127                        failed_names = f;
     128                }
     129                n++;
    112130        }
    113131
    114132        printf("\nCompleted, %u tests run, %u passed.\n", i + n, i);
     133        if (failed_names)
     134                printf("Failed tests: %s\n", failed_names);
    115135}
    116136
Note: See TracChangeset for help on using the changeset viewer.