summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorJérémy Rosen <jeremy.rosen@smile.fr>2023-10-10 15:49:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-15 09:11:47 +0100
commitb233e2f8c2d756010fd4fae5b8173b1fddf39693 (patch)
treecbb572e005b9d7412b6bb5788b7c48d502bdf5ba /meta/classes-global
parentf4b039cae0833634487607a4c6ade441dbe94cbf (diff)
downloadpoky-b233e2f8c2d756010fd4fae5b8173b1fddf39693.tar.gz
insane: Add a naive heuristic to detect test subdirectories
if there is a "test" or "tests" subdirectory at toplevel, this usually means we have some unit tests available. This test is very good at detecting handcrafted tests and I was not able to find any false positive. False positive can be dealt with the usual INSANE_SKIP mechanism (From OE-Core rev: 0c91ad29f7ea313bc25481be9d40f216c0770b98) Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/insane.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 3fa9da8aff..07de974a54 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1391,6 +1391,10 @@ python do_qa_patch() {
1391 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')): 1391 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')):
1392 oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests detected" % d.getVar('PN'), d) 1392 oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests detected" % d.getVar('PN'), d)
1393 1393
1394 # Last resort, detect a test directory in sources
1395 elif any(filename.lower() in ["test", "tests"] for filename in os.listdir(srcdir)):
1396 oe.qa.handle_error("unimplemented-ptest", "%s: test subdirectory detected" % d.getVar('PN'), d)
1397
1394 oe.qa.exit_if_errors(d) 1398 oe.qa.exit_if_errors(d)
1395} 1399}
1396 1400