[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/39] mtest2make: hide output of successful tests
From: |
Paolo Bonzini |
Subject: |
[PATCH 04/39] mtest2make: hide output of successful tests |
Date: |
Wed, 2 Sep 2020 08:58:42 -0400 |
The softfloat tests are quite noisy; before the Meson conversion
they buffered the output in a file and emitted the output only
if the test failed. Tweak mtest2make.py so that the courtesy
is extended to all non-TAP tests.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/mtest2make.py | 2 +-
scripts/test-driver.py | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 scripts/test-driver.py
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index c709b37f28..27425080cf 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -21,7 +21,7 @@ SPEED = quick
# $1 = environment, $2 = test command, $3 = test name, $4 = dir
.test-human-tap = $1 $(if $4,(cd $4 && $2),$2) < /dev/null |
./scripts/tap-driver.pl --test-name="$3" $(if $(V),,--show-failures-only)
-.test-human-exitcode = $1 $(if $4,(cd $4 && $2),$2) < /dev/null
+.test-human-exitcode = $1 $(PYTHON) scripts/test-driver.py $(if $4,-C$4) $(if
$(V),--verbose) -- $2 < /dev/null
.test-tap-tap = $1 $(if $4,(cd $4 && $2),$2) < /dev/null | sed "s/^[a-z][a-z]*
[0-9]*/& $3/" || true
.test-tap-exitcode = printf "%s\\n" 1..1 "`$1 $(if $4,(cd $4 && $2),$2) <
/dev/null > /dev/null || echo "not "`ok 1 $3"
.test.print = echo $(if $(V),'$1 $2','Running test $3') >&3
diff --git a/scripts/test-driver.py b/scripts/test-driver.py
new file mode 100644
index 0000000000..eef74b29a8
--- /dev/null
+++ b/scripts/test-driver.py
@@ -0,0 +1,35 @@
+#! /usr/bin/env python3
+
+# Wrapper for tests that hides the output if they succeed.
+# Used by "make check"
+#
+# Copyright (C) 2020 Red Hat, Inc.
+#
+# Author: Paolo Bonzini <pbonzini@redhat.com>
+
+import subprocess
+import sys
+import os
+import argparse
+
+parser = argparse.ArgumentParser(description='Test driver for QEMU')
+parser.add_argument('-C', metavar='DIR', dest='dir', default='.',
+ help='change to DIR before doing anything else')
+parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
+ help='be more verbose')
+parser.add_argument('test_args', nargs=argparse.REMAINDER)
+
+args = parser.parse_args()
+os.chdir(args.dir)
+
+test_args = args.test_args
+if test_args[0] == '--':
+ test_args = test_args[1:]
+
+if args.verbose:
+ result = subprocess.run(test_args, stdout=None, stderr=None)
+else:
+ result = subprocess.run(test_args, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
+ if result.returncode:
+ sys.stdout.buffer.write(result.stdout)
+sys.exit(result.returncode)
--
2.26.2
- [PATCH 10/39] meson: fix libqos linking, (continued)
- [PATCH 10/39] meson: fix libqos linking, Paolo Bonzini, 2020/09/02
- [PATCH 21/39] tests: do not print benchmark output to stdout, Paolo Bonzini, 2020/09/02
- [PATCH 23/39] tests/migration/stress: remove unused exit_success, Paolo Bonzini, 2020/09/02
- [PATCH 24/39] meson: fix migration/stress compilation with glibc>=2.30, Paolo Bonzini, 2020/09/02
- [PATCH 19/39] meson: convert vhost-user-bridge, Paolo Bonzini, 2020/09/02
- [PATCH 20/39] meson: convert atomic*-bench, Paolo Bonzini, 2020/09/02
- [PATCH 13/39] meson: declare keyutils dependency, Paolo Bonzini, 2020/09/02
- [PATCH 09/39] ninjatool: use constant names for stamp files, Paolo Bonzini, 2020/09/02
- [PATCH 18/39] meson: remove old socket_scm_helper rule, Paolo Bonzini, 2020/09/02
- [PATCH 17/39] meson: move keyutils dependency check, Paolo Bonzini, 2020/09/02
- [PATCH 04/39] mtest2make: hide output of successful tests,
Paolo Bonzini <=
- [PATCH 29/39] Makefile: inline the relevant parts of rules.mak, Paolo Bonzini, 2020/09/02
- [PATCH 26/39] configure: remove dead code for in-tree builds, Paolo Bonzini, 2020/09/02
- [PATCH 31/39] configure: move C++ compiler handling to meson, Paolo Bonzini, 2020/09/02
- [PATCH 22/39] meson: convert the speed tests, Paolo Bonzini, 2020/09/02
- [PATCH 25/39] meson: convert migration/initrd-stress, Paolo Bonzini, 2020/09/02
- [PATCH 32/39] meson: keep all compiler flags detection together, Paolo Bonzini, 2020/09/02
- [PATCH 34/39] configure: remove unnecessary libm test, Paolo Bonzini, 2020/09/02
- [PATCH 39/39] docs: suggest Meson replacements for various configure functions, Paolo Bonzini, 2020/09/02
- [PATCH 36/39] meson: get glib compilation flags from GLIB_CFLAGS, Paolo Bonzini, 2020/09/02
- [PATCH 16/39] meson: convert the unit tests, Paolo Bonzini, 2020/09/02