diff options
author | Ross Burton <ross.burton@intel.com> | 2017-06-19 15:59:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 15:52:17 +0100 |
commit | 1558ff69e0e79006fb48c89e02d00837941b2670 (patch) | |
tree | f6d34d17cda21e7af537d6555b1826ecaaa09e11 /meta/classes/insane.bbclass | |
parent | e83d446939e2e4a766c21dfa2982cbded1422307 (diff) | |
download | poky-1558ff69e0e79006fb48c89e02d00837941b2670.tar.gz |
insane: add extensible framework for recipe-wide QA tests
Following QAPATHTEST (QA hook for each file in each package) and QAPKGTEST (QA
hook for each package), add QARECIPETEST: a hook which is executed once per
recipe in do_package_qa.
This makes it trivial to add recipe-wide QA tests that integrate with the
existing tests.
(From OE-Core rev: 656780b79e55498250d14b2cbe3bed3849fa690d)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 17c9058b04..0e974b5147 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -808,6 +808,23 @@ def package_qa_package(warnfuncs, errorfuncs, skip, package, d): | |||
808 | 808 | ||
809 | return len(errors) == 0 | 809 | return len(errors) == 0 |
810 | 810 | ||
811 | # Run all recipe-wide warnfuncs and errorfuncs | ||
812 | def package_qa_recipe(warnfuncs, errorfuncs, skip, pn, d): | ||
813 | warnings = {} | ||
814 | errors = {} | ||
815 | |||
816 | for func in warnfuncs: | ||
817 | func(pn, d, warnings) | ||
818 | for func in errorfuncs: | ||
819 | func(pn, d, errors) | ||
820 | |||
821 | for w in warnings: | ||
822 | package_qa_handle_error(w, warnings[w], d) | ||
823 | for e in errors: | ||
824 | package_qa_handle_error(e, errors[e], d) | ||
825 | |||
826 | return len(errors) == 0 | ||
827 | |||
811 | # Walk over all files in a directory and call func | 828 | # Walk over all files in a directory and call func |
812 | def package_qa_walk(warnfuncs, errorfuncs, skip, package, d): | 829 | def package_qa_walk(warnfuncs, errorfuncs, skip, package, d): |
813 | import oe.qa | 830 | import oe.qa |
@@ -1108,34 +1125,33 @@ python do_package_qa () { | |||
1108 | for dep in taskdepdata: | 1125 | for dep in taskdepdata: |
1109 | taskdeps.add(taskdepdata[dep][0]) | 1126 | taskdeps.add(taskdepdata[dep][0]) |
1110 | 1127 | ||
1111 | for package in packages: | 1128 | def parse_test_matrix(matrix_name): |
1112 | def parse_test_matrix(matrix_name): | 1129 | testmatrix = d.getVarFlags(matrix_name) or {} |
1113 | testmatrix = d.getVarFlags(matrix_name) or {} | 1130 | g = globals() |
1114 | g = globals() | 1131 | warnchecks = [] |
1115 | warnchecks = [] | 1132 | for w in (d.getVar("WARN_QA") or "").split(): |
1116 | for w in (d.getVar("WARN_QA") or "").split(): | 1133 | if w in skip: |
1117 | if w in skip: | 1134 | continue |
1118 | continue | 1135 | if w in testmatrix and testmatrix[w] in g: |
1119 | if w in testmatrix and testmatrix[w] in g: | 1136 | warnchecks.append(g[testmatrix[w]]) |
1120 | warnchecks.append(g[testmatrix[w]]) | 1137 | if w == 'unsafe-references-in-binaries': |
1121 | if w == 'unsafe-references-in-binaries': | 1138 | oe.utils.write_ld_so_conf(d) |
1122 | oe.utils.write_ld_so_conf(d) | 1139 | |
1123 | 1140 | errorchecks = [] | |
1124 | errorchecks = [] | 1141 | for e in (d.getVar("ERROR_QA") or "").split(): |
1125 | for e in (d.getVar("ERROR_QA") or "").split(): | 1142 | if e in skip: |
1126 | if e in skip: | 1143 | continue |
1127 | continue | 1144 | if e in testmatrix and testmatrix[e] in g: |
1128 | if e in testmatrix and testmatrix[e] in g: | 1145 | errorchecks.append(g[testmatrix[e]]) |
1129 | errorchecks.append(g[testmatrix[e]]) | 1146 | if e == 'unsafe-references-in-binaries': |
1130 | if e == 'unsafe-references-in-binaries': | 1147 | oe.utils.write_ld_so_conf(d) |
1131 | oe.utils.write_ld_so_conf(d) | 1148 | return warnchecks, errorchecks |
1132 | return warnchecks, errorchecks | ||
1133 | 1149 | ||
1150 | for package in packages: | ||
1134 | skip = (d.getVar('INSANE_SKIP_' + package) or "").split() | 1151 | skip = (d.getVar('INSANE_SKIP_' + package) or "").split() |
1135 | if skip: | 1152 | if skip: |
1136 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) | 1153 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) |
1137 | 1154 | ||
1138 | |||
1139 | bb.note("Checking Package: %s" % package) | 1155 | bb.note("Checking Package: %s" % package) |
1140 | # Check package name | 1156 | # Check package name |
1141 | if not pkgname_pattern.match(package): | 1157 | if not pkgname_pattern.match(package): |
@@ -1151,6 +1167,9 @@ python do_package_qa () { | |||
1151 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) | 1167 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) |
1152 | package_qa_check_deps(package, pkgdest, skip, d) | 1168 | package_qa_check_deps(package, pkgdest, skip, d) |
1153 | 1169 | ||
1170 | warn_checks, error_checks = parse_test_matrix("QARECIPETEST") | ||
1171 | package_qa_recipe(warn_checks, error_checks, skip, pn, d) | ||
1172 | |||
1154 | if 'libdir' in d.getVar("ALL_QA").split(): | 1173 | if 'libdir' in d.getVar("ALL_QA").split(): |
1155 | package_qa_check_libdir(d) | 1174 | package_qa_check_libdir(d) |
1156 | 1175 | ||