[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH 4/4] QA, ptest: Add a naive heuristic to detect test subdirectories
From:       "Yoann Congal" <yoann.congal () smile ! fr>
Date:       2023-09-29 22:05:03
Message-ID: 20230929220503.3169745-5-yoann.congal () smile ! fr
[Download RAW message or body]

From: Jérémy Rosen <jeremy.rosen@smile.fr>

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

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/classes-global/insane.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index a5d3793265..ba12f3ea16 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1398,6 +1398,10 @@ python do_qa_patch() {
     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')):
         oe.qa.handle_error("unimplemented-ptest", "%s: autotools-based tests \
detected" % d.getVar('PN'), d)  
+    # Last resort, detect a test directory in sources
+    elif any(filename.lower() in ["test", "tests"] for filename in \
os.listdir(srcdir)): +        oe.qa.handle_error("unimplemented-ptest", "%s: test \
subdirectory detected" % d.getVar('PN'), d) +
     oe.qa.exit_if_errors(d)
 }
 
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188452): https://lists.openembedded.org/g/openembedded-core/message/188452
Mute This Topic: https://lists.openembedded.org/mt/101667589/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic