Skip to content

Commit

Permalink
selftests/nolibc: report: print a summarized test status
Browse files Browse the repository at this point in the history
one of the test status: success, warning and failure is printed to
summarize the passed, skipped and failed values.

- "success" means no skipped and no failed.
- "warning" means has at least one skipped and no failed.
- "failure" means all tests are failed.

Suggested-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/lkml/20230702164358.GB16233@1wt.eu/
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
  • Loading branch information
Zhangjin Wu authored and Willy Tarreau committed Aug 23, 2023
1 parent 148e971 commit c0315c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/nolibc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \
LDFLAGS := -s

REPORT ?= awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{f++;print} /\[SKIPPED\][\r]*$$/{s++} \
END{ printf("%d test(s) passed, %d skipped, %d failed.\n", p, s, f); \
END{ printf("%d test(s) passed, %d skipped, %d failed => status: ", p, s, f); \
if (f) printf("failure\n"); else if (s) printf("warning\n"); else printf("success\n");; \
printf("See all results in %s\n", ARGV[1]); }'

help:
Expand Down

0 comments on commit c0315c7

Please sign in to comment.