From 63818ef1aa56e1b28ffe24837b7a14d8d2aa7ab5 Mon Sep 17 00:00:00 2001 From: akscram Date: Wed, 25 Aug 2021 23:14:58 +0000 Subject: [PATCH] CI: update report.py to print summary in stdout git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14713 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- tools/workflows/Makefile | 3 +-- tools/workflows/report.py | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/workflows/Makefile b/tools/workflows/Makefile index 435b7d27c..cf536e1df 100644 --- a/tools/workflows/Makefile +++ b/tools/workflows/Makefile @@ -36,8 +36,7 @@ linters := $(shell find $(ROOT)/tools/style -type f -name "*.sh") # Build makefile based projects all : makefiles makefiles : $(makefiles) - $(WORKFLOWS)/report.py -t $(TEST_RESULTS) | \ - tee $(TEST_RESULTS)/test_results + $(WORKFLOWS)/report.py -t $(TEST_RESULTS) -r $(TEST_RESULTS)/test_results $(single_makefiles) : $(external) @mkdir -p $(TEST_RESULTS)/$(subst $(ROOT)/,,$(@D)) diff --git a/tools/workflows/report.py b/tools/workflows/report.py index 66a86efef..9509386ed 100755 --- a/tools/workflows/report.py +++ b/tools/workflows/report.py @@ -43,6 +43,10 @@ def report(args, fd): fd.write(stderr.text) fd.write('\n') + def write(fds, string): + for fd in fds: + fd.write(string) + thick_line = '=' * 70 + '\n' thin_line = '-' * 70 + '\n' @@ -86,8 +90,12 @@ def report(args, fd): for testcase in failures: write_failed_status(fd, testcase) - fd.write(thin_line) - fd.write('Ran {total:d} tests in {time:.3f}s\n\n'.format( + fds = [fd] + if fd != sys.stdout: + fds.append(sys.stdout) + + write(fds, thin_line) + write(fds, 'Ran {total:d} tests in {time:.3f}s\n\n'.format( total=total_count, time=time, )) @@ -102,14 +110,14 @@ def report(args, fd): ) if failures_count > 0: - fd.write('FAILED ({})\n'.format(context)) + write(fds, 'FAILED ({})\n'.format(context)) sys.exit(1) if context: - fd.write('OK ({})\n'.format(context)) + write(fds, 'OK ({})\n'.format(context)) sys.exit(0) - fd.write('OK\n') + write(fds, 'OK\n') def main():