Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Paulo Neves <ptsneves@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Paulo Neves <ptsneves@gmail.com>
Subject: [PATCH v6 5/7] oeqa/selftest: Test staged .la and .pc files
Date: Sun, 19 Jun 2022 21:20:39 +0200	[thread overview]
Message-ID: <20220619192041.1113263-5-ptsneves@gmail.com> (raw)
In-Reply-To: <20220619192041.1113263-1-ptsneves@gmail.com>

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

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
---
 .../sysroot-test/sysroot-la-test_1.0.bb       | 16 +++++++++
 .../sysroot-test/sysroot-pc-test_1.0.bb       | 12 +++++++
 meta/lib/oeqa/selftest/cases/sysroot.py       | 36 +++++++++++++++++++
 3 files changed, 64 insertions(+)
 create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb
 create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb

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 @@
+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"
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 @@
+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"
diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py
index a17fd1818a..294ba4a4a0 100644
--- a/meta/lib/oeqa/selftest/cases/sysroot.py
+++ b/meta/lib/oeqa/selftest/cases/sysroot.py
@@ -46,3 +46,39 @@ TESTSTRING:pn-sysroot-test-arch2 = "%s"
         res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True)
         self.assertTrue(expected in res.output, msg=res.output)
         self.assertTrue(res.status != 0)
+
+    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)
+        self.assertTrue(res.status != 0)
+
+        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)
+        self.assertTrue(res.status != 0)
+
+    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)
+        self.assertTrue(res.status != 0)
+
+        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)
+        self.assertTrue(res.status != 0)
-- 
2.25.1



  parent reply	other threads:[~2022-06-19 19:20 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 15:58 [PATCH 1/3] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-06 15:58 ` [PATCH 2/3] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-06 15:58 ` [PATCH 3/3] oeqa/selftest: Test staged .la and .pc files Paulo Neves
2022-06-07 15:11 ` [PATCH v2 1/5] python: Avoid shebang overflow on python-config.py Paulo Neves
2022-06-07 15:11   ` [PATCH v2 2/5] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Paulo Neves
2022-06-07 15:11   ` [PATCH v2 3/5] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-07 15:11   ` [PATCH v2 4/5] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-08 12:53     ` [OE-core] " Luca Ceresoli
2022-06-08 14:45       ` Paulo Neves
2022-06-08 15:02         ` Luca Ceresoli
     [not found]     ` <16F6A653C457F871.26104@lists.openembedded.org>
2022-06-08 15:06       ` Luca Ceresoli
2022-06-13 11:20         ` Paulo Neves
2022-06-15 11:04     ` Ross Burton
2022-06-07 15:11   ` [PATCH v2 5/5] oeqa/selftest: Test staged .la and .pc files Paulo Neves
2022-06-07 16:53   ` [OE-core] [PATCH v2 1/5] python: Avoid shebang overflow on python-config.py Alexander Kanavin
2022-06-07 20:03     ` Paulo Neves
2022-06-07 22:09       ` Alexander Kanavin
2022-06-10 21:43 ` [PATCH v3 1/7] " Paulo Neves
2022-06-10 21:43   ` [PATCH v3 2/7] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Paulo Neves
2022-06-10 21:43   ` [PATCH v3 3/7] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-10 21:43   ` [PATCH v3 4/7] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-10 21:43   ` [PATCH v3 5/7] oeqa/selftest: Test staged .la and .pc files Paulo Neves
2022-06-10 21:43   ` [PATCH v3 6/7] utils: Add cmdline_shebang_wrapper util Paulo Neves
2022-06-10 21:43   ` [PATCH v3 7/7] libcheck: Fix too long shebang for native case Paulo Neves
2022-06-13  7:30   ` [OE-core] [PATCH v3 1/7] python: Avoid shebang overflow on python-config.py Alexander Kanavin
2022-06-13 10:32     ` Paulo Neves
2022-06-13 12:36       ` Alexander Kanavin
2022-06-14 13:16 ` [PATCH v4 " Paulo Neves
2022-06-14 13:16   ` [PATCH v4 2/7] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Paulo Neves
2022-06-14 13:16   ` [PATCH v4 3/7] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-14 13:16   ` [PATCH v4 4/7] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-14 13:16   ` [PATCH v4 5/7] oeqa/selftest: Test staged .la and .pc files Paulo Neves
2022-06-14 13:16   ` [PATCH v4 6/7] utils: Add cmdline_shebang_wrapper util Paulo Neves
2022-06-14 13:39     ` [OE-core] " Martin Jansa
2022-06-14 13:46       ` Paulo Neves
2022-06-14 14:17         ` Martin Jansa
2022-06-14 15:12           ` Paulo Neves
2022-06-14 13:16   ` [PATCH v4 7/7] libcheck: Fix too long shebang for native case Paulo Neves
2022-06-14 15:10 ` [PATCH v5 1/7] python: Avoid shebang overflow on python-config.py Paulo Neves
2022-06-14 15:11   ` [PATCH v5 2/7] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Paulo Neves
2022-06-14 15:11   ` [PATCH v5 3/7] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-17 16:50     ` [OE-core] " Richard Purdie
2022-06-19 10:53       ` Paulo Neves
     [not found]     ` <16F97685B484595E.1329@lists.openembedded.org>
2022-07-01 12:53       ` Richard Purdie
2022-06-14 15:11   ` [PATCH v5 4/7] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-14 15:11   ` [PATCH v5 5/7] oeqa/selftest: Test staged .la and .pc files Paulo Neves
2022-06-14 15:11   ` [PATCH v5 6/7] utils: Add cmdline_shebang_wrapper util Paulo Neves
2022-06-15 10:52     ` [OE-core] " Ross Burton
2022-06-15 13:11       ` Peter Kjellerstedt
2022-06-15 13:50         ` Paulo Neves
2022-06-15 22:16           ` Peter Kjellerstedt
2022-06-19 19:03             ` Paulo Neves
2022-06-14 15:11   ` [PATCH v5 7/7] libcheck: Fix too long shebang for native case Paulo Neves
2022-06-15 11:07 ` [OE-core] [PATCH 1/3] insane.bbclass: Make do_qa_staging check shebangs Ross Burton
2022-06-15 11:08   ` Ross Burton
2022-06-15 11:09     ` Paulo Neves
2022-06-19 19:20 ` [PATCH v6 1/7] python: Avoid shebang overflow on python-config.py Paulo Neves
2022-06-19 19:20   ` [PATCH v6 2/7] gtk-doc: Fix potential shebang overflow on gtkdoc-mkhtml2 Paulo Neves
2022-06-19 19:20   ` [PATCH v6 3/7] insane.bbclass: Make do_qa_staging check shebangs Paulo Neves
2022-06-19 19:20   ` [PATCH v6 4/7] oeqa/selftest: Add test for shebang overflow Paulo Neves
2022-06-19 19:20   ` Paulo Neves [this message]
2022-06-19 19:20   ` [PATCH v6 6/7] utils: Add cmdline_shebang_wrapper util Paulo Neves
2022-07-05  4:50     ` [OE-core] " Jacob Kroon
2022-06-19 19:20   ` [PATCH v6 7/7] libcheck: Fix too long shebang for native case Paulo Neves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220619192041.1113263-5-ptsneves@gmail.com \
    --to=ptsneves@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox