summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-09-03 22:11:20 +0000
committerMark Spruiell <mes@zeroc.com>2004-09-03 22:11:20 +0000
commit0337fd31dfa9d0e7482eb8d57a294fc5d01ac00f (patch)
tree985c542ecd5c8472663d5880bb10055608756754 /py
parenttype refactoring (diff)
downloadice-0337fd31dfa9d0e7482eb8d57a294fc5d01ac00f.tar.bz2
ice-0337fd31dfa9d0e7482eb8d57a294fc5d01ac00f.tar.xz
ice-0337fd31dfa9d0e7482eb8d57a294fc5d01ac00f.zip
test fixes
Diffstat (limited to 'py')
-rwxr-xr-xpy/allTests.py86
-rw-r--r--py/config/TestUtil.py48
-rwxr-xr-xpy/test/Ice/faultTolerance/run.py9
3 files changed, 97 insertions, 46 deletions
diff --git a/py/allTests.py b/py/allTests.py
new file mode 100755
index 00000000000..a30ed01715f
--- /dev/null
+++ b/py/allTests.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys
+import getopt
+
+for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
+ break
+else:
+ raise "can't find toplevel directory!"
+
+sys.path.append(os.path.join(toplevel, "config"))
+import TestUtil
+
+def runTests(tests, num = 0):
+
+ #
+ # Run each of the tests.
+ #
+ for i in tests:
+
+ i = os.path.normpath(i)
+ dir = os.path.join(toplevel, "test", i)
+
+ print
+ if(num > 0):
+ print "[" + str(num) + "]",
+ print "*** running tests in " + dir,
+ print
+
+ status = os.system(os.path.join(dir, "run.py"))
+
+ if status and not (sys.platform.startswith("aix") and status == 256):
+ if(num > 0):
+ print "[" + str(num) + "]",
+ print "test in " + dir + " failed with exit status", status,
+ sys.exit(status)
+
+#
+# List of all basic tests.
+#
+tests = [ \
+ "Ice/adapterDeactivation", \
+ "Ice/exceptions", \
+ "Ice/facets", \
+ "Ice/faultTolerance", \
+ "Ice/inheritance", \
+ "Ice/objects", \
+ "Ice/operations", \
+ "Ice/slicing/exceptions", \
+ "Ice/slicing/objects", \
+ ]
+
+def usage():
+ print "usage: " + sys.argv[0] + " [-l]"
+ sys.exit(2)
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "l")
+except getopt.GetoptError:
+ usage()
+
+if(args):
+ usage()
+
+loop = 0
+for o, a in opts:
+ if o == "-l":
+ loop = 1
+
+if loop:
+ num = 1
+ while 1:
+ runTests(tests, num)
+ num += 1
+else:
+ runTests(tests)
diff --git a/py/config/TestUtil.py b/py/config/TestUtil.py
index 4050819a0a9..20291652066 100644
--- a/py/config/TestUtil.py
+++ b/py/config/TestUtil.py
@@ -234,8 +234,8 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
serverName, clientName):
testdir = os.path.join(toplevel, "test", name)
- server = os.path.join(testdir, serverName)
- client = os.path.join(testdir, clientName)
+ server = serverName
+ client = clientName
cwd = os.getcwd()
os.chdir(testdir)
@@ -263,46 +263,6 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
os.chdir(cwd)
-def clientServerTestWithPath(name, serverPath, clientPath):
-
- testdir = os.path.join(toplevel, "test", name)
- serverName = "Server.py"
- clientName = "Client.py"
- server = os.path.join(testdir, serverName)
- client = os.path.join(testdir, clientName)
-
- cwd = os.getcwd()
- os.chdir(testdir)
-
- oldPath = os.getenv("PYTHONPATH", "")
-
- os.environ["PYTHONPATH"] = serverPath + ":" + oldPath
- print "starting " + serverName + "...",
- serverCmd = "python " + server + serverOptions + " 2>&1"
- serverPipe = os.popen(serverCmd)
- getServerPid(serverPipe)
- getAdapterReady(serverPipe)
- print "ok"
-
- os.environ["PYTHONPATH"] = clientPath + ":" + oldPath
- print "starting " + clientName + "...",
- clientCmd = "python " + client + clientOptions + " 2>&1"
- clientPipe = os.popen(clientCmd)
- print "ok"
-
- os.environ["PYTHONPATH"] = oldPath
-
- printOutputFromPipe(clientPipe)
-
- clientStatus = clientPipe.close()
- serverStatus = serverPipe.close()
-
- if clientStatus or serverStatus:
- killServers()
- sys.exit(1)
-
- os.chdir(cwd)
-
def clientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions):
clientServerTestWithOptionsAndNames(name, additionalServerOptions, additionalClientOptions,
@@ -315,8 +275,8 @@ def clientServerTest(name):
def mixedClientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions):
testdir = os.path.join(toplevel, "test", name)
- server = os.path.join(testdir, "Server.py")
- client = os.path.join(testdir, "Client.py")
+ server = "Server.py"
+ client = "Client.py"
cwd = os.getcwd()
os.chdir(testdir)
diff --git a/py/test/Ice/faultTolerance/run.py b/py/test/Ice/faultTolerance/run.py
index fe87c5caade..ff12f3baacb 100755
--- a/py/test/Ice/faultTolerance/run.py
+++ b/py/test/Ice/faultTolerance/run.py
@@ -23,8 +23,11 @@ import TestUtil
name = os.path.join("Ice", "faultTolerance")
testdir = os.path.join(toplevel, "test", name)
-server = os.path.join(testdir, "Server.py")
-client = os.path.join(testdir, "Client.py")
+cwd = os.getcwd()
+os.chdir(testdir)
+
+server = "Server.py"
+client = "Client.py"
num = 12
base = 12340
@@ -55,6 +58,8 @@ if clientStatus:
TestUtil.killServers()
sys.exit(1)
+os.chdir(cwd)
+
#
# Exit with status 0 even though some servers failed to shutdown
# properly. There's a problem which is occuring on Linux dual-processor