summaryrefslogtreecommitdiff
path: root/cppe/allTests.py
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-04-27 15:17:31 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-04-27 15:17:31 +0000
commit977fd8f4f02d263b729770383e265f0d01d53b9c (patch)
treebc8442b3cafea94774422c89213bb0310a0eaa92 /cppe/allTests.py
parentImproved testsuite (diff)
downloadice-977fd8f4f02d263b729770383e265f0d01d53b9c.tar.bz2
ice-977fd8f4f02d263b729770383e265f0d01d53b9c.tar.xz
ice-977fd8f4f02d263b729770383e265f0d01d53b9c.zip
IMproved testsuite
Diffstat (limited to 'cppe/allTests.py')
-rwxr-xr-xcppe/allTests.py61
1 files changed, 49 insertions, 12 deletions
diff --git a/cppe/allTests.py b/cppe/allTests.py
index 78e66a19f91..1178542b4dd 100755
--- a/cppe/allTests.py
+++ b/cppe/allTests.py
@@ -18,11 +18,34 @@ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
else:
raise "can't find toplevel directory!"
-sys.path.append(os.path.join(toplevel, "config"))
-import TestUtil
+def isCygwin():
-def runTests(tests, num = 0):
+ # The substring on sys.platform is required because some cygwin
+ # versions return variations like "cygwin_nt-4.01".
+ if sys.platform[:6] == "cygwin":
+ return 1
+ else:
+ return 0
+def isWin32():
+
+ if sys.platform == "win32" or isCygwin():
+ return 1
+ else:
+ return 0
+
+def isWin9x():
+
+ if isWin32():
+ if os.environ.has_key("OS") and os.environ["OS"] == "Windows_NT":
+ return 0
+ return 1
+ else:
+ return 0
+
+def runTests(args, tests, num = 0):
+
+ print args
#
# Run each of the tests.
#
@@ -37,10 +60,10 @@ def runTests(tests, num = 0):
print "*** running tests in " + dir,
print
- if TestUtil.isWin9x():
- status = os.system("python " + os.path.join(dir, "run.py"))
+ if isWin9x():
+ status = os.system("python " + os.path.join(dir, "run.py " + args))
else:
- status = os.system(os.path.join(dir, "run.py"))
+ status = os.system(os.path.join(dir, "run.py " + args))
if status:
if(num > 0):
@@ -69,17 +92,18 @@ tests = [
#
# These tests are currently disabled on cygwin
#
-if TestUtil.isCygwin() == 0:
+if isCygwin() == 0:
tests += [ \
]
def usage():
- print "usage: " + sys.argv[0] + " [-l]"
+ print "usage: " + sys.argv[0] + " -l -r <regex> -R <regex> --host host --blocking"
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "l")
+ opts, args = getopt.getopt(sys.argv[1:], "lr:R:", \
+ ["host=", "blocking"])
except getopt.GetoptError:
usage()
@@ -87,14 +111,27 @@ 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 == "--host" :
+ args += " " + o + " " + a
+ if o in ( "--blocking" ):
+ args += " " + o
+
if loop:
num = 1
while 1:
- runTests(tests, num)
+ runTests(args, tests, num)
num += 1
else:
- runTests(tests)
+ runTests(args, tests)