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.

(From OE-Core rev: 4041d91b63ff2315657499e22c74ec90adbf9e19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2024-05-09 17:02:39 +01:00
parent 45e819b4d4
commit 521a3f727c

View File

@@ -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)