summaryrefslogtreecommitdiff
path: root/test/pacman/pmrule.py
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-07-29 15:22:07 -0400
committerAllan McRae <allan@archlinux.org>2013-08-21 11:00:18 +1000
commit1152052b3e27e3252f6685a369fce8a426710015 (patch)
treec7e31e108faa3cf8b464cd04fbe2123abe76b6e8 /test/pacman/pmrule.py
parent429b956fb2d21309cae0560d6d98225969447737 (diff)
convert pactest to TAP output
Each test produces a single TAP result with the rules run in a sub-test. This reduces output when run under automake and makes it possible to continue setting expectfailure at the test level rather than per-rule. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/pmrule.py')
-rw-r--r--test/pacman/pmrule.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py
index 3d38b852..c97a1584 100644
--- a/test/pacman/pmrule.py
+++ b/test/pacman/pmrule.py
@@ -19,6 +19,7 @@
import os
import stat
+import tap
import util
class pmrule(object):
@@ -57,12 +58,12 @@ class pmrule(object):
elif case == "OUTPUT":
logfile = os.path.join(test.root, util.LOGFILE)
if not os.access(logfile, os.F_OK):
- print "LOGFILE not found, cannot validate 'OUTPUT' rule"
+ tap.diag("LOGFILE not found, cannot validate 'OUTPUT' rule")
success = 0
elif not util.grep(logfile, key):
success = 0
else:
- print "PACMAN rule '%s' not found" % case
+ tap.diag("PACMAN rule '%s' not found" % case)
success = -1
elif kind == "PKG":
localdb = test.db["local"]
@@ -108,7 +109,7 @@ class pmrule(object):
if not found:
success = 0
else:
- print "PKG rule '%s' not found" % case
+ tap.diag("PKG rule '%s' not found" % case)
success = -1
elif kind == "FILE":
filename = os.path.join(test.root, key)
@@ -148,7 +149,7 @@ class pmrule(object):
if not os.path.isfile("%s.pacsave" % filename):
success = 0
else:
- print "FILE rule '%s' not found" % case
+ tap.diag("FILE rule '%s' not found" % case)
success = -1
elif kind == "DIR":
filename = os.path.join(test.root, key)
@@ -156,7 +157,7 @@ class pmrule(object):
if not os.path.isdir(filename):
success = 0
else:
- print "DIR rule '%s' not found" % case
+ tap.diag("DIR rule '%s' not found" % case)
success = -1
elif kind == "LINK":
filename = os.path.join(test.root, key)
@@ -164,7 +165,7 @@ class pmrule(object):
if not os.path.islink(filename):
success = 0
else:
- print "LINK rule '%s' not found" % case
+ tap.diag("LINK rule '%s' not found" % case)
success = -1
elif kind == "CACHE":
cachedir = os.path.join(test.root, util.PM_CACHEDIR)
@@ -174,7 +175,7 @@ class pmrule(object):
os.path.join(cachedir, pkg.filename())):
success = 0
else:
- print "Rule kind '%s' not found" % kind
+ tap.diag("Rule kind '%s' not found" % kind)
success = -1
if self.false and success != -1: