]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/yocto-check-layer: refactor to be extended easily
authorRoss Burton <ross.burton@arm.com>
Thu, 1 May 2025 14:02:33 +0000 (15:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 5 May 2025 16:22:09 +0000 (17:22 +0100)
Rearrange the class so that the check is a separate function, to make it
neater to add further tests in the future.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/yocto-check-layer.bbclass

index 1cdab49661b35db36bfb354115419d0517d77bb3..92a392af9c3fbe8f24b2ff912c1eb264cac816c9 100644 (file)
@@ -4,17 +4,17 @@
 # SPDX-License-Identifier: MIT
 #
 
-#
-# This class is used by yocto-check-layer script to ensure that packages
-# from Yocto Project Compatible layers don't skip required QA checks listed
-# in CHECKLAYER_REQUIRED_TESTS defined by insane.bbclass
+# This class is used by the yocto-check-layer script for additional
+# per-recipe tests.
 #
 # It adds an anonymous python function with extra processing to all recipes,
 # globally inheriting this class isn't advisable - yocto-check-layer script
 # handles that during its signature dump
-#
 
-python () {
+
+# Ensure that recipes don't skip required QA checks as listed
+# in CHECKLAYER_REQUIRED_TESTS, defined by insane.bbclass
+def check_insane_skip(d):
     required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split())
     packages = set((d.getVar('PACKAGES') or '').split())
     for package in packages:
@@ -25,4 +25,8 @@ python () {
             oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d)
             bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required)))
             d.setVar("QA_ERRORS_FOUND", "True")
+
+
+python () {
+    check_insane_skip(d)
 }