yocto-check-layer.bbclass 1.1 KB

12345678910111213141516171819202122232425262728
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. # SPDX-License-Identifier: MIT
  5. #
  6. #
  7. # This class is used by yocto-check-layer script to ensure that packages
  8. # from Yocto Project Compatible layers don't skip required QA checks listed
  9. # in CHECKLAYER_REQUIRED_TESTS defined by insane.bbclass
  10. #
  11. # It adds an anonymous python function with extra processing to all recipes,
  12. # globally inheriting this class isn't advisable - yocto-check-layer script
  13. # handles that during its signature dump
  14. #
  15. python () {
  16. required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split())
  17. packages = set((d.getVar('PACKAGES') or '').split())
  18. for package in packages:
  19. skip = set((d.getVar('INSANE_SKIP') or "").split() +
  20. (d.getVar('INSANE_SKIP:' + package) or "").split())
  21. skip_required = skip & required_tests
  22. if skip_required:
  23. oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d)
  24. bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required)))
  25. d.setVar("QA_ERRORS_FOUND", "True")
  26. }