From nobody Mon May 6 07:04:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642285477433916.6833413058998; Sat, 15 Jan 2022 14:24:37 -0800 (PST) Received: from localhost ([::1]:60704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8rTQ-0003A8-Fg for importer@patchew.org; Sat, 15 Jan 2022 17:24:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8rR0-0000LE-Gy; Sat, 15 Jan 2022 17:22:06 -0500 Received: from [2a00:1450:4864:20::32c] (port=34566 helo=mail-wm1-x32c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8rQw-0000ex-FL; Sat, 15 Jan 2022 17:22:06 -0500 Received: by mail-wm1-x32c.google.com with SMTP id bg19-20020a05600c3c9300b0034565e837b6so5603115wmb.1; Sat, 15 Jan 2022 14:21:59 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id s1sm8929616wrv.38.2022.01.15.14.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 14:21:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ltaiY5u20TfA3hXvAel5LXqN/1DsxwrhOAowQF2omaM=; b=TO79unu2eApykPtXNJNx+QQSqjbiOfmdpOUR0jV2L3nCdHpHGr359xwNPxWq8xygVh zCCD49BkjHYQK4b6MlsbsEz2wyQjYO+KufxImS/hE9ZizWLTGbhpR85AxP+VThTZ2sld ILoMTIOF2UOmWTWNsXXJ1llCBl3ZPB/wEHcwi57G2uFxrFX8JtdsczSaxUEMUBg7tzWe qlQ6kcZ1rlALg2DaI/aOkEVMPpXtQ3QrspkgWQPUk8f3xiwPZvtkLS4Qpwi24mU0RQOA mqA+HzeIhEZhWvCNUBgf2OY+HMo4PkNEpvZWwyAGgJ3BGQfuERRdJAFG6D78l0KuVnEZ Pu4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ltaiY5u20TfA3hXvAel5LXqN/1DsxwrhOAowQF2omaM=; b=d9zSGGaUDERp9U7fdpNa3hr7q/P8zleR8qfpCILELk+I0Rl3djN7F2EagoIqb3Od5h S17asrbCCHpKzbabVWVfa4DFlr/hHzyFA1nUkmZKyDPB50VnZ4BK0Nu2vELcdGkomg3G ULRe3yKVYNkTLztdiV17Wp6qYeeXjuA7TVxolpLDmsAO3+ACJV68AKe+lr5hogWz64qE qezdZ5n8Nsot8tg/r6lRMt4q6oXf4/MGKeh3c93gVMOD/cj41LbYo8ivUzHucj9t+pr0 s0v7c93pWtxuZXn5kX8vGAjHapDBDDrYJOvH9+zG0e+cDvGlA/6bXv4w4nLTO3pgNNi/ pkpw== X-Gm-Message-State: AOAM530JlcU4cIggIM32DNKnZ5g4rQo/zvUk6xEzaf6prORKq+zP9e2E EHC+FGOGuMPlW3kNmAQGEV6bDWiFcMg= X-Google-Smtp-Source: ABdhPJwtnzjaNWHo80ufAQW//nE8Ie6LZcpcNsZH9estVJ2VTRI+vIPbhMa3PBj8dT6198lUuCXmMg== X-Received: by 2002:a1c:a747:: with SMTP id q68mr20842103wme.98.1642285318833; Sat, 15 Jan 2022 14:21:58 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/4] scripts/mtest2make: add support for SPEED=thorough Date: Sat, 15 Jan 2022 23:21:51 +0100 Message-Id: <20220115222154.341628-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220115222154.341628-1-pbonzini@redhat.com> References: <20220115222154.341628-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32c (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642285479601100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- meson.build | 5 +++-- scripts/mtest2make.py | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 762d7cee85..c9004bd25e 100644 --- a/meson.build +++ b/meson.build @@ -3,8 +3,9 @@ project('qemu', ['c'], meson_version: '>=3D0.58.2', 'b_staticpic=3Dfalse', 'stdsplit=3Dfalse'], version: files('VERSION')) =20 -add_test_setup('quick', exclude_suites: 'slow', is_default: true) -add_test_setup('slow', env: ['G_TEST_SLOW=3D1', 'SPEED=3Dslow']) +add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: = true) +add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=3D= 1', 'SPEED=3Dslow']) +add_test_setup('thorough', env: ['G_TEST_SLOW=3D1', 'SPEED=3Dthorough']) =20 not_found =3D dependency('', required: false) keyval =3D import('keyval') diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 7067bdadf5..4b9c561b30 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -23,8 +23,9 @@ def names(self, base): print(''' SPEED =3D quick =20 -.speed.quick =3D $(foreach s,$(sort $(filter-out %-slow, $1)), --suite $s) -.speed.slow =3D $(foreach s,$(sort $1), --suite $s) +.speed.quick =3D $(foreach s,$(sort $(filter-out %-slow %-thorough, $1)), = --suite $s) +.speed.slow =3D $(foreach s,$(sort $(filter-out %-thorough, $1)), --suite = $s) +.speed.thorough =3D $(foreach s,$(sort $1), --suite $s) =20 .mtestargs =3D --no-rebuild -t 0 ifneq ($(SPEED), quick) @@ -52,11 +53,14 @@ def process_tests(test, targets, suites): for s in test_suites: # The suite name in the introspection info is "PROJECT:SUITE" s =3D s.split(':')[1] - if s =3D=3D 'slow': + if s =3D=3D 'slow' or s =3D=3D 'thorough': continue if s.endswith('-slow'): s =3D s[:-5] suites[s].speeds.append('slow') + if s.endswith('-thorough'): + s =3D s[:-9] + suites[s].speeds.append('thorough') suites[s].deps.update(deps) =20 def emit_prolog(suites, prefix): --=20 2.33.1 From nobody Mon May 6 07:04:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642285474180989.7367824510444; Sat, 15 Jan 2022 14:24:34 -0800 (PST) Received: from localhost ([::1]:60540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8rTM-00033N-W4 for importer@patchew.org; Sat, 15 Jan 2022 17:24:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8rQz-0000Gx-5p; Sat, 15 Jan 2022 17:22:05 -0500 Received: from [2a00:1450:4864:20::329] (port=36737 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8rQx-0000f6-7i; Sat, 15 Jan 2022 17:22:04 -0500 Received: by mail-wm1-x329.google.com with SMTP id n19-20020a7bc5d3000000b003466ef16375so14884844wmk.1; Sat, 15 Jan 2022 14:22:02 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id s1sm8929616wrv.38.2022.01.15.14.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 14:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xz3nT3jWQgcywI2YlE2go676a3hU6lwY93LUD+M2fZk=; b=LBsZcDDZvUCvnKT8ILrGD3UyMQV9yTmc1nVBhp3hoiqIaIzT/DkhmE03MbU6hZ+e/F PHOv7OZnbae1/7ocLkqlNZ9T2xRjNixxB46jFkpbL55PExI0+4cxJi/Ky5SVbEfZd17u GyImbaLmhEuoyXrmg/EHZSNi2qHMGoxqrE6sJgAgv93LGBhmt1bAF9YNqUt30uhJdL6b FGmgaak/ltf8yYQcvXDMWpEdokvRwyPSyK+ODNBqjj0idr2b7RXjbCwGSSamWV4rT2Je /cZeoNryrK9ND9Pk+cF8IVj0gt9kKl1Dxzd5yyUZWxyfRPn4xXW1ic2cGCMCWyPH9HUG cFsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xz3nT3jWQgcywI2YlE2go676a3hU6lwY93LUD+M2fZk=; b=IJRTaGZlrrYeqoC+ThdtACYgIbQ5jX/If+b40PIRWKfLOtFTbxIc+DtpVwWBZq0Au0 ZUweH7nt2p3dN9E3jsTVZhmaMO2uzhpI3/meap3r6lRvIrAjifyZ8cm809EuZL1iyF2M fTGwssWxrcOTfYQR7BRtAlQmmploLCzBb3j5sxdAru4A9K7vugORBBRwQPCPk6nm4NlP vXShsrihCJYPAUiv4HbDVwTF3b9lDT8YzMoeNvON2zX9dQvYzgvUI1x0/rx4kLRarb2R kcP2q9eoeG6vRzD/GsKdFUWB2Z6OW4UrEtDlq9tDhFPRm6452iPAHXQ3fpypKcdVOmud zGEQ== X-Gm-Message-State: AOAM532tWSILBZQqEb/sQWZUJVgvg3Pn6VYRBTQARGzdrjI1SUE1J2VG UBBRw1sglLQK0QSQu4FaFqt5UH8VBJE= X-Google-Smtp-Source: ABdhPJwwit754RI/iFXwVEV1jnUwrHF+yqM9/4aQ5JTceXOcZCCZOVMVrdOo6oaIWYyHl8kQBEHIwQ== X-Received: by 2002:adf:e40f:: with SMTP id g15mr13263834wrm.600.1642285321556; Sat, 15 Jan 2022 14:22:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/4] build: make check-block a meson test Date: Sat, 15 Jan 2022 23:21:52 +0100 Message-Id: <20220115222154.341628-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220115222154.341628-1-pbonzini@redhat.com> References: <20220115222154.341628-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642285475520100001 Content-Type: text/plain; charset="utf-8" "meson test" can be asked to run tests verbosely; this makes it usable also for qemu-iotests's own harness, and it lets "make check-block" reuse mtest2make.py's infrastructure to find and build test dependencies. Adjust check-block.sh to use the standard exit code that reports a test as skipped. Alternatively, in the future we could make it produce TAP output, which is consistent with all other "make check" tests. Signed-off-by: Paolo Bonzini --- meson.build | 6 +++--- scripts/mtest2make.py | 10 +++++++++- tests/Makefile.include | 16 +++------------- tests/check-block.sh | 28 +++++++++++++--------------- tests/meson.build | 1 + tests/qemu-iotests/meson.build | 29 +++++++++++++++++++++++++++++ 6 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 tests/qemu-iotests/meson.build diff --git a/meson.build b/meson.build index c9004bd25e..229061f971 100644 --- a/meson.build +++ b/meson.build @@ -3,9 +3,9 @@ project('qemu', ['c'], meson_version: '>=3D0.58.2', 'b_staticpic=3Dfalse', 'stdsplit=3Dfalse'], version: files('VERSION')) =20 -add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: = true) -add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=3D= 1', 'SPEED=3Dslow']) -add_test_setup('thorough', env: ['G_TEST_SLOW=3D1', 'SPEED=3Dthorough']) +add_test_setup('quick', exclude_suites: ['block', 'slow', 'thorough'], is_= default: true) +add_test_setup('slow', exclude_suites: ['block', 'thorough'], env: ['G_TES= T_SLOW=3D1', 'SPEED=3Dslow']) +add_test_setup('thorough', exclude_suites: ['block'], env: ['G_TEST_SLOW= =3D1', 'SPEED=3Dthorough']) =20 not_found =3D dependency('', required: false) keyval =3D import('keyval') diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 4b9c561b30..4d542e8aaa 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -79,7 +79,7 @@ def emit_prolog(suites, prefix): print(f'{prefix}-report.junit.xml $(all-{prefix}-xml): {prefix}-report= %.junit.xml: run-ninja') print(f'\t$(MAKE) {prefix}$* MTESTARGS=3D"$(MTESTARGS) --logbase {pref= ix}-report$*" && ln -f meson-logs/$@ .') =20 -def emit_suite(name, suite, prefix): +def emit_suite_deps(name, suite, prefix): deps =3D ' '.join(suite.deps) targets =3D f'{prefix}-{name} {prefix}-report-{name}.junit.xml {prefix= } {prefix}-report.junit.xml' print() @@ -87,6 +87,10 @@ def emit_suite(name, suite, prefix): print(f'ifneq ($(filter {prefix}-build {targets}, $(MAKECMDGOALS)),)') print(f'.{prefix}.build-suites +=3D {name}') print(f'endif') + +def emit_suite(name, suite, prefix): + emit_suite_deps(name, suite, prefix) + targets =3D f'{prefix}-{name} {prefix}-report-{name}.junit.xml {prefix= } {prefix}-report.junit.xml' print(f'ifneq ($(filter {targets}, $(MAKECMDGOALS)),)') print(f'.{prefix}.mtest-suites +=3D ' + ' '.join(suite.names(name))) print(f'endif') @@ -97,6 +101,10 @@ def emit_suite(name, suite, prefix): testsuites =3D defaultdict(Suite) for test in introspect['tests']: process_tests(test, targets, testsuites) +# HACK: check-block is a separate target so that it runs with --verbose; +# only write the dependencies +emit_suite_deps('block', testsuites['block'], 'check') +del testsuites['block'] emit_prolog(testsuites, 'check') for name, suite in testsuites.items(): emit_suite(name, suite, 'check') diff --git a/tests/Makefile.include b/tests/Makefile.include index 4c564cf789..722ff15145 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -156,19 +156,9 @@ check: =20 ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) check: check-block -export PYTHON - -ifneq ($(filter check check-block check-build, $(MAKECMDGOALS)),) -ninja-cmd-goals +=3D \ - qemu-img$(EXESUF) \ - qemu-io$(EXESUF) \ - qemu-nbd$(EXESUF) \ - storage-daemon/qemu-storage-daemon$(EXESUF) \ - $(filter qemu-system-%, $(ninja-targets)) -endif - -check-block: $(SRC_PATH)/tests/check-block.sh run-ninja - @$< +check-block: run-ninja + $(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \ + --logbase iotestslog $(call .speed.$(SPEED), block block-slow block-thor= ough) endif =20 check-build: run-ninja diff --git a/tests/check-block.sh b/tests/check-block.sh index d98d49ad63..9afeea5275 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -1,6 +1,6 @@ #!/bin/sh =20 -# Honor the SPEED environment variable, just like we do it for the qtests. +# Honor the SPEED environment variable, just like we do it for "meson test" if [ "$SPEED" =3D "slow" ]; then format_list=3D"raw qcow2" group=3D @@ -16,9 +16,13 @@ if [ "$#" -ne 0 ]; then format_list=3D"$@" fi =20 +skip() { + echo "$*" + exit 77 +} + if grep -q "CONFIG_GPROF=3Dy" config-host.mak 2>/dev/null ; then - echo "GPROF is enabled =3D=3D> Not running the qemu-iotests." - exit 0 + skip "GPROF is enabled =3D=3D> Not running the qemu-iotests." fi =20 # Disable tests with any sanitizer except for specific ones @@ -36,36 +40,30 @@ for j in ${ALLOWED_SANITIZE_FLAGS}; do done if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then # Have a sanitize flag that is not allowed, stop - echo "Sanitizers are enabled =3D=3D> Not running the qemu-iotests." - exit 0 + skip "Sanitizers are enabled =3D=3D> Not running the qemu-iotests." fi =20 if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then - echo "No qemu-system binary available =3D=3D> Not running the qemu-iot= ests." - exit 0 + skip "No qemu-system binary available =3D=3D> Not running the qemu-iot= ests." fi =20 if ! command -v bash >/dev/null 2>&1 ; then - echo "bash not available =3D=3D> Not running the qemu-iotests." - exit 0 + skip "bash not available =3D=3D> Not running the qemu-iotests." fi =20 if LANG=3DC bash --version | grep -q 'GNU bash, version [123]' ; then - echo "bash version too old =3D=3D> Not running the qemu-iotests." - exit 0 + skip "bash version too old =3D=3D> Not running the qemu-iotests." fi =20 if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then if ! command -v gsed >/dev/null 2>&1; then - echo "GNU sed not available =3D=3D> Not running the qemu-iotests." - exit 0 + skip "GNU sed not available =3D=3D> Not running the qemu-iotests." fi else # Double-check that we're not using BusyBox' sed which says # that "This is not GNU sed version 4.0" ... if sed --version | grep -q 'not GNU sed' ; then - echo "BusyBox sed not supported =3D=3D> Not running the qemu-iotes= ts." - exit 0 + skip "BusyBox sed not supported =3D=3D> Not running the qemu-iotes= ts." fi fi =20 diff --git a/tests/meson.build b/tests/meson.build index 3f3882748a..d5e168d714 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,6 +1,7 @@ py3 =3D import('python').find_installation() =20 subdir('bench') +subdir('qemu-iotests') =20 test_qapi_outputs =3D [ 'qapi-builtin-types.c', diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build new file mode 100644 index 0000000000..94f161d59c --- /dev/null +++ b/tests/qemu-iotests/meson.build @@ -0,0 +1,29 @@ +if have_tools + qemu_iotests_binaries =3D [qemu_img, qemu_io, qemu_nbd, qsd] + qemu_iotests_env =3D {'PYTHON': python.full_path()} + qemu_iotests_formats =3D { + 'raw': 'quick', + 'qcow2': 'slow', + 'qed': 'thorough', + 'vmdk': 'thorough', + 'vpc': 'thorough' + } + + foreach k, v : emulators + if k.startswith('qemu-system-') + qemu_iotests_binaries +=3D v + endif + endforeach + foreach format, speed: qemu_iotests_formats + if speed =3D=3D 'quick' + suites =3D 'block' + else + suites =3D ['block-' + speed, speed] + endif + test('qemu-iotests ' + format, sh, args: [files('../check-block.sh'), = format], + depends: qemu_iotests_binaries, env: qemu_iotests_env, + suite: suites, + timeout: 0, + is_parallel: false) + endforeach +endif --=20 2.33.1 From nobody Mon May 6 07:04:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642285600550305.46885863527484; Sat, 15 Jan 2022 14:26:40 -0800 (PST) Received: from localhost ([::1]:38834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8rVP-0007lZ-K7 for importer@patchew.org; Sat, 15 Jan 2022 17:26:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8rR0-0000Kr-Bz; Sat, 15 Jan 2022 17:22:06 -0500 Received: from [2a00:1450:4864:20::330] (port=50916 helo=mail-wm1-x330.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8rQy-0000fO-6y; Sat, 15 Jan 2022 17:22:06 -0500 Received: by mail-wm1-x330.google.com with SMTP id w26so12865537wmi.0; Sat, 15 Jan 2022 14:22:03 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id s1sm8929616wrv.38.2022.01.15.14.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 14:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NPHfXnowRQD2+TFf0g2fYmXJjkrHfOL9fmenURj2Zdw=; b=XOVyJZ81s3d/nm+zzWqSgHNWcNIXy1w/PGgvbPHDlH5y+5YUVE5J0LGL9K4NrK1ea1 LchfnesOFS93ALU01tMZNN2KSqxcgB4FcDqzMh9NQiCffrIzKq1qLinn/yqOWF142xBz 3bWTTPWAXXAH+Bqcx1UtyDOXmwDIPQeZhR0lwfbOc4uPiPEBNAkXsHi9ZMhzmHf9zDD1 oV39rG5O9s36ddhmrVAUaR9MGe7oE6ALfv3RZNyK8a3rAuKSPdw7afUx+1RYAJY88IVV 8H2QmGB5hNOwa8ukicw/A793ibifKDfeonmOcKntaz9sDTmnJBYhxZD71Dio0oReOSbT LLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NPHfXnowRQD2+TFf0g2fYmXJjkrHfOL9fmenURj2Zdw=; b=nNhvxFpJU5cmafbtXHk2GymKqDVQ7GjjXgxxLCwf5i/Jss3gVQoaT0ep3ggHhDiY/9 b6LYHby0MGxrVCKbkGNeWQnSPsHAtjUtLnrjFeN60Z5m1QdNuaIkYm9JfbbuSN3X/70W +7th7q35ENtuZJ+Srq96AxkkQsmjngsCldGTVDnPS8z0YMgudlRJpreOnDpZrmcZq/s4 pBgN3y4+81+cO4wTeCY8sIrdWlrQcv36SNZL2A76E2OyQakE9Ro0BrqgkczhY242ulXP JUs3fmqE4+We+seRuvVDdzesFqA1FdexB2s1JQihsC8Ozmo79mSI/k9zUArHDWATBDQN hTjg== X-Gm-Message-State: AOAM533uBLcE/xLpHjm7qzhlpU1GmvaRC64oKcr8I9/wJV41tOSFi7De VIk8hCSawH7kfDVX/Qzxap0s8Ku4W3U= X-Google-Smtp-Source: ABdhPJz7mHTIxovRjJ05Uxvuyr8zO8BXDVpjC8YEoUYZmCexDi0ydH+IZI0H4WJbJR9TaYpKFUwHgw== X-Received: by 2002:a05:6000:186e:: with SMTP id d14mr2857794wri.67.1642285322727; Sat, 15 Jan 2022 14:22:02 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/4] qemu-iotests: require at least an argument to check-block.sh Date: Sat, 15 Jan 2022 23:21:53 +0100 Message-Id: <20220115222154.341628-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220115222154.341628-1-pbonzini@redhat.com> References: <20220115222154.341628-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::330 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642285601630100001 Content-Type: text/plain; charset="utf-8" This is anyway how check-block.sh is used in practice, and by removing the list of formats in the script we avoid duplication between meson.build and check-block.sh. Signed-off-by: Paolo Bonzini --- tests/check-block.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/check-block.sh b/tests/check-block.sh index 9afeea5275..88e02453d2 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -1,19 +1,16 @@ #!/bin/sh =20 -# Honor the SPEED environment variable, just like we do it for "meson test" -if [ "$SPEED" =3D "slow" ]; then - format_list=3D"raw qcow2" - group=3D -elif [ "$SPEED" =3D "thorough" ]; then - format_list=3D"raw qcow2 qed vmdk vpc" - group=3D -else - format_list=3Dqcow2 - group=3D"-g auto" +if [ "$#" -eq 0 ]; then + echo "Usage: $0 fmt..." >&2 + exit 99 fi =20 -if [ "$#" -ne 0 ]; then - format_list=3D"$@" +# Honor the SPEED environment variable, just like we do it for "meson test" +format_list=3D"$@" +if [ "$SPEED" =3D "slow" ] || [ "$SPEED" =3D "thorough" ]; then + group=3D +else + group=3D"-g auto" fi =20 skip() { --=20 2.33.1 From nobody Mon May 6 07:04:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642285795153863.9165851429366; Sat, 15 Jan 2022 14:29:55 -0800 (PST) Received: from localhost ([::1]:41384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8rYX-0001aR-3p for importer@patchew.org; Sat, 15 Jan 2022 17:29:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8rR2-0000PM-AC; Sat, 15 Jan 2022 17:22:08 -0500 Received: from [2a00:1450:4864:20::329] (port=51825 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8rR0-0000fi-BP; Sat, 15 Jan 2022 17:22:07 -0500 Received: by mail-wm1-x329.google.com with SMTP id c2so7321972wml.1; Sat, 15 Jan 2022 14:22:05 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id s1sm8929616wrv.38.2022.01.15.14.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 14:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6+8Mbmt4uw5C3ZGusBCtOvKEzFddtkXtYDdwc2TpqSM=; b=l3tEPzqeaYwC0+tOrArpBF3/ssaLkNLZsSfz4ZyiUbErpxGkv+4ycFqFpxxhCR7R7v V1AEROce14Vz4pimoiOOMeu+z5bXhE2vFwpxrH5kB4dXTU1Q82XATh0Zqgr7B803GBXZ adYGcA8URzGUmnhadGaexDKQ1re/LSC3tj01Qzzd/0XuWheaWBibNcmXt4WJCPfKj/tf 6RUrOg2GgFzJ0oomcY0YmzTu2fbDvEZyPhXjmZdmEUIu30lW29iBAQGyJrhXVQoHURnu 8ef/vN4ZGTRa6S5GPx63MIEpDptDKX3F/3kEt2s3zuJzpetPuy5rMR+4l7RKS9QGoEyW PEAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6+8Mbmt4uw5C3ZGusBCtOvKEzFddtkXtYDdwc2TpqSM=; b=1zVPACtyHnuTLsz6olOvJhia96rb0nSTWymvxq08qYwdB0lq/3gxPkPPdlIXlWqDcz MAPfj/M0Fwj353TbpBNkRcTXI73K4lkpFtZfBAZ+ONeO/9QE/X+gRIjXYaf3Lo7ZevML CX2D5IBVFOhNPL3rStBvZpxNZvTnv0+jO51l6bnHi+EWivQPz51omTOEzEYwxnBdBmiD 0B2kJEyrCWw04wO68iG7MOHOxmjReBI+quq6eCrd81qn/CRXueJUrbg3l3iQ/pUq/WJ0 PwTgCEMsiVtxA5upfiWKpwR2f6m6dD9uPWZMIumAoHxwdJnyjkXcU3wXfuYD0+2h3n4V JZdg== X-Gm-Message-State: AOAM5333YTu0wd6S1+VTHtheDd/Kz1pNH266YzckP7MZ8xg5K3h+W2Qy HVXA1PNpKpSHKaO6FJdTLldFa24y7z0= X-Google-Smtp-Source: ABdhPJwhFREhKzcNCmHwNCHCE7vFd9OdLgOUR14oX6AEXG8/yWaEHu0Nv+n6YBhSloFhl+rAmK0vMg== X-Received: by 2002:a5d:6f09:: with SMTP id ay9mr14065816wrb.572.1642285324643; Sat, 15 Jan 2022 14:22:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 4/4] check-block: replace -makecheck with TAP output Date: Sat, 15 Jan 2022 23:21:54 +0100 Message-Id: <20220115222154.341628-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220115222154.341628-1-pbonzini@redhat.com> References: <20220115222154.341628-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642285796121100001 Content-Type: text/plain; charset="utf-8" Let "meson test" take care of showing the results of the individual tests, consistently with other output from "make check V=3D1". Signed-off-by: Paolo Bonzini --- tests/check-block.sh | 6 ++-- tests/qemu-iotests/check | 6 ++-- tests/qemu-iotests/meson.build | 1 + tests/qemu-iotests/testenv.py | 30 +++++++++---------- tests/qemu-iotests/testrunner.py | 49 +++++++++++++++++--------------- 5 files changed, 48 insertions(+), 44 deletions(-) diff --git a/tests/check-block.sh b/tests/check-block.sh index 88e02453d2..720a46bc36 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -14,8 +14,8 @@ else fi =20 skip() { - echo "$*" - exit 77 + echo "1..0 #SKIP $*" + exit 0 } =20 if grep -q "CONFIG_GPROF=3Dy" config-host.mak 2>/dev/null ; then @@ -79,7 +79,7 @@ JOBS=3D$(echo "$MAKEFLAGS" | sed -n 's/\(^\|.* \)-j\([0-9= ]\+\)\( .*\|$\)/-j \2/p') =20 ret=3D0 for fmt in $format_list ; do - ${PYTHON} ./check $JOBS -makecheck -$fmt $group || ret=3D1 + ${PYTHON} ./check $JOBS -tap -$fmt $group || ret=3D1 done =20 exit $ret diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 0c27721a41..75de1b4691 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -32,8 +32,6 @@ def make_argparser() -> argparse.ArgumentParser: =20 p.add_argument('-n', '--dry-run', action=3D'store_true', help=3D'show me, do not run tests') - p.add_argument('-makecheck', action=3D'store_true', - help=3D'pretty print output for make check') p.add_argument('-j', dest=3D'jobs', type=3Dint, default=3D1, help=3D'run tests in multiple parallel jobs') =20 @@ -53,6 +51,8 @@ def make_argparser() -> argparse.ArgumentParser: p.add_argument('--color', choices=3D['on', 'off', 'auto'], default=3D'auto', help=3D"use terminal colors. The defa= ult " "'auto' value means use colors if terminal stdout detec= ted") + p.add_argument('-tap', action=3D'store_true', + help=3D'produce TAP output') =20 g_env =3D p.add_argument_group('test environment options') mg =3D g_env.add_mutually_exclusive_group() @@ -164,7 +164,7 @@ if __name__ =3D=3D '__main__': if args.dry_run: print('\n'.join(tests)) else: - with TestRunner(env, makecheck=3Dargs.makecheck, + with TestRunner(env, tap=3Dargs.tap, color=3Dargs.color) as tr: paths =3D [os.path.join(env.source_iotests, t) for t in tests] ok =3D tr.run_tests(paths, args.jobs) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 94f161d59c..319a3872ef 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -22,6 +22,7 @@ if have_tools 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) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index c33454fa68..0f32897fe8 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -287,21 +287,21 @@ def __enter__(self) -> 'TestEnv': def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> N= one: self.close() =20 - def print_env(self) -> None: + def print_env(self, prefix: str =3D '') -> None: template =3D """\ -QEMU -- "{QEMU_PROG}" {QEMU_OPTIONS} -QEMU_IMG -- "{QEMU_IMG_PROG}" {QEMU_IMG_OPTIONS} -QEMU_IO -- "{QEMU_IO_PROG}" {QEMU_IO_OPTIONS} -QEMU_NBD -- "{QEMU_NBD_PROG}" {QEMU_NBD_OPTIONS} -IMGFMT -- {IMGFMT}{imgopts} -IMGPROTO -- {IMGPROTO} -PLATFORM -- {platform} -TEST_DIR -- {TEST_DIR} -SOCK_DIR -- {SOCK_DIR} -GDB_OPTIONS -- {GDB_OPTIONS} -VALGRIND_QEMU -- {VALGRIND_QEMU} -PRINT_QEMU_OUTPUT -- {PRINT_QEMU} -""" +{prefix}QEMU -- "{QEMU_PROG}" {QEMU_OPTIONS} +{prefix}QEMU_IMG -- "{QEMU_IMG_PROG}" {QEMU_IMG_OPTIONS} +{prefix}QEMU_IO -- "{QEMU_IO_PROG}" {QEMU_IO_OPTIONS} +{prefix}QEMU_NBD -- "{QEMU_NBD_PROG}" {QEMU_NBD_OPTIONS} +{prefix}IMGFMT -- {IMGFMT}{imgopts} +{prefix}IMGPROTO -- {IMGPROTO} +{prefix}PLATFORM -- {platform} +{prefix}TEST_DIR -- {TEST_DIR} +{prefix}SOCK_DIR -- {SOCK_DIR} +{prefix}GDB_OPTIONS -- {GDB_OPTIONS} +{prefix}VALGRIND_QEMU -- {VALGRIND_QEMU} +{prefix}PRINT_QEMU_OUTPUT -- {PRINT_QEMU} +{prefix}""" =20 args =3D collections.defaultdict(str, self.get_env()) =20 @@ -310,5 +310,5 @@ def print_env(self) -> None: =20 u =3D os.uname() args['platform'] =3D f'{u.sysname}/{u.machine} {u.nodename} {u.rel= ease}' - + args['prefix'] =3D prefix print(template.format_map(args)) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 15788f919e..0eace147b8 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -152,10 +152,10 @@ def run_tests_pool(self, tests: List[str], =20 return results =20 - def __init__(self, env: TestEnv, makecheck: bool =3D False, + def __init__(self, env: TestEnv, tap: bool =3D False, color: str =3D 'auto') -> None: self.env =3D env - self.makecheck =3D makecheck + self.tap =3D tap self.last_elapsed =3D LastElapsedTime('.last-elapsed-cache', env) =20 assert color in ('auto', 'on', 'off') @@ -185,13 +185,16 @@ def test_print_one_line(self, test: str, """ Print short test info before/after test run """ test =3D os.path.basename(test) =20 - if self.makecheck and status !=3D '...': - if status and status !=3D 'pass': - status =3D f' [{status}]' - else: - status =3D '' + if test_field_width is None: + test_field_width =3D 8 =20 - print(f' TEST iotest-{self.env.imgfmt}: {test}{status}') + if self.tap: + if status =3D=3D 'pass': + print(f'ok {self.env.imgfmt} {test}') + elif status =3D=3D 'fail': + print(f'not ok {self.env.imgfmt} {test}') + elif status =3D=3D 'not run': + print(f'ok {self.env.imgfmt} {test} # SKIP') return =20 if lasttime: @@ -343,7 +346,7 @@ def run_test(self, test: str, last_el =3D self.last_elapsed.get(test) start =3D datetime.datetime.now().strftime('%H:%M:%S') =20 - if not self.makecheck: + if not self.tap: self.test_print_one_line(test=3Dtest, test_field_width=3Dtest_field_width, status =3D 'started' if mp else '...', @@ -372,7 +375,9 @@ def run_tests(self, tests: List[str], jobs: int =3D 1) = -> bool: notrun =3D [] casenotrun =3D [] =20 - if not self.makecheck: + if self.tap: + self.env.print_env('# ') + else: self.env.print_env() =20 test_field_width =3D max(len(os.path.basename(t)) for t in tests) = + 2 @@ -398,8 +403,6 @@ def run_tests(self, tests: List[str], jobs: int =3D 1) = -> bool: =20 if res.status =3D=3D 'fail': failed.append(name) - if self.makecheck: - self.env.print_env() if res.diff: print('\n'.join(res.diff)) elif res.status =3D=3D 'not run': @@ -412,16 +415,16 @@ def run_tests(self, tests: List[str], jobs: int =3D 1= ) -> bool: if res.interrupted: break =20 - if notrun: - print('Not run:', ' '.join(notrun)) + if not self.tap: + if notrun: + print('Not run:', ' '.join(notrun)) =20 - if casenotrun: - print('Some cases not run in:', ' '.join(casenotrun)) + if casenotrun: + print('Some cases not run in:', ' '.join(casenotrun)) =20 - if failed: - print('Failures:', ' '.join(failed)) - print(f'Failed {len(failed)} of {n_run} iotests') - return False - else: - print(f'Passed all {n_run} iotests') - return True + if failed: + print('Failures:', ' '.join(failed)) + print(f'Failed {len(failed)} of {n_run} iotests') + else: + print(f'Passed all {n_run} iotests') + return not failed --=20 2.33.1