[pacman-dev] CVS update of pacman-lib (3 files)

Aaron Griffin aaron at archlinux.org
Thu Feb 22 23:54:49 EST 2007


    Date: Thursday, February 22, 2007 @ 23:54:49
  Author: aaron
    Path: /home/cvs-pacman/pacman-lib

Modified: Makefile.am (1.16 -> 1.17) pactest/pactest.py (1.5 -> 1.6)
          pactest/pmtest.py (1.3 -> 1.4)

* Fixed globbing for pactest --test argument
* --manual-confirm was handled in the wrong order


--------------------+
 Makefile.am        |    2 +-
 pactest/pactest.py |   14 ++++++++++----
 pactest/pmtest.py  |    4 ++--
 3 files changed, 13 insertions(+), 7 deletions(-)


Index: pacman-lib/Makefile.am
diff -u pacman-lib/Makefile.am:1.16 pacman-lib/Makefile.am:1.17
--- pacman-lib/Makefile.am:1.16	Thu Feb 22 21:00:30 2007
+++ pacman-lib/Makefile.am	Thu Feb 22 23:54:49 2007
@@ -9,6 +9,6 @@
 # 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
 
Index: pacman-lib/pactest/pactest.py
diff -u pacman-lib/pactest/pactest.py:1.5 pacman-lib/pactest/pactest.py:1.6
--- pacman-lib/pactest/pactest.py:1.5	Thu Feb 22 23:22:21 2007
+++ pacman-lib/pactest/pactest.py	Thu Feb 22 23:54:49 2007
@@ -32,13 +32,20 @@
     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 @@
                       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,
Index: pacman-lib/pactest/pmtest.py
diff -u pacman-lib/pactest/pmtest.py:1.3 pacman-lib/pactest/pmtest.py:1.4
--- pacman-lib/pactest/pmtest.py:1.3	Thu Feb 22 23:22:21 2007
+++ pacman-lib/pactest/pmtest.py	Thu Feb 22 23:54:49 2007
@@ -188,10 +188,10 @@
             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)




More information about the pacman-dev mailing list