From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 02/39] mtest2make: split environment from test command
Date: Wed, 2 Sep 2020 08:58:40 -0400 [thread overview]
Message-ID: <20200902125917.26021-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20200902125917.26021-1-pbonzini@redhat.com>
Pass the environment and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/mtest2make.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index d7a51bf97e..f4ee4d3994 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -19,16 +19,16 @@ class Suite(object):
print('''
SPEED = quick
-# $1 = test command, $2 = test name
-.test-human-tap = $1 < /dev/null | ./scripts/tap-driver.pl --test-name="$2" $(if $(V),,--show-failures-only)
-.test-human-exitcode = $1 < /dev/null
-.test-tap-tap = $1 < /dev/null | sed "s/^[a-z][a-z]* [0-9]*/& $2/" || true
-.test-tap-exitcode = printf "%s\\n" 1..1 "`$1 < /dev/null > /dev/null || echo "not "`ok 1 $2"
-.test.print = echo $(if $(V),'$1','Running test $2') >&3
+# $1 = environment, $2 = test command, $3 = test name
+.test-human-tap = $1 $2 < /dev/null | ./scripts/tap-driver.pl --test-name="$3" $(if $(V),,--show-failures-only)
+.test-human-exitcode = $1 $2 < /dev/null
+.test-tap-tap = $1 $2 < /dev/null | sed "s/^[a-z][a-z]* [0-9]*/& $3/" || true
+.test-tap-exitcode = printf "%s\\n" 1..1 "`$1 $2 < /dev/null > /dev/null || echo "not "`ok 1 $3"
+.test.print = echo $(if $(V),'$1 $2','Running test $3') >&3
.test.env = MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))}
# $1 = test name, $2 = test target (human or tap)
-.test.run = $(call .test.print,$(.test.cmd.$1),$(.test.name.$1)) && $(call .test-$2-$(.test.driver.$1),$(.test.cmd.$1),$(.test.name.$1))
+.test.run = $(call .test.print,$(.test.env.$1),$(.test.cmd.$1),$(.test.name.$1)) && $(call .test-$2-$(.test.driver.$1),$(.test.env.$1),$(.test.cmd.$1),$(.test.name.$1))
define .test.human_k
@exec 3>&1; rc=0; $(foreach TEST, $1, $(call .test.run,$(TEST),human) || rc=$$?;) \\
@@ -65,7 +65,7 @@ for test in json.load(sys.stdin):
test['cmd'][0] = executable
else:
test['cmd'][0] = executable
- cmd = '$(.test.env) %s %s' % (env, ' '.join((shlex.quote(x) for x in test['cmd'])))
+ cmd = ' '.join((shlex.quote(x) for x in test['cmd']))
if test['workdir'] is not None:
cmd = '(cd %s && %s)' % (shlex.quote(test['workdir']), cmd)
driver = test['protocol'] if 'protocol' in test else 'exitcode'
@@ -73,6 +73,7 @@ for test in json.load(sys.stdin):
i += 1
print('.test.name.%d := %s' % (i, test['name']))
print('.test.driver.%d := %s' % (i, driver))
+ print('.test.env.%d := $(.test.env) %s' % (i, env))
print('.test.cmd.%d := %s' % (i, cmd))
test_suites = test['suite'] or ['default']
--
2.26.2
next prev parent reply other threads:[~2020-09-02 13:02 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 12:58 [PATCH 00/39] Next round of Meson fixes and cleanups Paolo Bonzini
2020-09-02 12:58 ` [PATCH 01/39] configure: Add system = 'linux' for meson when cross-compiling Paolo Bonzini
2020-09-02 14:47 ` Alex Bennée
2020-09-02 12:58 ` Paolo Bonzini [this message]
2020-09-02 12:58 ` [PATCH 03/39] mtest2make: split working directory from test command Paolo Bonzini
2020-09-02 12:58 ` [PATCH 04/39] mtest2make: hide output of successful tests Paolo Bonzini
2020-09-02 12:58 ` [PATCH 05/39] mtest2make: unify tests that appear in multiple suites Paolo Bonzini
2020-09-02 12:58 ` [PATCH 06/39] meson: remove b_lundef option Paolo Bonzini
2020-09-02 12:58 ` [PATCH 07/39] configure: do not include absolute paths in -I and -L paths Paolo Bonzini
2020-09-02 12:58 ` [PATCH 08/39] configure: include cross sdl2-config in meson cross file Paolo Bonzini
2020-09-02 12:58 ` [PATCH 09/39] ninjatool: use constant names for stamp files Paolo Bonzini
2020-09-02 12:58 ` [PATCH 10/39] meson: fix libqos linking Paolo Bonzini
2020-09-02 12:58 ` [PATCH 11/39] meson: build qapi tests library Paolo Bonzini
2020-09-02 12:58 ` [PATCH 12/39] meson: declare tasn1 dependency Paolo Bonzini
2020-09-02 12:58 ` [PATCH 13/39] meson: declare keyutils dependency Paolo Bonzini
2020-09-02 12:58 ` [PATCH 14/39] meson: convert qht-bench Paolo Bonzini
2020-09-02 12:58 ` [PATCH 15/39] tests: qga has virtio-serial by default when host has it Paolo Bonzini
2020-09-02 12:58 ` [PATCH 16/39] meson: convert the unit tests Paolo Bonzini
2020-09-02 12:58 ` [PATCH 17/39] meson: move keyutils dependency check Paolo Bonzini
2020-09-02 12:58 ` [PATCH 18/39] meson: remove old socket_scm_helper rule Paolo Bonzini
2020-09-02 12:58 ` [PATCH 19/39] meson: convert vhost-user-bridge Paolo Bonzini
2020-09-02 12:58 ` [PATCH 20/39] meson: convert atomic*-bench Paolo Bonzini
2020-09-02 12:58 ` [PATCH 21/39] tests: do not print benchmark output to stdout Paolo Bonzini
2020-09-02 12:59 ` [PATCH 22/39] meson: convert the speed tests Paolo Bonzini
2020-09-02 12:59 ` [PATCH 23/39] tests/migration/stress: remove unused exit_success Paolo Bonzini
2020-09-02 12:59 ` [PATCH 24/39] meson: fix migration/stress compilation with glibc>=2.30 Paolo Bonzini
2020-09-02 12:59 ` [PATCH 25/39] meson: convert migration/initrd-stress Paolo Bonzini
2020-09-02 12:59 ` [PATCH 26/39] configure: remove dead code for in-tree builds Paolo Bonzini
2020-09-02 12:59 ` [PATCH 27/39] meson: compute config_all_devices directly Paolo Bonzini
2020-09-02 12:59 ` [PATCH 28/39] Makefile: remove dead variables and includes Paolo Bonzini
2020-09-02 12:59 ` [PATCH 29/39] Makefile: inline the relevant parts of rules.mak Paolo Bonzini
2020-09-02 12:59 ` [PATCH 30/39] configure: move disassembler configuration to meson Paolo Bonzini
2020-09-02 12:59 ` [PATCH 31/39] configure: move C++ compiler handling " Paolo Bonzini
2020-09-02 12:59 ` [PATCH 32/39] meson: keep all compiler flags detection together Paolo Bonzini
2020-09-02 12:59 ` [PATCH 33/39] configure: move -ldl test to meson Paolo Bonzini
2020-09-02 12:59 ` [PATCH 34/39] configure: remove unnecessary libm test Paolo Bonzini
2020-09-02 12:59 ` [PATCH 35/39] configure: do not look for install(1) Paolo Bonzini
2020-09-02 12:59 ` [PATCH 36/39] meson: get glib compilation flags from GLIB_CFLAGS Paolo Bonzini
2020-09-02 12:59 ` [PATCH 37/39] configure: do not include dependency flags in QEMU_CFLAGS and LIBS Paolo Bonzini
2020-09-02 12:59 ` [PATCH 38/39] configure: drop dead variables Paolo Bonzini
2020-09-02 12:59 ` [PATCH 39/39] docs: suggest Meson replacements for various configure functions Paolo Bonzini
2020-09-02 13:14 ` [PATCH 00/39] Next round of Meson fixes and cleanups Marc-André Lureau
2020-09-02 13:46 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200902125917.26021-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).