diff options
| author | Ross Burton <ross.burton@arm.com> | 2025-05-01 15:02:33 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-05 17:22:11 +0100 |
| commit | e4c9b45a98e406dfa979cec34692c4dde047d367 (patch) | |
| tree | 6c63806affbb66a29811b44978087f4707c05ff3 | |
| parent | 43fd724eac29dd6187e0e4bf777ee59898dc92ca (diff) | |
| download | poky-e4c9b45a98e406dfa979cec34692c4dde047d367.tar.gz | |
classes/yocto-check-layer: refactor to be extended easily
Rearrange the class so that the check is a separate function, to make it
neater to add further tests in the future.
(From OE-Core rev: 36658a113811de98249bc1e1b79cfadd405e5391)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-global/yocto-check-layer.bbclass | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/classes-global/yocto-check-layer.bbclass b/meta/classes-global/yocto-check-layer.bbclass index 1cdab49661..92a392af9c 100644 --- a/meta/classes-global/yocto-check-layer.bbclass +++ b/meta/classes-global/yocto-check-layer.bbclass | |||
| @@ -4,17 +4,17 @@ | |||
| 4 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
| 5 | # | 5 | # |
| 6 | 6 | ||
| 7 | # | 7 | # This class is used by the yocto-check-layer script for additional |
| 8 | # This class is used by yocto-check-layer script to ensure that packages | 8 | # per-recipe tests. |
| 9 | # from Yocto Project Compatible layers don't skip required QA checks listed | ||
| 10 | # in CHECKLAYER_REQUIRED_TESTS defined by insane.bbclass | ||
| 11 | # | 9 | # |
| 12 | # It adds an anonymous python function with extra processing to all recipes, | 10 | # It adds an anonymous python function with extra processing to all recipes, |
| 13 | # globally inheriting this class isn't advisable - yocto-check-layer script | 11 | # globally inheriting this class isn't advisable - yocto-check-layer script |
| 14 | # handles that during its signature dump | 12 | # handles that during its signature dump |
| 15 | # | ||
| 16 | 13 | ||
| 17 | python () { | 14 | |
| 15 | # Ensure that recipes don't skip required QA checks as listed | ||
| 16 | # in CHECKLAYER_REQUIRED_TESTS, defined by insane.bbclass | ||
| 17 | def check_insane_skip(d): | ||
| 18 | required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split()) | 18 | required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split()) |
| 19 | packages = set((d.getVar('PACKAGES') or '').split()) | 19 | packages = set((d.getVar('PACKAGES') or '').split()) |
| 20 | for package in packages: | 20 | for package in packages: |
| @@ -25,4 +25,8 @@ python () { | |||
| 25 | oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d) | 25 | oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d) |
| 26 | bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required))) | 26 | bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required))) |
| 27 | d.setVar("QA_ERRORS_FOUND", "True") | 27 | d.setVar("QA_ERRORS_FOUND", "True") |
| 28 | |||
| 29 | |||
| 30 | python () { | ||
| 31 | check_insane_skip(d) | ||
| 28 | } | 32 | } |
