Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] oeqa/selftest/sanity: add test case for the recipe-naming sanity check
@ 2025-06-10 10:41 Ross Burton
  2025-06-10 12:09 ` [OE-core] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2025-06-10 10:41 UTC (permalink / raw)
  To: openembedded-core

Add a pair of test recipes to meta-selftest, and a new test module to
collect test cases for the recipe_qa/package_qa checks.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../recipename/nativesdk-recipename-test.bb   |  6 +++++
 .../recipename/recipename-test-native.bb      |  6 +++++
 meta/lib/oeqa/selftest/cases/sanity.py        | 27 +++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb
 create mode 100644 meta-selftest/recipes-test/recipename/recipename-test-native.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/sanity.py

diff --git a/meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb b/meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb
new file mode 100644
index 00000000000..c5342150b23
--- /dev/null
+++ b/meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Recipe that is called nativesdk- but does not inherit nativesdk"
+LICENSE = "CLOSED"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta-selftest/recipes-test/recipename/recipename-test-native.bb b/meta-selftest/recipes-test/recipename/recipename-test-native.bb
new file mode 100644
index 00000000000..2a05f6c617b
--- /dev/null
+++ b/meta-selftest/recipes-test/recipename/recipename-test-native.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Recipe that is called -native but does not inherit native"
+LICENSE = "CLOSED"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/lib/oeqa/selftest/cases/sanity.py b/meta/lib/oeqa/selftest/cases/sanity.py
new file mode 100644
index 00000000000..50ad0a141da
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/sanity.py
@@ -0,0 +1,27 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+
+class RecipeQaTests(OESelftestTestCase):
+    """
+    Tests to exercise the recipe_qa checks.
+    """
+
+    def test_recipe_naming(self):
+        """
+        Exercise the recipe-naming check.
+        """
+        self.write_config('ERROR_QA = "recipe-naming"')
+
+        for recipe in ("recipename-test-native", "nativesdk-recipename-test"):
+            with self.subTest(recipe=recipe):
+                res = bitbake(f"{recipe} -c recipe_qa -f", ignore_status=True)
+                # bitbake should have failed
+                self.assertNotEqual(res.status, 0)
+                # The recipe-naming test should be in the output
+                self.assertRegex(res.output, fr"do_recipe_qa.*{recipe}.*\[recipe-naming\]")
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-10 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 10:41 [PATCH] oeqa/selftest/sanity: add test case for the recipe-naming sanity check Ross Burton
2025-06-10 12:09 ` [OE-core] " Mathieu Dubois-Briand
2025-06-10 13:09   ` Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox