From 94874d90e205114ae71d8a8ed9b4273382434a29 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 23 Feb 2007 04:54:49 +0000 Subject: * Fixed globbing for pactest --test argument * --manual-confirm was handled in the wrong order --- pactest/pactest.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pactest/pactest.py') 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=] ...]" + usage = "usage: %prog [options] [[--test ] ...]" 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, -- cgit v1.2.3-54-g00ecf