From nobody Tue Feb 10 12:59:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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 ARC-Seal: i=1; a=rsa-sha256; t=1657472855; cv=none; d=zohomail.com; s=zohoarc; b=Gszif9QFbYIc95fdcyt9kpvgL+qlNp8ibQpymMYdDsnoYkeFOQ/i952q6vxBRlD54rnxCXluJCBO44O4agiPu0/afL/FvSgxmWJtyTvl2yRp8E8hCAh0NLKFi4G5XxzQKmv5WrpUsFccNk1x209tYpK+ip0HCjOXcfJUNLVH/Nw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657472855; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tBe6RKRbi5QkFNalJayEoxBpVJ/vYkp2hV9cPSW8tWU=; b=I2Vf9SzuVBzR2FQytHCei8x4AFlJ4JxCU3sVsG8x3BE+IUJWml4i4RinMSLCrxmqp4sBauQhOIONl6asRA3WJqUCrid4vTSgC7EvYWU1EpuzWGk1VeNponbc5n+3Rx30GseD6sH8XQWW90yySRCQtXM8gCYkMfOp2jnHJGt5aBc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657472855616493.17685641575804; Sun, 10 Jul 2022 10:07:35 -0700 (PDT) Received: from localhost ([::1]:43782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAaP8-00060t-AL for importer@patchew.org; Sun, 10 Jul 2022 13:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAaJY-0007QL-6h for qemu-devel@nongnu.org; Sun, 10 Jul 2022 13:01:48 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:36355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAaJW-0003RZ-Bl for qemu-devel@nongnu.org; Sun, 10 Jul 2022 13:01:47 -0400 Received: by mail-pj1-x1034.google.com with SMTP id z12-20020a17090a7b8c00b001ef84000b8bso6242265pjc.1 for ; Sun, 10 Jul 2022 10:01:46 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.107.107]) by smtp.googlemail.com with ESMTPSA id u14-20020a17090341ce00b0016c19417495sm2930596ple.239.2022.07.10.10.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 10:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tBe6RKRbi5QkFNalJayEoxBpVJ/vYkp2hV9cPSW8tWU=; b=eaiQK+0OIK6V9RSC7QixbETEeVNXsfB4AVW0CmP7rEBYGrnHgYtMsd2Pehk6UL71rW UGysn4Zyz7rxaguVi6fMKErEof08KS5j7E60+mOUR6fMlbFND2fjC+a+uei5Rs6agQ2o DB1F0EoG2V7AwEmMLhVeV8YDmJoaTnbJpP1YaYYpyQAWlVqmXlxERLbiTJXArSpOD+Jh lO62l8uESyPVR3v1c1MN9S5VQw8PNIt0xgNuH/TRrKXfnTp4EgQtrvXtluDjNkw+PqMz 32GDd5rBv2JVb6x2lK1gfBoDWfN28Yig+3dimEgqdLuWUgfcnmRxtwWel6mZWTZXKQ70 5H3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tBe6RKRbi5QkFNalJayEoxBpVJ/vYkp2hV9cPSW8tWU=; b=HjaCXxZHCWRRrTjG6mvkVXsGOG23piGCoSeHQR2KmHzOxhmDohZcmudthBQoSp0R/D DCPIfpjRdGqpMJKgthz0+93Zna1cfR0gVTDUpxD+fwn+Veo5zB8d86URzrvCzf+ageMt 4sZj/Qf5pw2hDQ9Itp87fBw1Tbw24N8/FtVjeCI+ZG/sRjB5D2HtsQEzLpU5pHPBT9r0 fub2cY7lPCC+zEXsm34KEiZjjevcLQ1L3sXbDiFqUdSyfR3ekuNJG1ltHDOhbZR8RpRD RFXftmXhy6/RZHvA/2cmmlceN1VUsNKI/OyfR7pi8Q0InlRNEBM819UKFYzXCKyjONgW biYg== X-Gm-Message-State: AJIora+afv3n0/SjFpqRw8tJHZxHVmuDNVLH7zWlkB19XrBOvavltIo5 zdYtajr2N0VgFJjQUEuim0f9yN/vw/dtJ4Za X-Google-Smtp-Source: AGRyM1sDkbb29AE1SG5w/dQULWS11YcvC7Bqt5QKiPy/ty6uBBlgSxXsdB5K3VnyorWJLNDi8EinyQ== X-Received: by 2002:a17:902:cf4b:b0:16c:4634:72 with SMTP id e11-20020a170902cf4b00b0016c46340072mr1757964plg.15.1657472504844; Sun, 10 Jul 2022 10:01:44 -0700 (PDT) From: Ani Sinha To: qemu-devel@nongnu.org Cc: thuth@redhat.com, peter.maydell@linaro.org, berrange@redhat.com, jsnow@redhat.com, pbonzini@redhat.com, imammedo@redhat.com, mst@redhat.com, Ani Sinha Subject: [PATCH v2 10/11] pytest: add pytest to the meson build system Date: Sun, 10 Jul 2022 22:30:13 +0530 Message-Id: <20220710170014.1673480-11-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710170014.1673480-1-ani@anisinha.ca> References: <20220710170014.1673480-1-ani@anisinha.ca> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: none client-ip=2607:f8b0:4864:20::1034; envelope-from=ani@anisinha.ca; helo=mail-pj1-x1034.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @anisinha-ca.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1657472856799100001 Content-Type: text/plain; charset="utf-8" Integrate the pytest framework with the meson build system. This will make = meson run all the pytests under the pytest directory. Signed-off-by: Ani Sinha --- tests/Makefile.include | 4 +++- tests/meson.build | 1 + tests/pytest/meson.build | 49 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/pytest/meson.build diff --git a/tests/Makefile.include b/tests/Makefile.include index 3accb83b13..40755a6bd1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -3,12 +3,14 @@ .PHONY: check-help check-help: @echo "Regression testing targets:" - @echo " $(MAKE) check Run block, qapi-schema, unit, soft= float, qtest and decodetree tests" + @echo " $(MAKE) check Run block, qapi-schema, unit, soft= float, qtest, pytest and decodetree tests" @echo " $(MAKE) bench Run speed tests" @echo @echo "Individual test suites:" @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-pytest Run pytest tests" + @echo " $(MAKE) check-pytest-TARGET Run pytest for a given target" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" diff --git a/tests/meson.build b/tests/meson.build index 8e318ec513..f344cbdc6c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -93,3 +93,4 @@ subdir('unit') subdir('qapi-schema') subdir('qtest') subdir('migration') +subdir('pytest') diff --git a/tests/pytest/meson.build b/tests/pytest/meson.build new file mode 100644 index 0000000000..e60d481ae4 --- /dev/null +++ b/tests/pytest/meson.build @@ -0,0 +1,49 @@ +slow_pytests =3D { + 'acpi-bits' : 120, +} + +pytests_generic =3D [] + +# biosbits tests are currenly only supported on x86_64 platforms. +pytests_x86_64 =3D ['acpi-bits-test'] + +pytest_executables =3D {} +other_deps =3D [] + +subdir('acpi-bits') + +foreach dir : target_dirs + if not dir.endswith('-softmmu') + continue + endif + + target_base =3D dir.split('-')[0] + pytest_emulator =3D emulators['qemu-system-' + target_base] + target_pytests =3D get_variable('pytests_' + target_base, []) + pytests_= generic + + test_deps =3D roms + pytest_env =3D environment() + if have_tools + pytest_env.set('QTEST_QEMU_IMG', './qemu-img') + test_deps +=3D [qemu_img] + endif + pytest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'test= s/dbus-vmstate-daemon.sh') + pytest_env.set('PYTEST_QEMU_BINARY', './qemu-system-' + target_base) + pytest_env.set('PYTEST_SOURCE_ROOT', meson.project_source_root()) + if have_tools and have_vhost_user_blk_server + pytest_env.set('PYTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/= qemu-storage-daemon') + test_deps +=3D [qsd] + endif + + foreach test : target_pytests + test('pytest-@0@/@1@'.format(target_base, test), + pytest_executables[test], + depends: [test_deps, pytest_emulator, emulator_modules, other_dep= s], + env: pytest_env, + args: ['--tap', '-k'], + protocol: 'tap', + timeout: slow_pytests.get(test, 30), + priority: slow_pytests.get(test, 30), + suite: ['pytest', 'pytest-' + target_base]) + endforeach +endforeach --=20 2.25.1