new file mode 100644
@@ -0,0 +1,4 @@
+QAPATHTEST[selftest-walk] = "package_qa_check_selftest_walk"
+def package_qa_check_selftest_walk(path, pkg, d, elf, messages):
+ path = package_qa_clean_path(path, d, pkg)
+ bb.warn("WALK %s %s %s" % (pkg, path, "ELF" if elf else "FILE"))
@@ -148,3 +148,41 @@ class PackageTests(OESelftestTestCase):
'/usr/libexec/hello4']:
if not gdbtest(qemu, binary):
self.fail('GDB %s failed' % binary)
+
+
+class InsaneTest(OESelftestTestCase):
+ def test_insane_package_walk(self):
+ """
+ Check that the package walking in insane.bbclass is listing the files we
+ expect.
+ """
+
+ import re
+
+ config = """
+INHERIT += "insane-test"
+WARN_QA_append_pn-selftest-hardlink = " selftest-walk"
+ """
+ self.write_config(config)
+
+ result = bitbake("selftest-hardlink -c package_qa -f")
+ expected = set((
+ "selftest-hardlink:/usr/libexec/hello3:ELF",
+ "selftest-hardlink:/usr/libexec/hello4:ELF",
+ "selftest-hardlink:/usr/bin/sparsetest:FILE",
+ "selftest-hardlink:/usr/bin/gdb.sh:FILE",
+ "selftest-hardlink:/usr/bin/hello1:ELF",
+ "selftest-hardlink:/usr/bin/hello2:ELF",
+ "selftest-hardlink-dbg:/usr/libexec/.debug/hello1:ELF",
+ "selftest-hardlink-dbg:/usr/bin/.debug/hello1:ELF",
+ "selftest-hardlink-src:/usr/src/debug/selftest-hardlink/1.0-r0/hello.c:FILE"
+ ))
+
+ line_re = re.compile(r"^WARNING: WALK (.+) (.+) (FILE|ELF)$")
+ for line in result.output.splitlines():
+ m = line_re.match(line)
+ if m:
+ expected.remove(":".join(m.groups()))
+
+ if expected:
+ self.fail("Not all files were listed: " + str(expected))
For reassurance when changing the insane.bbclass package walking code, add a sanity test to verify that the file listing is what is expected. Signed-off-by: Ross Burton <ross.burton@intel.com> --- meta-selftest/classes/insane-test.bbclass | 4 +++ meta/lib/oeqa/selftest/cases/package.py | 38 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 meta-selftest/classes/insane-test.bbclass -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core