summaryrefslogtreecommitdiffstats
path: root/build-aux/print-failed-test-output
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2021-01-19 19:30:06 +0100
committerAllan McRae <allan@archlinux.org>2021-01-21 08:18:24 +0100
commit1fdf8c00764af9e32f8dec13061f625f48bd4c8c (patch)
tree12296a9936cfd870778e3ed55de942ab613aab5a /build-aux/print-failed-test-output
parentf9bc6c2b09c18dd48f839f53d834c6fd1bfd2dd3 (diff)
downloadpacman-1fdf8c00764af9e32f8dec13061f625f48bd4c8c.tar.gz
pacman-1fdf8c00764af9e32f8dec13061f625f48bd4c8c.tar.xz
gitlab-ci: print output and logs for failed tests
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'build-aux/print-failed-test-output')
-rwxr-xr-xbuild-aux/print-failed-test-output17
1 files changed, 17 insertions, 0 deletions
diff --git a/build-aux/print-failed-test-output b/build-aux/print-failed-test-output
new file mode 100755
index 00000000..1f1ab76d
--- /dev/null
+++ b/build-aux/print-failed-test-output
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+
+import json
+import sys
+
+def print_result(result):
+ print('==================================================================')
+ print(result['name'])
+ print(' '.join(result['command']))
+ print('==================================================================')
+ print(result['stdout'])
+
+with open(sys.argv[1], 'r') as f:
+ for line in f:
+ result = json.loads(line)
+ if result['result'] == 'FAIL':
+ print_result(result)