From patchwork Thu Apr 27 05:20:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RnLDqWTDqXJpYyBNYXJ0aW5zb25z?= X-Patchwork-Id: 23063 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 BCA02C77B7E for ; Thu, 27 Apr 2023 05:21:10 +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.13548.1682572862588974129 for ; Wed, 26 Apr 2023 22:21:02 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=ISpkaiTQ; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: frederic.martinsons@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-2f7a7f9667bso4982655f8f.1 for ; Wed, 26 Apr 2023 22:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682572860; x=1685164860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nd5jaosxCYQ6baIAK1XchMU81zt9Q0R7k1dPJ7dfW8Q=; b=ISpkaiTQ9ghi2vVnf3kp8XjMxFGkVDxl93HtUlL3lU8PNbrTdMCIQMqoph3etghhdK ZoHkHol1jUJW46E8aXAdyPlUiLomhrKDzxmPE9ClKqf3B4ImS6afHm9P7GL/vbeLHEWB acZ9sCq8UjfaXCE63oOKxedkC//mlYD8AazJEgDsUeq9w4A6c0/OwW13iubk3yuvG/sw ccrfT90hHGf5f5sOrED7sN2OlbgSzNK75lBpWYFHHMdB9LlN4DDnSmyIYxOYww3b01MR Nuxuja1RBEwPAWVBsKamlPseQ+2SljUcAQZquVeWI3WultKa6UWrJbIVOZUNwGwvT4Ff U5Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682572860; x=1685164860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nd5jaosxCYQ6baIAK1XchMU81zt9Q0R7k1dPJ7dfW8Q=; b=VVG1BubvKPlFHvYMd6DoyM31FzsIc2KRH15O3VaHApX3iqkG32Wf5L+x4FS8fCJdCe QOoW/C1iPaAiCcxHPGikbKn+gxsQOLGmQLprtWIU7w+dm/mReO6sBEQLPv1Ofqwla967 WRcPMMrOuf3hEkX14zyILaqkiwc0vubWMrM+omufQ9adID0F4fNDVgCq1WMaEZfbCrm4 rgQ5afwqwgabjt4yVcdDJLazGKx6j8oibzdSUwsS6GKzAPiFiRk9Kt56qJFXl3J5ZUmW nJD+VqEfkD4sotL7ZazLF7lw3B/SE8deeTv+B9QRgJrdti0KmEuImAUoMXHHXsm9emVc gehA== X-Gm-Message-State: AC+VfDxkPUGTDOCKDX9QIKua+vd6iLd+oBOWPNtazMfbP44CEG8fQCyC c2ZHzHu1BEPz6A29dYFjpIgykfbtuD0= X-Google-Smtp-Source: ACHHUZ5qixJryqN0VYHYyVvoOuR/RKB5BtV6TfjyZKSnzDPNu8jUFRenrpKBTuvHnLlhg5paPQVWbQ== X-Received: by 2002:a5d:460f:0:b0:2d8:47c7:7b50 with SMTP id t15-20020a5d460f000000b002d847c77b50mr229326wrq.1.1682572860492; Wed, 26 Apr 2023 22:21:00 -0700 (PDT) Received: from work-pc.. ([2a01:e0a:8d5:c6c0:e2ba:a159:c9f4:28dc]) by smtp.gmail.com with ESMTPSA id jb12-20020a05600c54ec00b003f17003e26esm23240809wmb.15.2023.04.26.22.20.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 22:21:00 -0700 (PDT) From: frederic.martinsons@gmail.com To: openembedded-core@lists.openembedded.org Subject: [PATCHV3 1/3] ptest-cargo.bbclass: create class Date: Thu, 27 Apr 2023 07:20:54 +0200 Message-Id: <55d311e26e8c3eff765d71f4c1aa439459708812.1682572703.git.frederic.martinsons@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 ; Thu, 27 Apr 2023 05:21:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180467 From: Frederic Martinsons This new class offer the capbility to build rust tests and find them correctly. Due to non deterministic name of generated binaries, a custom parsing of build result must be performed. See https://github.com/rust-lang/cargo/issues/1924 All rust project will generate a test binary even if there are not test defined in source code (the binary will just output that it ran 0 tests) Signed-off-by: Frederic Martinsons --- meta/classes-recipe/ptest-cargo.bbclass | 129 ++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 meta/classes-recipe/ptest-cargo.bbclass diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass new file mode 100644 index 0000000000..f26d4225d3 --- /dev/null +++ b/meta/classes-recipe/ptest-cargo.bbclass @@ -0,0 +1,129 @@ +inherit cargo ptest + +CARGO_TEST_BINARIES_FILES ?= "${B}/test_binaries_list" + +# sadly generated test binary have no deterministic names (https://github.com/rust-lang/cargo/issues/1924) +# which force us to parse the cargo output in json format to find those test binaries +python do_compile_ptest_cargo() { + import subprocess + import json + + cargo = bb.utils.which(d.getVar("PATH"), d.getVar("CARGO", True)) + cargo_build_flags = d.getVar("CARGO_BUILD_FLAGS", True) + rust_flags = d.getVar("RUSTFLAGS", True) + manifest_path = d.getVar("MANIFEST_PATH", True) + + env = os.environ.copy() + env['RUSTFLAGS'] = rust_flags + cmd = f"{cargo} build --tests --message-format json {cargo_build_flags}" + bb.note(f"Building tests with cargo ({cmd})") + + try: + proc = subprocess.Popen(cmd, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + bb.fatal(f"Cannot build test with cargo: {e}") + + lines = [] + for line in proc.stdout: + data = line.decode('utf-8').strip('\n') + lines.append(data) + bb.note(data) + proc.communicate() + if proc.returncode != 0: + bb.fatal(f"Unable to compile test with cargo, '{cmd}' failed") + + # Definition of the format: https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages + test_bins = [] + for line in lines: + try: + data = json.loads(line) + except json.JSONDecodeError: + # skip lines that are not a json + pass + else: + try: + # Filter the test packages coming from the current manifest + current_manifest_path = os.path.normpath(data['manifest_path']) + project_manifest_path = os.path.normpath(manifest_path) + if current_manifest_path == project_manifest_path: + if data['target']['test'] or data['target']['doctest'] and data['executable']: + test_bins.append(data['executable']) + except KeyError as e: + # skip lines that do not meet the requirements + pass + + # All rust project will genrate at least one unit test binary + # It will just run a test suite with 0 tests if the project didn't define some + # So it is not expected to have an empty list here + if not test_bins: + bb.fatal("Unable to find any test binaries") + + cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES', True) + bb.note(f"Found {len(test_bins)} tests, write their path into {cargo_test_binaries_file}") + with open(cargo_test_binaries_file, "w") as f: + for test_bin in test_bins: + f.write(f"{test_bin}\n") + +} + +python do_install_ptest_cargo() { + import shutil + + dest_dir = d.getVar("D", True) + pn = d.getVar("PN", True) + ptest_path = d.getVar("PTEST_PATH", True) + cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES', True) + + ptest_dir = os.path.join(dest_dir, ptest_path.lstrip('/')) + os.makedirs(ptest_dir, exist_ok=True) + + test_bins = [] + with open(cargo_test_binaries_file, "r") as f: + for line in f.readlines(): + test_bins.append(line.strip('\n')) + + test_paths = [] + for test_bin in test_bins: + shutil.copy2(test_bin, ptest_dir) + test_paths.append(os.path.join(ptest_path, os.path.basename(test_bin))) + + ptest_script = os.path.join(ptest_dir, "run-ptest") + if os.path.exists(ptest_script): + with open(ptest_script, "a") as f: + f.write(f"\necho \"\"\n") + f.write(f"echo \"## starting to run rust tests ##\"\n") + for test_path in test_paths: + f.write(f"{test_path}\n") + else: + with open(ptest_script, "a") as f: + f.write("#!/bin/sh\n") + for test_path in test_paths: + f.write(f"{test_path}\n") + os.chmod(ptest_script, 0o755) + + # this is chown -R root:root ${D}${PTEST_PATH} + for root, dirs, files in os.walk(ptest_dir): + for d in dirs: + shutil.chown(os.path.join(root, d), "root", "root") + for f in files: + shutil.chown(os.path.join(root, f), "root", "root") +} + +do_install_ptest_cargo[dirs] = "${B}" +do_install_ptest_cargo[doc] = "Create or update the run-ptest script with rust test binaries generated" +do_compile_ptest_cargo[dirs] = "${B}" +do_compile_ptest_cargo[doc] = "Generate rust test binaries through cargo" + +addtask compile_ptest_cargo after do_compile before do_compile_ptest_base +addtask install_ptest_cargo after do_install_ptest_base before do_package + +python () { + if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): + d.setVarFlag('do_install_ptest_cargo', 'fakeroot', '1') + d.setVarFlag('do_install_ptest_cargp', 'umask', '022') + + # Remove all '*ptest_cargo' tasks when ptest is not enabled + if not(d.getVar('PTEST_ENABLED') == "1"): + for i in ['do_compile_ptest_cargo', 'do_install_ptest_cargo']: + bb.build.deltask(i, d) +} From patchwork Thu Apr 27 05:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RnLDqWTDqXJpYyBNYXJ0aW5zb25z?= X-Patchwork-Id: 23062 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 C9B4FC7EE23 for ; Thu, 27 Apr 2023 05:21:10 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web10.13596.1682572863473668997 for ; Wed, 26 Apr 2023 22:21:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=WZUt/H9k; spf=pass (domain: gmail.com, ip: 209.85.128.46, mailfrom: frederic.martinsons@gmail.com) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f09b4a1527so81884955e9.0 for ; Wed, 26 Apr 2023 22:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682572861; x=1685164861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zFd/u77cDpQ/254hAqQuFvN4En4E30r9dIjLiihS64Y=; b=WZUt/H9kag95JF6PLY/bbMVfvQiCxEOOKfrGxlQd7eP+KJXTXwf/fj2gxCZAkL0vua F0JHAsTL68UBIttgM3zjQQ/HPz2IshsW/2CpnQyrXurELxFrvhfcHx6KSTpdviiPQdDI hufLxXqSetm5WZh7dXfWeQohmGNlcYmGMTpFoLLWwCH0QRbb4Opdj3iaxu6VGQhfsOc3 ZXqGsf7c0PBxdujkcZ+RZ1JclQJp1EAkr9j9cOtiVHtZpjj0mD7/g8EbYSRCBUD5gh/m etDJlbIb6WE++9XB3p2IzcWYXKmqFFGC1u6Bk7I1QJtW3KbDpllLrYOG7xM2B3xY9sl0 361g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682572861; x=1685164861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zFd/u77cDpQ/254hAqQuFvN4En4E30r9dIjLiihS64Y=; b=KkJyt+2zcNTziJb+kq7R2Rf6HDqMkhOlP+X4AHbRY+lGzeNUhWGM0TC1S0QVNCl1JR H+AwkRapTtO9WKrDF2Pj2x/JYZlhnnENUd2hALV69YJEYbQfg2lvgzc9usmpMWCzK+Dp a4GsYPAGObA2Nypp27V4SStywLnEu1G3CS5x2uX1k8U61Q6N7wllHlluOWRy+XqVomGP BkJBe7r9Pbdxh6V3rhp6CqxLe9HK0x4ZG3dMw4S/HePrZXPFlnFDXkQJ7g0C7W58v7P6 y6/UmR98OD0Pq5j1e9x/8CHTVhQQMT/BI2jZNxOhrVOw/7e3DAq/PmKDwBR+zD1Lu24i l6zg== X-Gm-Message-State: AC+VfDxdOJl46bnwb2nUu/5HoRQXSeDL4Kgag+gp8aBP/9bbaFs4z6BM jc6pA4tOM0fIFKHSxxP0+vOcl3dVwfg= X-Google-Smtp-Source: ACHHUZ5CJNkEOPyU7r/FEy1wPXqdCypmClPBg3om67FKRgp9VCPRjfTIwbUHSuWhSITeXoHRSSfR0A== X-Received: by 2002:a7b:cc94:0:b0:3f1:69cc:475b with SMTP id p20-20020a7bcc94000000b003f169cc475bmr399168wma.36.1682572861475; Wed, 26 Apr 2023 22:21:01 -0700 (PDT) Received: from work-pc.. ([2a01:e0a:8d5:c6c0:e2ba:a159:c9f4:28dc]) by smtp.gmail.com with ESMTPSA id jb12-20020a05600c54ec00b003f17003e26esm23240809wmb.15.2023.04.26.22.21.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 22:21:00 -0700 (PDT) From: frederic.martinsons@gmail.com To: openembedded-core@lists.openembedded.org Subject: [PATCHV3 2/3] python3-bcrypt: enable build of unit tests Date: Thu, 27 Apr 2023 07:20:55 +0200 Message-Id: <9108a98c81a8a351007a4621b1214e6ec2656cd1.1682572703.git.frederic.martinsons@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 ; Thu, 27 Apr 2023 05:21:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180468 From: Frederic Martinsons The source code of bcrypt extension doesn't define any tests but it is to show the ptest-cargo usage Below is the updated test suite output for the recipe (cut): PASS: tests/test_bcrypt.py:test_invalid_params[password-$2b$04$cVWp4XaNU8a4v1uMRum2SO-513-10-ValueError] PASS: tests/test_bcrypt.py:test_invalid_params[password-$2b$04$cVWp4XaNU8a4v1uMRum2SO-20-0-ValueError] PASS: tests/test_bcrypt.py:test_2a_wraparound_bug ============================================================================ Testsuite summary running 0 tests test result: ok$<2>. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s root@qemux86-64:/usr/lib/python3-bcrypt/ptest# Signed-off-by: Frederic Martinsons --- meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb b/meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb index 21f2eb6ba4..b4f245530d 100644 --- a/meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb +++ b/meta/recipes-devtools/python/python3-bcrypt_4.0.1.bb @@ -7,12 +7,14 @@ DEPENDS += "${PYTHON_PN}-cffi-native" SRC_URI[sha256sum] = "27d375903ac8261cfe4047f6709d16f7d18d39b1ec92aaf72af989552a650ebd" -inherit pypi python_setuptools3_rust ptest cargo-update-recipe-crates +inherit pypi python_setuptools3_rust ptest-cargo cargo-update-recipe-crates SRC_URI += " \ file://run-ptest \ " +CARGO_SRC_DIR = "src/_bcrypt" + require ${BPN}-crates.inc RDEPENDS:${PN}-ptest += " \ From patchwork Thu Apr 27 05:20:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RnLDqWTDqXJpYyBNYXJ0aW5zb25z?= X-Patchwork-Id: 23061 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 BBACAC77B73 for ; Thu, 27 Apr 2023 05:21:10 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web10.13597.1682572864762254734 for ; Wed, 26 Apr 2023 22:21:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=Dj5ynNAt; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: frederic.martinsons@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-3f19a80a330so36700685e9.2 for ; Wed, 26 Apr 2023 22:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682572862; x=1685164862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bk4FGaQ1qHPI0pSp0DX3CnD/gxd6F+KGAcORYd6+4Dw=; b=Dj5ynNAtm+tf+8B9X6EVY92otnfG7EEDMNGFI9J4BgJIPAWNaNUARV0Ios9k+vR7nV TkLOzjl+rGRf4Cqz7j8tWx2TGAKrJ+tpMrfeM4eHLTRPGvfe6elT4pTTeZNvoI3Ch8to qoPNntNV4ltAxda2gWC5wSQRMq30MKicZkJbs/ZVjf4+5GVZu0btu5C8OOnU3WU0s0C6 JJP98mpIdAQHy/ior+xZMzl+l2uabvBIq2RfOT5TZvzzCzzE4JoWBCXDfxm7gWlcKneX 9lCiDUcbgxbLh2ku1J2pOuRcSiJmKEFSVzqVbAXSJkRjx0XcW+4cu0otQ0hjB1TBWSre TbxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682572862; x=1685164862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bk4FGaQ1qHPI0pSp0DX3CnD/gxd6F+KGAcORYd6+4Dw=; b=EhvMBPoZg2BoO0NkEgnAxenrtLB9VN0Ui/AstNgMHa/HY+BXZOjzH2fLkReShoit11 9/2IuiIFXKnCK0Ztj3rG0MwOFoQ6hVM51bXXFv6iA2c5CnYlIoG+63vP3PIPeZdTAuE2 E7ztMsDlR1UkPUgiw249QaryyeDxYR+AdYwhpKf1H+UgmngNDTa8S3M3GYX0vN8GevPd 40TVf19C0A1r54vFlrZlXcjnLjsuMGcIV5hLOoMA4hQDFw8IxWOsweSCy46iUHS1lpnV +69xeq6hKFiYn6JYO2wwMlJti3HyJNA/iwsBU2ZQGRmedWPKAs8ZhEGOWvVoq+eeUyxl wEJA== X-Gm-Message-State: AC+VfDzXMTa5n4DqtJlZFHHAquoyn7APl4EL7agEljhykdUJNw3iSC8N Ka9stAalk7RyPfenUi+eBwQnuznSWc0= X-Google-Smtp-Source: ACHHUZ7VtS+GHPAor+puEZPLWUBN9NpION1IbJZLyPT5FkJXDddhEil470ts1ewt4dpxy3KSmvd5Aw== X-Received: by 2002:a1c:ed0e:0:b0:3f1:800f:cc61 with SMTP id l14-20020a1ced0e000000b003f1800fcc61mr379216wmh.13.1682572862375; Wed, 26 Apr 2023 22:21:02 -0700 (PDT) Received: from work-pc.. ([2a01:e0a:8d5:c6c0:e2ba:a159:c9f4:28dc]) by smtp.gmail.com with ESMTPSA id jb12-20020a05600c54ec00b003f17003e26esm23240809wmb.15.2023.04.26.22.21.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 22:21:01 -0700 (PDT) From: frederic.martinsons@gmail.com To: openembedded-core@lists.openembedded.org Subject: [PATCHV3 3/3] zvariant: add ptest feature for zvariant test suite Date: Thu, 27 Apr 2023 07:20:56 +0200 Message-Id: <330dc3272eb6abf476642f87ea8dc4780e12445c.1682572703.git.frederic.martinsons@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 ; Thu, 27 Apr 2023 05:21:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180469 From: Frederic Martinsons Below is the output of run-ptest script under qemu root@qemux86-64:~# /usr/lib/zvariant/ptest/run-ptest running 37 tests test framing_offset_size::tests::framing_offset_size_bump ... ok$<2> test owned_value::tests::from_value ... ok$<2> test object_path::unit::owned_from_reader ... ok$<2> test str::tests::from_string ... ok$<2> test signature::tests::signature_slicing ... ok$<2> test str::tests::test_ordering ... ok$<2> test owned_value::tests::map_conversion ... ok$<2> test owned_value::tests::serde ... ok$<2> test tests::enums ... ok$<2> test tests::derive ... ok$<2> test tests::f64_value ... ok$<2> test tests::i16_value ... ok$<2> test tests::fd_value ... ok$<2> test tests::i32_value ... ok$<2> test tests::i8_value ... ok$<2> test tests::i64_value ... ok$<2> test tests::ip_addr ... ok$<2> test tests::issue_59 ... ok$<2> test tests::issue_99 ... ok$<2> test tests::array_value ... ok$<2> test tests::object_path_value ... ok$<2> test tests::dict_value ... ok$<2> test tests::signature_value ... ok$<2> test tests::serialized_size ... ok$<2> test tests::struct_byte_array ... ok$<2> test tests::struct_ref ... ok$<2> test tests::str_value ... ok$<2> test tests::option_value ... ok$<2> test tests::struct_value ... ok$<2> test tests::struct_with_hashmap ... ok$<2> test tests::u16_value ... ok$<2> test tests::u32_value ... ok$<2> test tests::unit ... ok$<2> test tests::u8_value ... ok$<2> test tests::unit_fds ... ok$<2> test tests::value_value ... ok$<2> test tests::recursion_limits ... ok$<2> test result: ok$<2>. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.21s root@qemux86-64:~# Signed-off-by: Frederic Martinsons --- .../recipes-extended/zvariant/zvariant_3.12.0.bb | 9 ++++++++- meta/lib/oeqa/selftest/cases/devtool.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb b/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb index 4285d11b72..36f2a07ecf 100644 --- a/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb +++ b/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb @@ -7,6 +7,8 @@ HOMEPAGE = "https://gitlab.freedesktop.org/dbus/zbus/" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=b377b220f43d747efdec40d69fcaa69d" +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'glib-2.0', '', d)}" + SRC_URI = " \ git://gitlab.freedesktop.org/dbus/zbus;protocol=https;branch=main;subpath=zvariant \ file://0001-Tweak-zvariant-crate-config.patch;striplevel=2 \ @@ -21,10 +23,15 @@ python do_clean_lic_file_symlink() { addtask clean_lic_file_symlink after do_unpack before do_patch -inherit cargo cargo-update-recipe-crates +inherit ptest-cargo pkgconfig cargo-update-recipe-crates # Remove this when the recipe is reproducible EXCLUDE_FROM_WORLD = "1" require ${BPN}-crates.inc require ${BPN}-git-crates.inc + +# zvariant is an indermediate product for the zbus project +# and so, it provided only a static lib (rlib) which fall only +# in -dev package +ALLOW_EMPTY:${PN} = "1" diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 94873fd19f..1896944250 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -876,7 +876,7 @@ class DevtoolModifyTests(DevtoolBase): self.assertTrue(any([uri.startswith('file://') and '.patch' in uri for uri in src_uri]), 'This test expects the %s recipe to have a patch in its src uris' % testrecipe) - self._test_recipe_contents(recipefile, {}, ['cargo']) + self._test_recipe_contents(recipefile, {}, ['ptest-cargo']) # Clean up anything in the workdir/sysroot/sstate cache bitbake('%s -c cleansstate' % testrecipe)