oeqa/selftest: Test staged .la and .pc files

These files are checked by qa_check_staged but there was no
test cases for whether the tests actually worked. Now there
are.

(From OE-Core rev: 2a96719a201cb7b8db774718adec89dbd7e1aec3)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paulo Neves 2022-06-14 17:11:03 +02:00 committed by Richard Purdie
parent 53f0ee8d42
commit 00458ee0f8
3 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,16 @@
SUMMARY = "Produce a broken la file"
LICENSE = "CLOSED"
INHIBIT_DEFAULT_DEPS = "1"
EXCLUDE_FROM_WORLD = "1"
# remove-libtool.bbclass is inherited by default and removes all
# .la files which for this test we specifically do not want.
REMOVE_LIBTOOL_LA = "0"
do_install() {
install -d ${D}${libdir}/test/
echo '${WORKDIR}' > ${D}${libdir}/test/la-test.la
}
BBCLASSEXTEND += "native"

View File

@ -0,0 +1,12 @@
SUMMARY = "Produce a broken pc file"
LICENSE = "CLOSED"
INHIBIT_DEFAULT_DEPS = "1"
EXCLUDE_FROM_WORLD = "1"
do_install() {
install -d ${D}${libdir}/test/
echo '${WORKDIR}' > ${D}${libdir}/test/test.pc
}
BBCLASSEXTEND += "native"

View File

@ -45,3 +45,35 @@ TESTSTRING:pn-sysroot-test-arch2 = "%s"
expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]"
res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True)
self.assertTrue(expected in res.output, msg=res.output)
def test_sysroot_la(self):
"""
Summary: Check that workdir paths are not contained in .la files.
Expected: Fail when a workdir path is found in the file content.
Author: Paulo Neves <ptsneves@gmail.com>
"""
expected = "la-test.la failed sanity test (workdir) in path"
res = bitbake("sysroot-la-test -c populate_sysroot", ignore_status=True)
self.assertTrue(expected in res.output, msg=res.output)
self.assertTrue('[la]' in res.output, msg=res.output)
res = bitbake("sysroot-la-test-native -c populate_sysroot", ignore_status=True)
self.assertTrue(expected in res.output, msg=res.output)
self.assertTrue('[la]' in res.output, msg=res.output)
def test_sysroot_pkgconfig(self):
"""
Summary: Check that tmpdir paths are not contained in .pc files.
Expected: Fail when a tmpdir path is found in the file content.
Author: Paulo Neves <ptsneves@gmail.com>
"""
expected = "test.pc failed sanity test (tmpdir) in path"
res = bitbake("sysroot-pc-test -c populate_sysroot", ignore_status=True)
self.assertTrue('[pkgconfig]' in res.output, msg=res.output)
self.assertTrue(expected in res.output, msg=res.output)
res = bitbake("sysroot-pc-test-native -c populate_sysroot", ignore_status=True)
self.assertTrue(expected in res.output, msg=res.output)
self.assertTrue('[pkgconfig]' in res.output, msg=res.output)