diff options
author | Ross Burton <ross.burton@intel.com> | 2016-11-24 18:02:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-30 15:48:07 +0000 |
commit | 4a7a2b4777741057b0b9f4cb3323a10127746abe (patch) | |
tree | 9e451e187ca2b02ec2e276efe69e00159205c10a /meta/classes | |
parent | 56d3c77ebec22b65efbd9f11abb201af3102df64 (diff) | |
download | poky-4a7a2b4777741057b0b9f4cb3323a10127746abe.tar.gz |
insane: factor out the test matrix processing
Pull the test matrix processing out as a function so it can be reused.
(From OE-Core rev: 3caccd3f6079b7e284d32e1eb0217107425e7bf8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/insane.bbclass | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 9f3065fdc7..0ba4cae23e 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -1116,7 +1116,6 @@ python do_package_qa () { | |||
1116 | if not packages: | 1116 | if not packages: |
1117 | return | 1117 | return |
1118 | 1118 | ||
1119 | testmatrix = d.getVarFlags("QAPATHTEST") | ||
1120 | import re | 1119 | import re |
1121 | # The package name matches the [a-z0-9.+-]+ regular expression | 1120 | # The package name matches the [a-z0-9.+-]+ regular expression |
1122 | pkgname_pattern = re.compile("^[a-z0-9.+-]+$") | 1121 | pkgname_pattern = re.compile("^[a-z0-9.+-]+$") |
@@ -1126,28 +1125,33 @@ python do_package_qa () { | |||
1126 | for dep in taskdepdata: | 1125 | for dep in taskdepdata: |
1127 | taskdeps.add(taskdepdata[dep][0]) | 1126 | taskdeps.add(taskdepdata[dep][0]) |
1128 | 1127 | ||
1129 | g = globals() | ||
1130 | for package in packages: | 1128 | for package in packages: |
1129 | def parse_test_matrix(matrix_name): | ||
1130 | testmatrix = d.getVarFlags(matrix_name) or {} | ||
1131 | g = globals() | ||
1132 | warnchecks = [] | ||
1133 | for w in (d.getVar("WARN_QA", True) or "").split(): | ||
1134 | if w in skip: | ||
1135 | continue | ||
1136 | if w in testmatrix and testmatrix[w] in g: | ||
1137 | warnchecks.append(g[testmatrix[w]]) | ||
1138 | if w == 'unsafe-references-in-binaries': | ||
1139 | oe.utils.write_ld_so_conf(d) | ||
1140 | |||
1141 | errorchecks = [] | ||
1142 | for e in (d.getVar("ERROR_QA", True) or "").split(): | ||
1143 | if e in skip: | ||
1144 | continue | ||
1145 | if e in testmatrix and testmatrix[e] in g: | ||
1146 | errorchecks.append(g[testmatrix[e]]) | ||
1147 | if e == 'unsafe-references-in-binaries': | ||
1148 | oe.utils.write_ld_so_conf(d) | ||
1149 | return warnchecks, errorchecks | ||
1150 | |||
1131 | skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() | 1151 | skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() |
1132 | if skip: | 1152 | if skip: |
1133 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) | 1153 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) |
1134 | warnchecks = [] | 1154 | |
1135 | for w in (d.getVar("WARN_QA", True) or "").split(): | ||
1136 | if w in skip: | ||
1137 | continue | ||
1138 | if w in testmatrix and testmatrix[w] in g: | ||
1139 | warnchecks.append(g[testmatrix[w]]) | ||
1140 | if w == 'unsafe-references-in-binaries': | ||
1141 | oe.utils.write_ld_so_conf(d) | ||
1142 | |||
1143 | errorchecks = [] | ||
1144 | for e in (d.getVar("ERROR_QA", True) or "").split(): | ||
1145 | if e in skip: | ||
1146 | continue | ||
1147 | if e in testmatrix and testmatrix[e] in g: | ||
1148 | errorchecks.append(g[testmatrix[e]]) | ||
1149 | if e == 'unsafe-references-in-binaries': | ||
1150 | oe.utils.write_ld_so_conf(d) | ||
1151 | 1155 | ||
1152 | bb.note("Checking Package: %s" % package) | 1156 | bb.note("Checking Package: %s" % package) |
1153 | # Check package name | 1157 | # Check package name |
@@ -1155,8 +1159,8 @@ python do_package_qa () { | |||
1155 | package_qa_handle_error("pkgname", | 1159 | package_qa_handle_error("pkgname", |
1156 | "%s doesn't match the [a-z0-9.+-]+ regex" % package, d) | 1160 | "%s doesn't match the [a-z0-9.+-]+ regex" % package, d) |
1157 | 1161 | ||
1158 | path = "%s/%s" % (pkgdest, package) | 1162 | warn_checks, error_checks = parse_test_matrix("QAPATHTEST") |
1159 | package_qa_walk(warnchecks, errorchecks, skip, package, d) | 1163 | package_qa_walk(warn_checks, error_checks, skip, package, d) |
1160 | 1164 | ||
1161 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) | 1165 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) |
1162 | package_qa_check_deps(package, pkgdest, skip, d) | 1166 | package_qa_check_deps(package, pkgdest, skip, d) |