[PATCH 2/4] selftests/nolibc: allow run test-report directly

From: Zhangjin Wu
Date: Sun Jun 04 2023 - 23:56:51 EST


This allows to re-check the test report via 'make test-report' without
the requirement to re-run the dependency targets.

Signed-off-by: Zhangjin Wu <falcon@xxxxxxxxxxx>
---
tools/testing/selftests/nolibc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 8149ace2938a..5b0af8d8f5f3 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -128,10 +128,10 @@ libc-test: nolibc-test.c
$(QUIET_CC)$(CC) -o $@ $<

test-report:
- $(Q)awk '/\[OK\]$$/{p++} /\[FAIL\]$$/{f++} /\[SKIPPED\]$$/{s++} \
+ $(Q)[ -f $(CURDIR)/run.out ] && awk '/\[OK\]$$/{p++} /\[FAIL\]$$/{f++} /\[SKIPPED\]$$/{s++} \
END{ printf("%d test(s) passed, %d skipped, %d failed.", p, s, f); \
if (s+f > 0) printf(" See all results in %s\n", ARGV[1]); else print; }' \
- $(CURDIR)/run.out
+ $(CURDIR)/run.out || :

# qemu user-land test
_run-user: nolibc-test
--
2.25.1