summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-23 05:54:49 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-23 05:54:49 +0100
commit94874d90e205114ae71d8a8ed9b4273382434a29 (patch)
tree3e8884f78838e8457152d38ec9af44c6865bca32
parent6cd69fa9ff66a3dd77f9773bd7fb62e79512f5e7 (diff)
downloadpacman-94874d90e205114ae71d8a8ed9b4273382434a29.tar.gz
pacman-94874d90e205114ae71d8a8ed9b4273382434a29.tar.xz
* Fixed globbing for pactest --test argument
* --manual-confirm was handled in the wrong order
-rw-r--r--Makefile.am2
-rwxr-xr-xpactest/pactest.py14
-rwxr-xr-xpactest/pmtest.py4
3 files changed, 13 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 9d3f6187..7602963f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,6 @@ EXTRA_DIST = HACKING
# TODO : figure out a way to get 'make distcheck' to build with
# --disable-fakeroot so it actually passes tests
check-local: src/pacman
- python $(top_srcdir)/pactest/pactest.py --test=$(top_srcdir)/pactest/tests/*.py -p $(top_builddir)/src/pacman/pacman --debug=1
+ python $(top_srcdir)/pactest/pactest.py --test $(top_srcdir)/pactest/tests/*.py -p $(top_builddir)/src/pacman/pacman --debug=1
rm -rf $(top_builddir)/root
diff --git a/pactest/pactest.py b/pactest/pactest.py
index 7166a9d4..77ce0af3 100755
--- a/pactest/pactest.py
+++ b/pactest/pactest.py
@@ -32,13 +32,20 @@ def resolveBinPath(option, opt_str, value, parser):
setattr(parser.values, option.dest, os.path.abspath(value))
def globTests(option, opt_str, value, parser):
+ idx=0
globlist = []
- globlist.extend(glob.glob(value))
+
+ # maintain the idx so we can modify rargs
+ while not parser.rargs[idx].startswith('-'):
+ globlist += glob.glob(parser.rargs[idx])
+ idx += 1
+
+ parser.rargs = parser.rargs[idx:]
setattr(parser.values, option.dest, globlist)
def createOptParser():
testcases = []
- usage = "usage: %prog [options] [[--test=<path/to/testfile.py>] ...]"
+ usage = "usage: %prog [options] [[--test <path/to/testfile.py>] ...]"
description = "Runs automated tests on the pacman binary. Tests are " \
"described using an easy python syntax, and several can be " \
"ran at once."
@@ -55,8 +62,7 @@ def createOptParser():
dest = "bin", default = "pacman",
help = "specify location of the pacman binary")
parser.add_option("-t", "--test", action = "callback",
- callback = globTests, type = "string",
- dest = "testcases",
+ callback = globTests, dest = "testcases",
help = "specify test case(s)")
parser.add_option("--nolog", action = "store_true",
dest = "nolog", default = False,
diff --git a/pactest/pmtest.py b/pactest/pmtest.py
index 0332f231..629a5754 100755
--- a/pactest/pmtest.py
+++ b/pactest/pmtest.py
@@ -188,10 +188,10 @@ class pmtest:
cmd.append("libtool gdb --args")
if pacman["valgrind"]:
cmd.append("valgrind --tool=memcheck --leak-check=full --show-reachable=yes")
- if not pacman["manual-confirm"]:
- cmd.append("--noconfirm")
cmd.append("%s --config=%s --root=%s" \
% (pacman["bin"], os.path.join(self.root, PACCONF), self.root))
+ if not pacman["manual-confirm"]:
+ cmd.append("--noconfirm")
if pacman["debug"]:
cmd.append("--debug=%s" % pacman["debug"])
cmd.append("%s" % self.args)