diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-08-04 19:18:45 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-08-04 19:18:45 -0230 |
commit | d9c568300c2aed6ab736026ea116b3f1a72fbe43 (patch) | |
tree | 27191ba2b0d1ef43256561da01462b98c7bd696d /py | |
parent | Merge branch 'R3_3_branch' of ssh://cvs.zeroc.com/home/git/ice into R3_3_branch (diff) | |
download | ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.bz2 ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.xz ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.zip |
Numerous cleanups to the test suite and expect scripts.
Conflicts:
cpp/test/Glacier2/staticFiltering/run.py
Diffstat (limited to 'py')
-rwxr-xr-x | py/allDemos.py | 4 | ||||
-rwxr-xr-x | py/allTests.py | 6 | ||||
-rwxr-xr-x | py/test/Ice/adapterDeactivation/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/binding/run.py | 27 | ||||
-rwxr-xr-x | py/test/Ice/blobject/run.py | 22 | ||||
-rwxr-xr-x | py/test/Ice/checksum/run.py | 22 | ||||
-rwxr-xr-x | py/test/Ice/custom/run.py | 22 | ||||
-rwxr-xr-x | py/test/Ice/exceptions/run.py | 26 | ||||
-rwxr-xr-x | py/test/Ice/facets/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/faultTolerance/run.py | 46 | ||||
-rwxr-xr-x | py/test/Ice/inheritance/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/location/run.py | 22 | ||||
-rwxr-xr-x | py/test/Ice/objects/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/operations/Client.py | 1 | ||||
-rwxr-xr-x | py/test/Ice/operations/run.py | 26 | ||||
-rwxr-xr-x | py/test/Ice/proxy/run.py | 26 | ||||
-rwxr-xr-x | py/test/Ice/retry/run.py | 22 | ||||
-rwxr-xr-x | py/test/Ice/servantLocator/run.py | 26 | ||||
-rwxr-xr-x | py/test/Ice/slicing/exceptions/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/slicing/objects/run.py | 24 | ||||
-rwxr-xr-x | py/test/Ice/timeout/run.py | 22 | ||||
-rwxr-xr-x | py/test/Slice/keyword/run.py | 34 |
22 files changed, 199 insertions, 299 deletions
diff --git a/py/allDemos.py b/py/allDemos.py index b8b3855bdc6..a10fe77ffef 100755 --- a/py/allDemos.py +++ b/py/allDemos.py @@ -17,8 +17,8 @@ for toplevel in [".", "..", "../..", "../../..", "../../../.."]: else: raise "can't find toplevel directory!" -sys.path.append(os.path.join(toplevel, "demoscript")) -import Util +sys.path.append(os.path.join(toplevel)) +from demoscript import Util # # List of all basic demos. diff --git a/py/allTests.py b/py/allTests.py index b603ffae41d..945d04d6aea 100755 --- a/py/allTests.py +++ b/py/allTests.py @@ -12,13 +12,13 @@ import os, sys, re, getopt for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.abspath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): + if os.path.exists(os.path.join(toplevel, "scripts", "TestUtil.py")): break else: raise "can't find toplevel directory!" -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil +sys.path.append(os.path.join(toplevel)) +from scripts import * # # List of all basic tests. diff --git a/py/test/Ice/adapterDeactivation/run.py b/py/test/Ice/adapterDeactivation/run.py index a094c546746..dcb8454ad37 100755 --- a/py/test/Ice/adapterDeactivation/run.py +++ b/py/test/Ice/adapterDeactivation/run.py @@ -10,19 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "adapterDeactivation") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/py/test/Ice/binding/run.py b/py/test/Ice/binding/run.py index a0304394366..2a3d5ec3417 100755 --- a/py/test/Ice/binding/run.py +++ b/py/test/Ice/binding/run.py @@ -10,23 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "binding") - -# -# Need to use mixedClientServerTest instead of clientServerTest, because the -# server makes an invocation on a local object and therefore requires the -# client-side SSL configuration. -# -TestUtil.mixedClientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/blobject/run.py b/py/test/Ice/blobject/run.py index aac96096db2..b31660e7e4c 100755 --- a/py/test/Ice/blobject/run.py +++ b/py/test/Ice/blobject/run.py @@ -15,18 +15,14 @@ if sys.version_info[1] == 3 and sys.platform != 'darwin': print "Test skipped due to python 2.3" sys.exit(0) -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "blobject") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/checksum/run.py b/py/test/Ice/checksum/run.py index 65fc9c9621b..2a3d5ec3417 100755 --- a/py/test/Ice/checksum/run.py +++ b/py/test/Ice/checksum/run.py @@ -10,18 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "checksum") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/custom/run.py b/py/test/Ice/custom/run.py index c22501a2c9b..2a3d5ec3417 100755 --- a/py/test/Ice/custom/run.py +++ b/py/test/Ice/custom/run.py @@ -10,18 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "custom") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/exceptions/run.py b/py/test/Ice/exceptions/run.py index f5153ac8666..2de58587328 100755 --- a/py/test/Ice/exceptions/run.py +++ b/py/test/Ice/exceptions/run.py @@ -10,23 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "exceptions") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") +TestUtil.clientServerTest(server="ServerAMD.py") print "tests with collocated server." -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.collocatedTest() diff --git a/py/test/Ice/facets/run.py b/py/test/Ice/facets/run.py index b3afa6aeb5f..dcb8454ad37 100755 --- a/py/test/Ice/facets/run.py +++ b/py/test/Ice/facets/run.py @@ -10,19 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "facets") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/py/test/Ice/faultTolerance/run.py b/py/test/Ice/faultTolerance/run.py index 5191ac0b503..444473efb53 100755 --- a/py/test/Ice/faultTolerance/run.py +++ b/py/test/Ice/faultTolerance/run.py @@ -10,50 +10,36 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "faultTolerance") -testdir = os.path.join(toplevel, "py", "test", name) - -cwd = os.getcwd() -os.chdir(testdir) - -server = "Server.py" -client = "Client.py" +server = os.path.join(os.getcwd(), "Server.py") +client = os.path.join(os.getcwd(), "Client.py") num = 12 base = 12340 +serverProc = [] for i in range(0, num): print "starting server #%d..." % (i + 1), sys.stdout.flush() - serverPipe = TestUtil.startServer(server, "%d" % (base + i)) - TestUtil.getServerPid(serverPipe) - TestUtil.getAdapterReady(serverPipe) + serverProc.append(TestUtil.startServer(server, "%d" % (base + i))) print "ok" ports = "" for i in range(0, num): ports = "%s %d" % (ports, base + i) print "starting client...", -clientPipe = TestUtil.startClient(client, ports) +clientProc = TestUtil.startClient(client, ports) print "ok" -TestUtil.printOutputFromPipe(clientPipe) -clientStatus = TestUtil.closePipe(clientPipe) -if clientStatus: - TestUtil.killServers() - -if clientStatus or TestUtil.serverStatus(): - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() +for p in serverProc: + p.waitTestSuccess() diff --git a/py/test/Ice/inheritance/run.py b/py/test/Ice/inheritance/run.py index 7ecff0e5ae5..dcb8454ad37 100755 --- a/py/test/Ice/inheritance/run.py +++ b/py/test/Ice/inheritance/run.py @@ -10,19 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "inheritance") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/py/test/Ice/location/run.py b/py/test/Ice/location/run.py index 177ebe2fb41..2a3d5ec3417 100755 --- a/py/test/Ice/location/run.py +++ b/py/test/Ice/location/run.py @@ -10,18 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "location") - -TestUtil.mixedClientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/objects/run.py b/py/test/Ice/objects/run.py index 81b178ba4f4..dcb8454ad37 100755 --- a/py/test/Ice/objects/run.py +++ b/py/test/Ice/objects/run.py @@ -10,19 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "objects") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/py/test/Ice/operations/Client.py b/py/test/Ice/operations/Client.py index e4a3fd608f4..dca3994a058 100755 --- a/py/test/Ice/operations/Client.py +++ b/py/test/Ice/operations/Client.py @@ -9,6 +9,7 @@ # ********************************************************************** import os, sys, traceback +import Ice import Ice slice_dir = Ice.getSliceDir() diff --git a/py/test/Ice/operations/run.py b/py/test/Ice/operations/run.py index 39ed6740919..3a25c7c894e 100755 --- a/py/test/Ice/operations/run.py +++ b/py/test/Ice/operations/run.py @@ -10,23 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "operations") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") +TestUtil.clientServerTest(server="ServerAMD.py") print "tests with collocated server." -TestUtil.collocatedTestWithOptions(name, " --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") -sys.exit(0) +TestUtil.collocatedTest(" --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") diff --git a/py/test/Ice/proxy/run.py b/py/test/Ice/proxy/run.py index 2aa17f08bd3..3a25c7c894e 100755 --- a/py/test/Ice/proxy/run.py +++ b/py/test/Ice/proxy/run.py @@ -10,23 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "proxy") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") +TestUtil.clientServerTest(server="ServerAMD.py") print "tests with collocated server." -TestUtil.collocatedTestWithOptions(name, " --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") -sys.exit(0) +TestUtil.collocatedTest(" --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") diff --git a/py/test/Ice/retry/run.py b/py/test/Ice/retry/run.py index f0bc8d57120..2a3d5ec3417 100755 --- a/py/test/Ice/retry/run.py +++ b/py/test/Ice/retry/run.py @@ -10,18 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "retry") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Ice/servantLocator/run.py b/py/test/Ice/servantLocator/run.py index d8d4a2e1c73..3a25c7c894e 100755 --- a/py/test/Ice/servantLocator/run.py +++ b/py/test/Ice/servantLocator/run.py @@ -10,23 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "servantLocator") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") +TestUtil.clientServerTest(server="ServerAMD.py") print "tests with collocated server." -TestUtil.collocatedTestWithOptions(name, " --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") -sys.exit(0) +TestUtil.collocatedTest(" --Ice.ThreadPool.Client.SizeMax=2 --Ice.ThreadPool.Client.SizeWarn=0") diff --git a/py/test/Ice/slicing/exceptions/run.py b/py/test/Ice/slicing/exceptions/run.py index fd8cccc1533..0914250c192 100755 --- a/py/test/Ice/slicing/exceptions/run.py +++ b/py/test/Ice/slicing/exceptions/run.py @@ -10,21 +10,17 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "slicing", "exceptions") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") -sys.exit(0) +TestUtil.clientServerTest(server="ServerAMD.py") diff --git a/py/test/Ice/slicing/objects/run.py b/py/test/Ice/slicing/objects/run.py index 65f973cda48..0914250c192 100755 --- a/py/test/Ice/slicing/objects/run.py +++ b/py/test/Ice/slicing/objects/run.py @@ -10,21 +10,17 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "slicing", "objects") +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "ServerAMD.py", "Client.py") -sys.exit(0) +TestUtil.clientServerTest(server="ServerAMD.py") diff --git a/py/test/Ice/timeout/run.py b/py/test/Ice/timeout/run.py index f04e73b903a..2a3d5ec3417 100755 --- a/py/test/Ice/timeout/run.py +++ b/py/test/Ice/timeout/run.py @@ -10,18 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "timeout") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/py/test/Slice/keyword/run.py b/py/test/Slice/keyword/run.py index 1e8824ce002..9864d605819 100755 --- a/py/test/Slice/keyword/run.py +++ b/py/test/Slice/keyword/run.py @@ -10,31 +10,17 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -testdir = os.path.dirname(os.path.abspath(__file__)) - -cwd = os.getcwd() -os.chdir(testdir) +sys.path.append(os.path.join(path[0])) +from scripts import * print "starting client...", -clientPipe = os.popen("python Client.py --Ice.Default.Host=127.0.0.1 2>&1") +clientProc = TestUtil.startClient("Client.py", "--Ice.Default.Host=127.0.0.1") print "ok" - -TestUtil.printOutputFromPipe(clientPipe); - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() |