Skip to contentSkip to conversation

insane: Fix case where S doesn't exist

PATCH New Richard Purdie 1 participant 1 message May 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 insane: Fix case where S doesn't exist

If S doesn't exist, do_qa_patch would fail. Fix the code to not fail in this situation.

---
 meta/classes-global/insane.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/insane.bbclass +1 -1
index c32dfffd836..03ac06b102f 100644
@@ -1399,7 +1399,7 @@ python do_qa_patch() {
         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)):
+    elif os.path.exists(srcdir) and 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)
Signature · 1 line
2.40.1