From patchwork Sun Feb 20 00:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Quaresma X-Patchwork-Id: 3854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4E55C433EF for ; Sun, 20 Feb 2022 00:08:53 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web11.16500.1645315732461117216 for ; Sat, 19 Feb 2022 16:08:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QZbEf9cz; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: quaresma.jose@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id p9so20581943wra.12 for ; Sat, 19 Feb 2022 16:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GdnE8hc6dp6Vwb/dtlNEptawNJeaVI0HqKjxWXhsxLM=; b=QZbEf9czmbl8rIgtkQYVpB91ko50QCnnKoUVy3MaBFRMv1Gd94VZXrqmxpbpfMLOnP F9LLiwaVL9Pj2ak1zL5BpXQ5KxEYXYE3A/D1ahbsb5c0QKa5HbYRvg+XwkGF0pigvXvt tL666QZaqEYWe8cGQ0cNRp3JksGP6iB8LXr42MxNRx0UUzKYXFGEl66KusZyjrYAG9GR T+RIYxRus8tlkp5EmQI07tnON16FI+Nf4NP+StSfVQY3hTgTs885r0Inj9EFLAIGAilX ap6+vJ3b37ZkAsQ3NZrXvgn1lI/iRTrksICrqH0bdxhmUZulKmdCoPWYiIFFe4q6KobV hYKg== 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:mime-version :content-transfer-encoding; bh=GdnE8hc6dp6Vwb/dtlNEptawNJeaVI0HqKjxWXhsxLM=; b=q+O0wDsBnppck8d8MAsj8ylC4wO/Y/+VyFIUi0RJbYCtvr0UZWegIoaPdCN1rf6R5d A+ZrFam2Zz+Kt54dCr6Ys+czpZ8hWR4xAd7qb+lapH/9uo9DUkMjWOPJ1K9u4QxYNgfJ IF91isKKRkUr0w3yk91KxjgwwWNZF1R4sCmWBo9gQ45UIblsAoSwN9d8Jf8ihArz6N8I FFFp42iZ/pjpPdZuX5K9sTzagDiqCeV6vMfdd45BQFM5HKFMMVxXh1nRgOMIMCxa1jmo 6wNJUAKo8ot79bF4AHB8UPx/r2Qf3cR/ghl6/hLm8bBVI9XsuxfT5pKHMS4wCAH6+U6V fwRg== X-Gm-Message-State: AOAM532Ib0z7e6goWZnnY7Lp5Op5vvXOXLwa+0n5b8PDEG2MAanCKBZw xmxIMp6xd7h4ALM3guKjqwRmhwLOVVg= X-Google-Smtp-Source: ABdhPJwW8nXnOrD1DMcBHQzKMQomUzQAwMQVKJubDsNUOA0VnTPLWQJBnHzhReBHA1v2vOd7M/pYUA== X-Received: by 2002:adf:fbc4:0:b0:1e7:2060:d65 with SMTP id d4-20020adffbc4000000b001e720600d65mr10180576wrs.583.1645315730520; Sat, 19 Feb 2022 16:08:50 -0800 (PST) Received: from CTW-01195.lan (176.57.115.89.rev.vodafone.pt. [89.115.57.176]) by smtp.gmail.com with ESMTPSA id t2sm27446026wrr.55.2022.02.19.16.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 16:08:49 -0800 (PST) From: Jose Quaresma To: openembedded-core@lists.openembedded.org Cc: Jose Quaresma Subject: [PATCH 1/2] meson.bbclass: add support for running the meson tests at build time Date: Sun, 20 Feb 2022 00:08:04 +0000 Message-Id: <20220220000805.1567335-1-quaresma.jose@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 20 Feb 2022 00:08:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161977 The generic exe_wrapper introcuced in 40349dc5 can be used to run the meson tests when build the receipe. This patch add the meson_test task on the meson bbclass that adds this possibility. The exe_wrapper will run using the qemu usermode and because of that it has some limitations, one big limitation that causes many test to fail is that it don't support the fork system call. So don't expect the same results when it runs natively on target. Running the tests at build time is upstream way for testing but is not possible in OE as we always croos-compile. This can be useful in some integration processes and for debuging and it adds the possibility to run the test in an interactive way using the devtool build for example. There are two variable for that: MESON_QEMU_WRAPPER_TEST_ENABLED: this enables the test when it's "1" EXTRA_OEMESON_TEST: this is used to add extra args Some results when using this patch in the bigest meson project on OE-core are the folloing: cat <<'EOF' >>conf/local.conf MESON_QEMU_WRAPPER_TEST_ENABLED:pn-systemd-boot = "1" EOF bitbake -c do_meson_test -v systemd-boot Ok: 821 Expected Fail: 0 Fail: 95 Unexpected Pass: 0 Skipped: 33 Timeout: 0 cat <<'EOF' >>conf/local.conf MESON_QEMU_WRAPPER_TEST_ENABLED:pn-glib-2.0 = "1" EOF bitbake -c do_meson_test -v glib-2.0 Ok: 197 Expected Fail: 0 Fail: 76 Unexpected Pass: 0 Skipped: 0 Timeout: 2 cat <<'EOF' >>conf/local.conf MESON_QEMU_WRAPPER_TEST_ENABLED:pn-gstreamer1.0 = "1" EOF bitbake -c do_meson_test -v gstreamer1.0 Ok: 95 Expected Fail: 0 Fail: 10 Unexpected Pass: 0 Skipped: 1 Timeout: 0 Signed-off-by: Jose Quaresma --- meta/classes/meson.bbclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 0bfe945811..bc15cb8163 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -179,3 +179,19 @@ meson_do_install() { } EXPORT_FUNCTIONS do_configure do_compile do_install + +EXTRA_OEMESON_TEST ?= "" + +do_meson_test() { + bbwarn "don't expect the same results when it runs natively as it will run in qemu usermode (that has its own limitations)" + meson test -C ${B} ${EXTRA_OEMESON_TEST} +} +do_meson_test[vardeps] += "EXTRA_OEMESON_TEST" + +MESON_QEMU_WRAPPER_RUNTEST = "" +MESON_QEMU_WRAPPER_RUNTEST:class-target = "${@d.getVar('MESON_QEMU_WRAPPER_TEST_ENABLED') == '1' and d.getVar('EXEWRAPPER_ENABLED') == 'True'}" + +python() { + if d.getVar('MESON_QEMU_WRAPPER_RUNTEST') == 'True': + bb.build.addtask('meson_test', None, 'do_compile', d) +} From patchwork Sun Feb 20 00:08:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Quaresma X-Patchwork-Id: 3855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C428C433FE for ; Sun, 20 Feb 2022 00:08:54 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web09.16479.1645315733356400053 for ; Sat, 19 Feb 2022 16:08:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lFfjDaP+; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: quaresma.jose@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id k1so20632704wrd.8 for ; Sat, 19 Feb 2022 16:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q4f8dYNxTs9HKaMpHCflJNWQl1dR+PiIbL97aKWkgzk=; b=lFfjDaP+UvF13tUUHFZwDxBSwZYTURQtqxLPHu28jTc/+fRSq9i5cUBDedG7kVCVjj HpBZ0Tj7uzxX2xsDj4oCH5j+cQnhN5F6ra2gX6wXI6ANxGdekOSX2CSXjtRASGc2oJ0K IS2GvtZ7vWUb1K7/LdFwUGOlExgcz0BsrXP1xTlfGEyJ+SaOmMftfgZw1+Be6r1qLyIv Veo2oj7EwhNggfJYFz0bctXHDr7jqeyafczjKVBlzxT426s2ez+FEI1BNl73016nt5OA YnLwr7pCBcNQOr3XDu2LM/bUDLKEFTSrMsnAu3KQBz3diDrqbgl8gRnRb26pGVqmbelM UGVA== 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=q4f8dYNxTs9HKaMpHCflJNWQl1dR+PiIbL97aKWkgzk=; b=RGerThztZp5yr21o50yySbtNq+3UWbIGjsW4kPYyiRE5oe6sZkVO0pQse/eM25letR wZkEBV+eMm+fojLOQRYPjhgJvrPOG8tL+TTIdmMCxuTUCMjdCNhcppscbzKXjOfGBMwS uvFAk26MsWg+6IEk9QMs3feOyZa30RgZZzvtdnPHyt2dskeCThihbY6/+Ghk+BJsSfx5 WUtP/LfqEDBnMeVG7rz/VzF6hUpMRlEfreAFEA76b8VQkocZN9g83W5lKfEETQA83wve Ceys/VQ8229gK0KP72PfJSl2CTGZbPV2zHQBJOCo4z7nFZufVFBbATvWWDzJWz/WrVT3 0/Qg== X-Gm-Message-State: AOAM530zj96J41RFSSRYf2SmFPQZTmIcn6wJoFNNyEKLfXVV2IvAHFFS jsTxI6G2NQRqSfB/irurAYsjWfaZJdg= X-Google-Smtp-Source: ABdhPJxrTHM51EPvzSUgPw/U3gSSrvBqW8A12R/BP+OXhd3XATw41VaOLrIoU2vxMDPYXUpZFzxvog== X-Received: by 2002:a05:6000:2aa:b0:1e3:d43:f5c with SMTP id l10-20020a05600002aa00b001e30d430f5cmr10570619wry.178.1645315731534; Sat, 19 Feb 2022 16:08:51 -0800 (PST) Received: from CTW-01195.lan (176.57.115.89.rev.vodafone.pt. [89.115.57.176]) by smtp.gmail.com with ESMTPSA id t2sm27446026wrr.55.2022.02.19.16.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 16:08:50 -0800 (PST) From: Jose Quaresma To: openembedded-core@lists.openembedded.org Cc: Jose Quaresma Subject: [PATCH 2/2] meson.bbclass: add exe_wrapper helper Date: Sun, 20 Feb 2022 00:08:05 +0000 Message-Id: <20220220000805.1567335-2-quaresma.jose@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220220000805.1567335-1-quaresma.jose@gmail.com> References: <20220220000805.1567335-1-quaresma.jose@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 20 Feb 2022 00:08:54 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161978 When we use the exe_wrapper to run the tests we need a way to circumvent the limitations of qemu usermode. So for example we can skip the tests we know will fail. The ideia of this help script is to handle such cases before the qemu usermode was launched. Signed-off-by: Jose Quaresma --- meta/classes/meson.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index bc15cb8163..11c6b403f0 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -114,6 +114,8 @@ cpp_link_args = ${@meson_array('BUILD_LDFLAGS', d)} EOF } +MESON_QEMU_WRAPPER_HELPER ?= "" + do_write_config:append:class-target() { # Write out a qemu wrapper that will be used as exe_wrapper so that meson # can run target helper binaries through that. @@ -127,10 +129,14 @@ export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy # meson sets this wrongly (only to libs in build-dir), qemu_wrapper_cmdline() and GIR_EXTRA_LIBS_PATH take care of it properly unset LD_LIBRARY_PATH +# import any customization provided in the helper +test -f "${MESON_QEMU_WRAPPER_HELPER}" && . ${MESON_QEMU_WRAPPER_HELPER} + $qemu_binary "\$@" EOF chmod +x ${WORKDIR}/meson-qemuwrapper } +do_write_config:class-target[vardeps] += "MESON_QEMU_WRAPPER_HELPER" # Tell externalsrc that changes to this file require a reconfigure CONFIGURE_FILES = "meson.build"