From: Thomas Huth <thuth@redhat.com>
To: qemu-block@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org
Subject: [PATCH v2 5/8] tests/qemu-iotests/meson.build: Call the 'check' script directly
Date: Wed, 9 Feb 2022 11:15:27 +0100 [thread overview]
Message-ID: <20220209101530.3442837-6-thuth@redhat.com> (raw)
In-Reply-To: <20220209101530.3442837-1-thuth@redhat.com>
We can get a nicer progress indication if we add the iotests
individually via the 'check' script instead of going through
the check-block.sh wrapper.
For this, we have to add some of the sanity checks that have
originally been done in the tests/check-block.sh script (whether
"bash" is available or whether CFLAGS contain -fsanitize switches)
to the meson.build file now, and add the environment variables
that have been set up by the tests/check-block.sh script before.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qemu-iotests/meson.build | 44 +++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build
index e1832c90e0..a9eade902f 100644
--- a/tests/qemu-iotests/meson.build
+++ b/tests/qemu-iotests/meson.build
@@ -1,9 +1,28 @@
-if not have_tools or targetos == 'windows'
+if not have_tools or targetos == 'windows' or \
+ config_host.has_key('CONFIG_GPROF')
subdir_done()
endif
+bash = find_program('bash', required: false, version: '>= 4.0')
+if not bash.found()
+ message('bash >= v4.0 not available ==> Disabled the qemu-iotests.')
+ subdir_done()
+endif
+
+foreach cflag: config_host['QEMU_CFLAGS'].split()
+ if cflag.startswith('-fsanitize') and \
+ not cflag.contains('safe-stack') and not cflag.contains('cfi-icall')
+ message('Sanitizers are enabled ==> Disabled the qemu-iotests.')
+ subdir_done()
+ endif
+endforeach
+
qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd]
-qemu_iotests_env = {'PYTHON': python.full_path()}
+qemu_iotests_env = {
+ 'PYTHON': python.full_path(),
+ 'PYTHONUTF8': '1',
+ 'QEMU_CHECK_BLOCK_AUTO': '1'
+}
qemu_iotests_formats = {
'qcow2': 'quick',
'raw': 'slow',
@@ -18,16 +37,25 @@ foreach k, v : emulators
endif
endforeach
+check_script = find_program(meson.current_build_dir() / 'check')
+iotests = run_command(python, [check_script.full_path(), '-g', 'auto', '-n'],
+ check: true).stdout().strip().replace('tests/', '').split('\n')
+
foreach format, speed: qemu_iotests_formats
if speed == 'quick'
suites = 'block'
else
suites = ['block-' + speed, speed]
endif
- test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), format],
- depends: qemu_iotests_binaries, env: qemu_iotests_env,
- protocol: 'tap',
- suite: suites,
- timeout: 0,
- is_parallel: false)
+ foreach tst: iotests
+ test('iotest-' + format + '-' + tst,
+ python, args: [check_script.full_path(), '-tap', '-' + format, tst],
+ depends: qemu_iotests_binaries,
+ env: qemu_iotests_env + \
+ { 'TEST_DIR':
+ meson.current_build_dir() / 'scratch' / format + '-' + tst },
+ protocol: 'tap',
+ suite: suites,
+ timeout: 0)
+ endforeach
endforeach
--
2.27.0
next prev parent reply other threads:[~2022-02-09 10:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 10:15 [PATCH v2 0/8] Improve integration of iotests in the meson test harness Thomas Huth
2022-02-09 10:15 ` [PATCH v2 1/8] tests/qemu-iotests/testrunner: Allow parallel test invocations Thomas Huth
2022-02-11 9:29 ` Kevin Wolf
2022-02-11 9:38 ` Vladimir Sementsov-Ogievskiy
2022-02-11 13:53 ` Thomas Huth
2022-02-11 16:00 ` Kevin Wolf
2022-02-11 16:14 ` Hanna Reitz
2022-02-11 17:32 ` Kevin Wolf
2022-02-09 10:15 ` [PATCH v2 2/8] tests/qemu-iotests: Improve the check for GNU sed Thomas Huth
2022-02-11 8:57 ` Kevin Wolf
2022-02-09 10:15 ` [PATCH v2 3/8] tests/qemu-iotests/meson.build: Improve the indentation Thomas Huth
2022-02-09 10:15 ` [PATCH v2 4/8] tests/qemu-iotests: Allow to run "./check -n" from the source directory, too Thomas Huth
2022-02-09 10:15 ` Thomas Huth [this message]
2022-02-09 10:15 ` [PATCH v2 6/8] tests: Do not treat the iotests as separate meson test target anymore Thomas Huth
2022-02-09 10:15 ` [PATCH v2 7/8] tests/qemu-iotests/testrunner: Print diff to stderr in TAP mode Thomas Huth
2022-02-15 8:36 ` Paolo Bonzini
2022-02-09 10:15 ` [PATCH v2 8/8] tests: Remove check-block.sh Thomas Huth
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=20220209101530.3442837-6-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.