summaryrefslogtreecommitdiff
path: root/php/allTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'php/allTests.py')
-rwxr-xr-xphp/allTests.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/php/allTests.py b/php/allTests.py
index 7ebd855328e..6bbf8e916c0 100755
--- a/php/allTests.py
+++ b/php/allTests.py
@@ -18,10 +18,7 @@ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
else:
raise "can't find toplevel directory!"
-sys.path.append(os.path.join(toplevel, "config"))
-import TestUtil
-
-def runTests(tests, num = 0):
+def runTests(args, tests, num = 0):
#
# Run each of the tests.
@@ -37,7 +34,7 @@ def runTests(tests, num = 0):
print "*** running tests in " + dir,
print
- status = os.system(os.path.join(dir, "run.py"))
+ status = os.system("python " + os.path.join(dir, "run.py " + args))
if status and not (sys.platform.startswith("aix") and status == 256):
if(num > 0):
@@ -60,11 +57,12 @@ tests = [ \
]
def usage():
- print "usage: " + sys.argv[0] + " [-l]"
+ print "usage: " + sys.argv[0] + " -l -r <regex> -R <regex> --debug --protocol protocol --compress --host host --threadPerConnection"
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "l")
+ opts, args = getopt.getopt(sys.argv[1:], "lr:R:", \
+ ["debug", "protocol=", "compress", "host=", "threadPerConnection"])
except getopt.GetoptError:
usage()
@@ -72,14 +70,28 @@ if(args):
usage()
loop = 0
+args = ""
for o, a in opts:
if o == "-l":
loop = 1
+ if o == "-r" or o == '-R':
+ import re
+ regexp = re.compile(a)
+ if o == '-r':
+ def rematch(x): return regexp.search(x)
+ else:
+ def rematch(x): return not regexp.search(x)
+ tests = filter(rematch, tests)
+ if o in ( "--protocol", "--host" ):
+ args += " " + o + " " + a
+ if o in ( "--debug", "--compress", "--threadPerConnection" ):
+ args += " " + o
+
if loop:
num = 1
while 1:
- runTests(tests, num)
+ runTests(args, tests, num)
num += 1
else:
- runTests(tests)
+ runTests(args, tests)