summaryrefslogtreecommitdiff
path: root/scripts/TestUtil.py
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2016-07-27 14:36:18 -0400
committerJoe George <joe@zeroc.com>2016-07-27 14:36:18 -0400
commitf494f16d6c02df4fe06bf9854cc45fb4b2a93b48 (patch)
tree9a3099465f6d2528cd6686c9802e579234623b35 /scripts/TestUtil.py
parentC++11 CertificateVerifier and PasswordPrompt (diff)
downloadice-f494f16d6c02df4fe06bf9854cc45fb4b2a93b48.tar.bz2
ice-f494f16d6c02df4fe06bf9854cc45fb4b2a93b48.tar.xz
ice-f494f16d6c02df4fe06bf9854cc45fb4b2a93b48.zip
ICE-7242 - Cross test updates
Diffstat (limited to 'scripts/TestUtil.py')
-rwxr-xr-xscripts/TestUtil.py103
1 files changed, 53 insertions, 50 deletions
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index 10438fe42eb..362f4080da0 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -545,8 +545,9 @@ def run(tests, root = False):
filters.append((testFilter, False))
elif o == "--cross":
global cross
- if a not in ["cpp", "csharp", "java", "js", "python", "ruby", "objective-c" ]:
- print("cross must be one of cpp, csharp, java, js, python, ruby or objective-c")
+ crossLang = ["cpp", "csharp", "java", "js", "php", "python", "ruby", "objective-c"]
+ if a not in crossLang:
+ print("cross must be one of %s" % ', '.join(crossLang))
sys.exit(1)
cross.append(a)
elif o == "--all" :
@@ -630,13 +631,15 @@ def run(tests, root = False):
if allCross:
if len(cross) == 0:
- cross = ["cpp", "java", "js"]
+ cross = ["cpp", "java", "js", "php", "python", "ruby"]
if isWin32():
cross.append("csharp")
+ # TODO/XXX: we're currently not building Ruby on Windows
+ cross.remove('ruby')
if isDarwin():
cross.append("objective-c")
if root:
- allLang = ["cpp", "java", "js"]
+ allLang = ["cpp", "java", "js", "python"]
if isWin32():
allLang.append("csharp")
if isDarwin():
@@ -736,25 +739,36 @@ def getSliceDir():
return os.path.join(toplevel, "slice")
def phpCleanup():
- if os.path.exists("tmp.ini"):
- os.remove("tmp.ini")
if os.path.exists("ice.profiles"):
os.remove("ice.profiles")
-def phpSetup(clientConfig = False, iceOptions = None, iceProfile = None):
+def phpProfileSetup(clientConfig = False, iceOptions = None, iceProfile = None):
+ interpreterOptions = []
+
+ if iceProfile != None:
+ atexit.register(phpCleanup)
+ interpreterOptions.append("-d ice.profiles='ice.profiles'")
+ tmpProfiles = open("ice.profiles", "w")
+ tmpProfiles.write("[%s]\n" % iceProfile)
+ if clientConfig:
+ tmpProfiles.write("ice.config=\"config.client\"\n")
+ if iceOptions != None:
+ tmpProfiles.write("ice.options=\"%s\"\n" % iceOptions)
+ tmpProfiles.close()
+ else:
+ if clientConfig:
+ interpreterOptions.append("-d ice.config='config.client'")
+ if iceOptions != None:
+ interpreterOptions.append("-d ice.options='%s'" % iceOptions)
+
+ return ' '.join(interpreterOptions)
+
+def phpFlags():
+ flags = []
extDir = None
ext = None
incDir = None
- #
- # TODO
- #
- # When we no longer support PHP 5.1.x, we can use the following PHP
- # command-line options:
- #
- # -d extension_dir=...
- # -d extension=[php_ice.dll|IcePHP.so]
- #
if isWin32():
ext = "php_ice.dll"
if not iceHome:
@@ -804,29 +818,13 @@ def phpSetup(clientConfig = False, iceOptions = None, iceProfile = None):
print("unable to find IcePHP extension!")
sys.exit(1)
- atexit.register(phpCleanup)
- tmpini = open("tmp.ini", "w")
- tmpini.write("; Automatically generated by Ice test driver.\n")
if extDir:
- tmpini.write("extension_dir=\"%s\"\n" % extDir)
- tmpini.write("extension=%s\n" % ext)
+ flags.append("-d extension_dir='%s'" % extDir)
+ flags.append("-d extension='%s'" % ext)
if incDir:
- tmpini.write("include_path=\"%s\"\n" % incDir)
- if iceProfile != None:
- tmpini.write("ice.profiles=\"ice.profiles\"\n")
- tmpProfiles = open("ice.profiles", "w")
- tmpProfiles.write("[%s]\n" % iceProfile)
- if clientConfig:
- tmpProfiles.write("ice.config=\"config.client\"\n")
- if iceOptions != None:
- tmpProfiles.write("ice.options=\"%s\"\n" % iceOptions)
- tmpProfiles.close()
- else:
- if clientConfig:
- tmpini.write("ice.config=\"config.client\"\n")
- if iceOptions != None:
- tmpini.write("ice.options=\"%s\"\n" % iceOptions)
- tmpini.close()
+ flags.append("-d include_path='%s'" % incDir)
+
+ return ' '.join(flags)
def getIceBox():
global cpp11
@@ -1216,7 +1214,7 @@ def getCommandLine(exe, config, options = "", interpreterOptions = "", cfgName =
output.write(" " + interpreterOptions)
output.write(' "%s" ' % exe)
elif config.lang == "php" and config.type == "client":
- output.write(phpCmd + " -n -c tmp.ini")
+ output.write(phpCmd + " -n %s" % phpFlags())
if interpreterOptions:
output.write(" " + interpreterOptions)
output.write(" -f \""+ exe +"\" -- ")
@@ -1544,7 +1542,7 @@ def clientServerTest(cfgName = None, additionalServerOptions = "", additionalCli
clientdir = getMirrorDir(getClientCrossTestDir(testdir), clientLang)
else:
clientdir = getMirrorDir(testdir, clientLang)
-
+
client = getDefaultClientFile(clientLang, clientdir)
clientDesc = os.path.basename(client)
clientCfg.lang = clientLang
@@ -1567,9 +1565,6 @@ def clientServerTest(cfgName = None, additionalServerOptions = "", additionalCli
if clientenv is None:
clientenv = getTestEnv(clientLang, clientdir)
- if lang == "php":
- phpSetup()
-
clientExe = client
serverExe = server
@@ -1707,9 +1702,6 @@ def clientEchoTest(additionalServerOptions = "", additionalClientOptions = "",
if clientenv is None:
clientenv = getTestEnv(clientLang, clientdir)
- if lang == "php":
- phpSetup()
-
clientExe = client
serverExe = server
@@ -1760,9 +1752,13 @@ def startClient(exe, args = "", config=None, env=None, echo = True, startReader
config = DriverConfig("client")
if env is None:
env = getTestEnv(getDefaultMapping(), os.getcwd())
- cmd = getCommandLine(exe, config, args)
+
+ interpreterOptions = ""
if config.lang == "php":
- phpSetup(clientConfig, iceOptions, iceProfile)
+ interpreterOptions = phpProfileSetup(clientConfig, iceOptions, iceProfile)
+
+ cmd = getCommandLine(exe, config, args, interpreterOptions)
+
return spawnClient(cmd, env = env, echo = echo, startReader = startReader, lang=config.lang)
def startServer(exe, args = "", config = None, env = None, adapter = None, count = 1, echo = True, timeout = 60,
@@ -1772,7 +1768,8 @@ def startServer(exe, args = "", config = None, env = None, adapter = None, count
if env is None:
env = getTestEnv(getDefaultMapping(), os.getcwd())
cmd = getCommandLine(exe, config, args, interpreterOptions)
- return spawnServer(cmd, env = env, adapter = adapter, count = count, echo = echo, lang = config.lang, mx = config.mx, timeout = timeout)
+ return spawnServer(cmd, env = env, adapter = adapter, count = count, echo = echo, lang = config.lang,
+ mx = config.mx, timeout = timeout)
def startColloc(exe, args, config=None, env=None, interpreterOptions = ""):
exe = quoteArgument(exe)
@@ -2117,8 +2114,9 @@ def processCmdLine():
elif o == "--cross":
global cross
cross.append(a)
- if not a in ["cpp", "csharp", "java", "js", "python", "ruby", "objective-c" ]:
- print("cross must be one of cpp, csharp, java, js, python, ruby or objective-c")
+ crossLang = ["cpp", "csharp", "java", "js", "php", "python", "ruby", "objective-c"]
+ if not a in crossLang:
+ print("cross must be one of %s" % ', '.join(crossLang))
sys.exit(1)
if getTestName() not in crossTests:
print("*** This test does not support cross language testing")
@@ -2400,6 +2398,11 @@ def runTests(start, expanded, num = 0, script = False):
print("%s*** test not supported with appverifier%s" % (prefix, suffix))
continue
+ # Skip tests that no not exist for this language mapping
+ if not os.path.exists(dir):
+ print("%s*** test does not exist for this language mapping%s" % (prefix, suffix))
+ continue
+
if script:
print("echo \"*** test started: `date`\"")
print("cd %s" % dir)