diff options
author | Ines KCHELFI <ines.kchelfi@smile.fr> | 2025-05-16 11:09:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-19 17:35:43 +0100 |
commit | 3d131ece589cbe0a167328e78bf79985f5fb43fb (patch) | |
tree | 8e736a4016d21fdcb08176e53be67bf28f4fe97a | |
parent | 2f4e20740a8087199f337b6f156f56ea367300cc (diff) | |
download | poky-3d131ece589cbe0a167328e78bf79985f5fb43fb.tar.gz |
insane.bbclass: Add unimplemented-ptest detection for cargo-based tests
Extend unimplemented-ptest QA check to detect Rust tests.
Note: To enable this QA check, add the following to your local.conf:
WARN_QA += "unimplemented-ptest"
Examples of Rust-based meta-oe packages triggering unimplemented-ptest:
WARNING: cbindgen-0.28.0-r0 do_patch: QA Issue: cbindgen: cargo-based tests detected [unimplemented-ptest]
WARNING: fdfindd-10.2-r0 do_patch: QA Issue: fdfindd: cargo-based tests detected [unimplemented-ptest]
WARNING: deqp-runner-0.20.3-r0 do_patch: QA Issue: deqp-runner: cargo-based tests detected [unimplemented-ptest]
WARNING: bindgen-cli-0.71.1-r0 do_patch: QA Issue: bindgen-cli: cargo-based tests detected [unimplemented-ptest]
WARNING: python3-maturin-1.8.3-r0 do_patch: QA Issue: python3-maturin: cargo-based tests detected [unimplemented-ptest]
WARNING: uutils-coreutils-0.0.30-r0 do_patch: QA Issue: uutils-coreutils: cargo-based tests detected [unimplemented-ptest]
(From OE-Core rev: c3c10f00b1f4d4a092e5d3834ec0ba6abd6ac969)
Signed-off-by: Ines KCHELFI <ines.kchelfi@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-global/insane.bbclass | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index cd26bf5eb9..152bef8ad5 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass | |||
@@ -1332,6 +1332,13 @@ python do_qa_patch() { | |||
1332 | elif os.path.exists(os.path.join(srcdir, "Makefile.in")) and (match_line_in_files(srcdir, "**/Makefile.in", r'\s*TESTS\s*\+?=') or match_line_in_files(srcdir,"**/*.at",r'.*AT_INIT')): | 1332 | elif os.path.exists(os.path.join(srcdir, "Makefile.in")) and (match_line_in_files(srcdir, "**/Makefile.in", r'\s*TESTS\s*\+?=') or match_line_in_files(srcdir,"**/*.at",r'.*AT_INIT')): |
1333 | oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests detected" % d.getVar('PN'), d) | 1333 | oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests detected" % d.getVar('PN'), d) |
1334 | 1334 | ||
1335 | # Detect cargo-based tests | ||
1336 | elif os.path.exists(os.path.join(srcdir, "Cargo.toml")) and ( | ||
1337 | match_line_in_files(srcdir, "**/*.rs", r'\s*#\s*\[\s*test\s*\]') or | ||
1338 | match_line_in_files(srcdir, "**/*.rs", r'\s*#\s*\[\s*cfg\s*\(\s*test\s*\)\s*\]') | ||
1339 | ): | ||
1340 | oe.qa.handle_error("unimplemented-ptest", "%s: cargo-based tests detected" % d.getVar('PN'), d) | ||
1341 | |||
1335 | # Last resort, detect a test directory in sources | 1342 | # Last resort, detect a test directory in sources |
1336 | elif os.path.exists(srcdir) and any(filename.lower() in ["test", "tests"] for filename in os.listdir(srcdir)): | 1343 | elif os.path.exists(srcdir) and any(filename.lower() in ["test", "tests"] for filename in os.listdir(srcdir)): |
1337 | oe.qa.handle_error("unimplemented-ptest", "%s: test subdirectory detected" % d.getVar('PN'), d) | 1344 | oe.qa.handle_error("unimplemented-ptest", "%s: test subdirectory detected" % d.getVar('PN'), d) |