summaryrefslogtreecommitdiff
path: root/test/pacman/pmenv.py
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2018-12-22 22:24:41 -0800
committerAllan McRae <allan@archlinux.org>2019-01-04 11:10:47 +1000
commit2d403709d97cca381873a9d56cd37f51c0f3eade (patch)
tree201ca01daaeaf3a242c78684ea5fc5e7ff23758f /test/pacman/pmenv.py
parentecac357c1a20f3e09ae979397e5efd225b03f895 (diff)
downloadpacman-2d403709d97cca381873a9d56cd37f51c0f3eade.tar.xz
allow tests for disabled features to be skipped
Previously, pacman's test suite would fail when compiled without signature support. Adds a require_capability method to pmtest objects. Currently recognized values are 'gpg', 'curl', and 'nls'; although only gpg is used presently. Missing features are indicated by running pactest with one of the --without-<feature> options. This modifies pmenv to run each case as independent tests. Previously, a single pmenv could run multiple tests, combining there output into a single TAP stream but making it impossible to properly skip an entire test case. This change does not affect running pactest.py with a single test (as both autotools and meson do), but will affect anybody manually running pactest.py with multiple tests at once. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/pmenv.py')
-rw-r--r--test/pacman/pmenv.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/test/pacman/pmenv.py b/test/pacman/pmenv.py
index 9e6b5625..71001dbf 100644
--- a/test/pacman/pmenv.py
+++ b/test/pacman/pmenv.py
@@ -36,6 +36,11 @@ class pmenv(object):
"valgrind": 0,
"nolog": 0
}
+ self.config = {
+ "gpg": True,
+ "nls": True,
+ "curl": True
+ }
def __str__(self):
return "root = %s\n" \
@@ -52,15 +57,18 @@ class pmenv(object):
def run(self):
"""
"""
- tap.plan(len(self.testcases))
for testcase in self.testcases:
- t = pmtest.pmtest(testcase, self.root)
- tap.diag("Running '%s'" % t.testname)
-
+ t = pmtest.pmtest(testcase, self.root, self.config)
t.load()
- t.generate(self.pacman)
- t.run(self.pacman)
+ if t.skipall:
+ tap.skip_all("skipping %s (%s)" % (t.description, t.skipall))
+ else:
+ tap.plan(1)
+ tap.diag("Running '%s'" % t.testname)
+
+ t.generate(self.pacman)
+ t.run(self.pacman)
- tap.diag("==> Checking rules")
- tap.todo = t.expectfailure
- tap.subtest(lambda: t.check(), t.description)
+ tap.diag("==> Checking rules")
+ tap.todo = t.expectfailure
+ tap.subtest(lambda: t.check(), t.description)