summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb16
-rw-r--r--meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb12
-rw-r--r--meta/lib/oeqa/selftest/cases/sysroot.py32
3 files changed, 60 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb
new file mode 100644
index 0000000000..21f06782fb
--- /dev/null
+++ b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb
@@ -0,0 +1,16 @@
1SUMMARY = "Produce a broken la file"
2LICENSE = "CLOSED"
3INHIBIT_DEFAULT_DEPS = "1"
4
5EXCLUDE_FROM_WORLD = "1"
6
7# remove-libtool.bbclass is inherited by default and removes all
8# .la files which for this test we specifically do not want.
9REMOVE_LIBTOOL_LA = "0"
10
11do_install() {
12 install -d ${D}${libdir}/test/
13 echo '${WORKDIR}' > ${D}${libdir}/test/la-test.la
14}
15
16BBCLASSEXTEND += "native"
diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb
new file mode 100644
index 0000000000..e748310fc4
--- /dev/null
+++ b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb
@@ -0,0 +1,12 @@
1SUMMARY = "Produce a broken pc file"
2LICENSE = "CLOSED"
3INHIBIT_DEFAULT_DEPS = "1"
4
5EXCLUDE_FROM_WORLD = "1"
6
7do_install() {
8 install -d ${D}${libdir}/test/
9 echo '${WORKDIR}' > ${D}${libdir}/test/test.pc
10}
11
12BBCLASSEXTEND += "native"
diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py
index 9457f1e3ac..588fc8c713 100644
--- a/meta/lib/oeqa/selftest/cases/sysroot.py
+++ b/meta/lib/oeqa/selftest/cases/sysroot.py
@@ -45,3 +45,35 @@ TESTSTRING:pn-sysroot-test-arch2 = "%s"
45 expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" 45 expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]"
46 res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) 46 res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True)
47 self.assertTrue(expected in res.output, msg=res.output) 47 self.assertTrue(expected in res.output, msg=res.output)
48
49 def test_sysroot_la(self):
50 """
51 Summary: Check that workdir paths are not contained in .la files.
52 Expected: Fail when a workdir path is found in the file content.
53 Author: Paulo Neves <ptsneves@gmail.com>
54 """
55 expected = "la-test.la failed sanity test (workdir) in path"
56
57 res = bitbake("sysroot-la-test -c populate_sysroot", ignore_status=True)
58 self.assertTrue(expected in res.output, msg=res.output)
59 self.assertTrue('[la]' in res.output, msg=res.output)
60
61 res = bitbake("sysroot-la-test-native -c populate_sysroot", ignore_status=True)
62 self.assertTrue(expected in res.output, msg=res.output)
63 self.assertTrue('[la]' in res.output, msg=res.output)
64
65 def test_sysroot_pkgconfig(self):
66 """
67 Summary: Check that tmpdir paths are not contained in .pc files.
68 Expected: Fail when a tmpdir path is found in the file content.
69 Author: Paulo Neves <ptsneves@gmail.com>
70 """
71 expected = "test.pc failed sanity test (tmpdir) in path"
72
73 res = bitbake("sysroot-pc-test -c populate_sysroot", ignore_status=True)
74 self.assertTrue('[pkgconfig]' in res.output, msg=res.output)
75 self.assertTrue(expected in res.output, msg=res.output)
76
77 res = bitbake("sysroot-pc-test-native -c populate_sysroot", ignore_status=True)
78 self.assertTrue(expected in res.output, msg=res.output)
79 self.assertTrue('[pkgconfig]' in res.output, msg=res.output)