summaryrefslogtreecommitdiff
path: root/cs/config/TestUtil.py
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-07-13 03:42:12 +0000
committerMichi Henning <michi@zeroc.com>2004-07-13 03:42:12 +0000
commit98ca2a135b1165f1eb75ea794e5e60d77a0872dc (patch)
tree5ac4f6fe9e258d4ad7fe9f24181b000ca764c8fe /cs/config/TestUtil.py
parentAdded work-around for broken Mono DefaultInvariant comparer. (diff)
downloadice-98ca2a135b1165f1eb75ea794e5e60d77a0872dc.tar.bz2
ice-98ca2a135b1165f1eb75ea794e5e60d77a0872dc.tar.xz
ice-98ca2a135b1165f1eb75ea794e5e60d77a0872dc.zip
Changed test suite to work with Mono.
Diffstat (limited to 'cs/config/TestUtil.py')
-rw-r--r--cs/config/TestUtil.py104
1 files changed, 51 insertions, 53 deletions
diff --git a/cs/config/TestUtil.py b/cs/config/TestUtil.py
index bc4150f4fad..891d76a5889 100644
--- a/cs/config/TestUtil.py
+++ b/cs/config/TestUtil.py
@@ -110,7 +110,7 @@ def getAdapterReady(serverPipe):
def waitServiceReady(pipe, token):
- while True:
+ while 1:
output = pipe.readline().strip()
@@ -123,7 +123,7 @@ def waitServiceReady(pipe, token):
def printOutputFromPipe(pipe):
- while True:
+ while 1:
c = pipe.read(1)
@@ -185,33 +185,43 @@ serverOptions = serverProtocol + defaultHost + commonServerOptions
clientServerOptions = clientServerProtocol + defaultHost + commonServerOptions
collocatedOptions = clientServerProtocol + defaultHost
-def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additionalClientOptions, \
+def createMsg(mono, name):
+
+ msg = "starting "
+ if mono:
+ msg += "mono "
+ msg += name
+ if mono:
+ msg += ".exe"
+ msg += "..."
+
+ return msg
+
+def createCmd(mono, bin):
+
+ if mono:
+ return "mono " + bin + ".exe"
+ else:
+ return bin
+
+def clientServerTestWithOptionsAndNames(mono, name, additionalServerOptions, additionalClientOptions, \
serverName, clientName):
- testDir = os.path.join(toplevel, "test", name)
- server = os.path.basename(serverName)
- serverDir = os.path.dirname(os.path.join(testDir, serverName))
- client = os.path.basename(clientName)
- clientDir = os.path.dirname(os.path.join(testDir, clientName))
+ testdir = os.path.join(toplevel, "test", name)
+ server = os.path.join(testdir, serverName)
+ client = os.path.join(testdir, clientName)
- cwd = os.getcwd()
-
- print "starting " + serverName + "...",
- os.chdir(serverDir)
- serverPipe = os.popen(os.path.join(".", server) + serverOptions + " " + additionalServerOptions)
+ print createMsg(mono, serverName),
+
+ serverPipe = os.popen(createCmd(mono, server) + serverOptions + " " + additionalServerOptions)
getServerPid(serverPipe)
getAdapterReady(serverPipe)
print "ok"
- os.chdir(cwd)
-
- print "starting " + clientName + "...",
- os.chdir(clientDir);
- clientPipe = os.popen(os.path.join(".", client) + clientOptions + " " + additionalClientOptions)
+ print createMsg(mono, clientName),
+ clientPipe = os.popen(createCmd(mono, client) + clientOptions + " " + additionalClientOptions)
print "ok"
- os.chdir(cwd)
-
printOutputFromPipe(clientPipe)
clientStatus = clientPipe.close()
@@ -221,38 +231,32 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
killServers()
sys.exit(1)
-def clientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions):
+def clientServerTestWithOptions(mono, name, additionalServerOptions, additionalClientOptions):
- clientServerTestWithOptionsAndNames(name, additionalServerOptions, additionalClientOptions, "server", "client")
+ clientServerTestWithOptionsAndNames(mono, name, additionalServerOptions, additionalClientOptions, "server", "client")
-def clientServerTest(name):
+def clientServerTest(mono, name):
- clientServerTestWithOptions(name, "", "")
+ clientServerTestWithOptions(mono, name, "", "")
-def mixedClientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions):
+def mixedClientServerTestWithOptions(mono, name, additionalServerOptions, additionalClientOptions):
- testDir = os.path.join(toplevel, "test", name)
+ testdir = os.path.join(toplevel, "test", name)
+ server = os.path.join(testdir, "server")
+ client = os.path.join(testdir, "client")
- cwd = os.getcwd()
-
- print "starting server...",
- os.chdir(testDir);
- serverPipe = os.popen(os.path.join(".", "server") + clientServerOptions + " " + additionalServerOptions)
+ print createMsg(mono, "server"),
+ serverPipe = os.popen(createCmd(mono, server) + clientServerOptions + " " + additionalServerOptions)
getServerPid(serverPipe)
getAdapterReady(serverPipe)
print "ok"
- os.chdir(cwd)
-
- print "starting client...",
- os.chdir(testDir);
- clientPipe = os.popen(os.path.join(".", "client") + clientServerOptions + " " + additionalClientOptions)
+ print createMsg(mono, "client"),
+ clientPipe = os.popen(createCmd(mono, client) + clientServerOptions + " " + additionalClientOptions)
getServerPid(clientPipe)
getAdapterReady(clientPipe)
print "ok"
- os.chdir(cwd)
-
printOutputFromPipe(clientPipe)
clientStatus = clientPipe.close()
@@ -262,25 +266,19 @@ def mixedClientServerTestWithOptions(name, additionalServerOptions, additionalCl
killServers()
sys.exit(1)
-def mixedClientServerTest(name):
-
- mixedClientServerTestWithOptions(name, "", "")
+def mixedClientServerTest(mono, name):
-def collocatedTestWithOptions(name, additionalOptions):
+ mixedClientServerTestWithOptions(mono, name, "", "")
- testDir = os.path.join(toplevel, "test", name)
- collocatedDir = os.path.dirname(os.path.join(testDir, "collocated"))
+def collocatedTestWithOptions(mono, name, additionalOptions):
- cwd = os.getcwd()
+ testdir = os.path.join(toplevel, "test", name)
+ collocated = os.path.join(testdir, "collocated")
- os.chdir(collocatedDir)
-
- print "starting collocated...",
- collocatedPipe = os.popen(os.path.join(".", "collocated") + collocatedOptions + " " + additionalOptions)
+ print createMsg(mono, "collocated"),
+ collocatedPipe = os.popen(createCmd(mono, collocated) + collocatedOptions + " " + additionalOptions)
print "ok"
- os.chdir(cwd)
-
printOutputFromPipe(collocatedPipe)
collocatedStatus = collocatedPipe.close()
@@ -289,9 +287,9 @@ def collocatedTestWithOptions(name, additionalOptions):
killServers()
sys.exit(1)
-def collocatedTest(name):
+def collocatedTest(mono, name):
- collocatedTestWithOptions(name, "")
+ collocatedTestWithOptions(mono, name, "")
def cleanDbDir(path):