diff options
-rw-r--r-- | meta/classes-global/insane.bbclass | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 73fd2951f4..32adcc722b 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass | |||
@@ -54,8 +54,6 @@ FAKEROOT_QA = "host-user-contaminated" | |||
54 | FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ | 54 | FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ |
55 | enabled tests are listed here, the do_package_qa task will run under fakeroot." | 55 | enabled tests are listed here, the do_package_qa task will run under fakeroot." |
56 | 56 | ||
57 | ALL_QA = "${WARN_QA} ${ERROR_QA}" | ||
58 | |||
59 | UNKNOWN_CONFIGURE_OPT_IGNORE ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --disable-static" | 57 | UNKNOWN_CONFIGURE_OPT_IGNORE ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --disable-static" |
60 | 58 | ||
61 | # This is a list of directories that are expected to be empty. | 59 | # This is a list of directories that are expected to be empty. |
@@ -1083,6 +1081,25 @@ def package_qa_check_missing_update_alternatives(pn, d): | |||
1083 | if d.getVar('ALTERNATIVE:%s' % pkg) and not bb.data.inherits_class('update-alternatives', d): | 1081 | if d.getVar('ALTERNATIVE:%s' % pkg) and not bb.data.inherits_class('update-alternatives', d): |
1084 | oe.qa.handle_error("missing-update-alternatives", "%s: recipe defines ALTERNATIVE:%s but doesn't inherit update-alternatives. This might fail during do_rootfs later!" % (pn, pkg), d) | 1082 | oe.qa.handle_error("missing-update-alternatives", "%s: recipe defines ALTERNATIVE:%s but doesn't inherit update-alternatives. This might fail during do_rootfs later!" % (pn, pkg), d) |
1085 | 1083 | ||
1084 | def parse_test_matrix(matrix_name, skip, d): | ||
1085 | testmatrix = d.getVarFlags(matrix_name) or {} | ||
1086 | g = globals() | ||
1087 | checks = [] | ||
1088 | for w in (d.getVar("WARN_QA") or "").split(): | ||
1089 | if w in skip: | ||
1090 | continue | ||
1091 | if w in testmatrix and testmatrix[w] in g: | ||
1092 | checks.append(g[testmatrix[w]]) | ||
1093 | |||
1094 | for e in (d.getVar("ERROR_QA") or "").split(): | ||
1095 | if e in skip: | ||
1096 | continue | ||
1097 | if e in testmatrix and testmatrix[e] in g: | ||
1098 | checks.append(g[testmatrix[e]]) | ||
1099 | return checks | ||
1100 | parse_test_matrix[vardepsexclude] = "ERROR_QA WARN_QA" | ||
1101 | |||
1102 | |||
1086 | # The PACKAGE FUNC to scan each package | 1103 | # The PACKAGE FUNC to scan each package |
1087 | python do_package_qa () { | 1104 | python do_package_qa () { |
1088 | import subprocess | 1105 | import subprocess |
@@ -1138,23 +1155,6 @@ python do_package_qa () { | |||
1138 | for dep in taskdepdata: | 1155 | for dep in taskdepdata: |
1139 | taskdeps.add(taskdepdata[dep][0]) | 1156 | taskdeps.add(taskdepdata[dep][0]) |
1140 | 1157 | ||
1141 | def parse_test_matrix(matrix_name): | ||
1142 | testmatrix = d.getVarFlags(matrix_name) or {} | ||
1143 | g = globals() | ||
1144 | checks = [] | ||
1145 | for w in (d.getVar("WARN_QA") or "").split(): | ||
1146 | if w in skip: | ||
1147 | continue | ||
1148 | if w in testmatrix and testmatrix[w] in g: | ||
1149 | checks.append(g[testmatrix[w]]) | ||
1150 | |||
1151 | for e in (d.getVar("ERROR_QA") or "").split(): | ||
1152 | if e in skip: | ||
1153 | continue | ||
1154 | if e in testmatrix and testmatrix[e] in g: | ||
1155 | checks.append(g[testmatrix[e]]) | ||
1156 | return checks | ||
1157 | |||
1158 | for package in packages: | 1158 | for package in packages: |
1159 | skip = set((d.getVar('INSANE_SKIP') or "").split() + | 1159 | skip = set((d.getVar('INSANE_SKIP') or "").split() + |
1160 | (d.getVar('INSANE_SKIP:' + package) or "").split()) | 1160 | (d.getVar('INSANE_SKIP:' + package) or "").split()) |
@@ -1167,22 +1167,21 @@ python do_package_qa () { | |||
1167 | oe.qa.handle_error("pkgname", | 1167 | oe.qa.handle_error("pkgname", |
1168 | "%s doesn't match the [a-z0-9.+-]+ regex" % package, d) | 1168 | "%s doesn't match the [a-z0-9.+-]+ regex" % package, d) |
1169 | 1169 | ||
1170 | checks = parse_test_matrix("QAPATHTEST") | 1170 | checks = parse_test_matrix("QAPATHTEST", skip, d) |
1171 | package_qa_walk(checks, package, d) | 1171 | package_qa_walk(checks, package, d) |
1172 | 1172 | ||
1173 | checks = parse_test_matrix("QAPKGTEST") | 1173 | checks = parse_test_matrix("QAPKGTEST", skip, d) |
1174 | for func in checks: | 1174 | for func in checks: |
1175 | func(package, d) | 1175 | func(package, d) |
1176 | 1176 | ||
1177 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) | 1177 | package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d) |
1178 | package_qa_check_deps(package, pkgdest, d) | 1178 | package_qa_check_deps(package, pkgdest, d) |
1179 | 1179 | ||
1180 | checks = parse_test_matrix("QARECIPETEST") | 1180 | checks = parse_test_matrix("QARECIPETEST", skip, d) |
1181 | for func in checks: | 1181 | for func in checks: |
1182 | func(pn, d) | 1182 | func(pn, d) |
1183 | 1183 | ||
1184 | if 'libdir' in d.getVar("ALL_QA").split(): | 1184 | package_qa_check_libdir(d) |
1185 | package_qa_check_libdir(d) | ||
1186 | 1185 | ||
1187 | oe.qa.exit_if_errors(d) | 1186 | oe.qa.exit_if_errors(d) |
1188 | } | 1187 | } |
@@ -1200,6 +1199,10 @@ python() { | |||
1200 | pkgs = (d.getVar('PACKAGES') or '').split() | 1199 | pkgs = (d.getVar('PACKAGES') or '').split() |
1201 | for pkg in pkgs: | 1200 | for pkg in pkgs: |
1202 | d.appendVarFlag("do_package_qa", "vardeps", " INSANE_SKIP:{}".format(pkg)) | 1201 | d.appendVarFlag("do_package_qa", "vardeps", " INSANE_SKIP:{}".format(pkg)) |
1202 | funcs = d.getVarFlags("QAPATHTEST") | ||
1203 | funcs.update(d.getVarFlags("QAPKGTEST")) | ||
1204 | funcs.update(d.getVarFlags("QARECIPETEST")) | ||
1205 | d.appendVarFlag("do_package_qa", "vardeps", " ".join(funcs.values())) | ||
1203 | } | 1206 | } |
1204 | 1207 | ||
1205 | SSTATETASKS += "do_package_qa" | 1208 | SSTATETASKS += "do_package_qa" |
@@ -1297,7 +1300,9 @@ python do_qa_patch() { | |||
1297 | return False | 1300 | return False |
1298 | 1301 | ||
1299 | srcdir = d.getVar('S') | 1302 | srcdir = d.getVar('S') |
1300 | if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d) or not bb.utils.contains('ALL_QA', 'unimplemented-ptest', True, False, d): | 1303 | if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d): |
1304 | pass | ||
1305 | elif not (bb.utils.contains('ERROR_QA', 'unimplemented-ptest', True, False, d) or bb.utils.contains('WARN_QA', 'unimplemented-ptest', True, False, d)): | ||
1301 | pass | 1306 | pass |
1302 | elif bb.data.inherits_class('ptest', d): | 1307 | elif bb.data.inherits_class('ptest', d): |
1303 | bb.note("Package %s QA: skipping unimplemented-ptest: ptest implementation detected" % d.getVar('PN')) | 1308 | bb.note("Package %s QA: skipping unimplemented-ptest: ptest implementation detected" % d.getVar('PN')) |
@@ -1496,8 +1501,7 @@ do_unpack[postfuncs] += "do_qa_unpack" | |||
1496 | python () { | 1501 | python () { |
1497 | import re | 1502 | import re |
1498 | 1503 | ||
1499 | tests = d.getVar('ALL_QA').split() | 1504 | if bb.utils.contains('ERROR_QA', 'desktop', True, False, d) or bb.utils.contains('WARN_QA', 'desktop', True, False, d): |
1500 | if "desktop" in tests: | ||
1501 | d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native") | 1505 | d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native") |
1502 | 1506 | ||
1503 | ########################################################################### | 1507 | ########################################################################### |
@@ -1547,11 +1551,10 @@ python () { | |||
1547 | oe.qa.handle_error("pkgvarcheck", "recipe uses DEPENDS:${PN}, should use DEPENDS", d) | 1551 | oe.qa.handle_error("pkgvarcheck", "recipe uses DEPENDS:${PN}, should use DEPENDS", d) |
1548 | 1552 | ||
1549 | # virtual/ is meaningless for these variables | 1553 | # virtual/ is meaningless for these variables |
1550 | if "virtual-slash" in (d.getVar("ALL_QA") or "").split(): | 1554 | for k in ['RDEPENDS', 'RPROVIDES']: |
1551 | for k in ['RDEPENDS', 'RPROVIDES']: | 1555 | for var in bb.utils.explode_deps(d.getVar(k + ':' + pn) or ""): |
1552 | for var in bb.utils.explode_deps(d.getVar(k + ':' + pn) or ""): | 1556 | if var.startswith("virtual/"): |
1553 | if var.startswith("virtual/"): | 1557 | oe.qa.handle_error("virtual-slash", "%s is set to %s but the substring 'virtual/' holds no meaning in this context. It only works for build time dependencies, not runtime ones. It is suggested to use 'VIRTUAL-RUNTIME_' variables instead." % (k, var), d) |
1554 | oe.qa.handle_error("virtual-slash", "%s is set to %s but the substring 'virtual/' holds no meaning in this context. It only works for build time dependencies, not runtime ones. It is suggested to use 'VIRTUAL-RUNTIME_' variables instead." % (k, var), d) | ||
1555 | 1558 | ||
1556 | issues = [] | 1559 | issues = [] |
1557 | if (d.getVar('PACKAGES') or "").split(): | 1560 | if (d.getVar('PACKAGES') or "").split(): |
@@ -1561,8 +1564,7 @@ python () { | |||
1561 | if d.getVar(var, False): | 1564 | if d.getVar(var, False): |
1562 | issues.append(var) | 1565 | issues.append(var) |
1563 | 1566 | ||
1564 | fakeroot_tests = d.getVar('FAKEROOT_QA').split() | 1567 | if bb.utils.contains('ERROR_QA', 'host-user-contaminated', True, False, d) or bb.utils.contains('WARN_QA', 'host-user-contaminated', True, False, d): |
1565 | if set(tests) & set(fakeroot_tests): | ||
1566 | d.setVarFlag('do_package_qa', 'fakeroot', '1') | 1568 | d.setVarFlag('do_package_qa', 'fakeroot', '1') |
1567 | d.appendVarFlag('do_package_qa', 'depends', ' virtual/fakeroot-native:do_populate_sysroot') | 1569 | d.appendVarFlag('do_package_qa', 'depends', ' virtual/fakeroot-native:do_populate_sysroot') |
1568 | else: | 1570 | else: |