diff options
author | Joe George <joe@zeroc.com> | 2016-08-30 11:37:01 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2016-08-30 11:38:46 -0400 |
commit | 5b34410c278acab9eb296ce4d24f80e69b6fd6dc (patch) | |
tree | 1aac49502a08970e9f730d6a4ebaa7cf03ee8048 | |
parent | Fixed minor bug with client side user exception check that would occur with 1... (diff) | |
download | ice-5b34410c278acab9eb296ce4d24f80e69b6fd6dc.tar.bz2 ice-5b34410c278acab9eb296ce4d24f80e69b6fd6dc.tar.xz ice-5b34410c278acab9eb296ce4d24f80e69b6fd6dc.zip |
ICE-7242 - Cross test updates
-rw-r--r-- | csharp/test/Ice/servantLocator/AllTests.cs | 3 | ||||
-rw-r--r-- | php/test/Ice/exceptions/Client.php | 5 | ||||
-rwxr-xr-x | php/test/Ice/exceptions/run.py | 16 | ||||
-rw-r--r-- | python/test/Ice/slicing/exceptions/ServerPrivateAMD.ice | 15 | ||||
-rwxr-xr-x | scripts/TestUtil.py | 106 |
5 files changed, 87 insertions, 58 deletions
diff --git a/csharp/test/Ice/servantLocator/AllTests.cs b/csharp/test/Ice/servantLocator/AllTests.cs index b81ea91fa02..565c0695adc 100644 --- a/csharp/test/Ice/servantLocator/AllTests.cs +++ b/csharp/test/Ice/servantLocator/AllTests.cs @@ -102,7 +102,8 @@ public class AllTests : TestCommon.TestApp } catch(UnknownLocalException ex) { - test(ex.unknown.IndexOf("Ice::SocketException") >= 0); + test(ex.unknown.IndexOf("Ice::SocketException") >= 0 || + ex.unknown.IndexOf("Ice.SocketException") >= 0); } catch(System.Exception) { diff --git a/php/test/Ice/exceptions/Client.php b/php/test/Ice/exceptions/Client.php index cfc27d988ad..37042b9d5a2 100644 --- a/php/test/Ice/exceptions/Client.php +++ b/php/test/Ice/exceptions/Client.php @@ -432,6 +432,11 @@ $initData = $NS ? eval("return new Ice\\InitializationData;") : eval("return new $initData->properties = Ice_getProperties(); $initData->properties->setProperty("Ice.MessageSizeMax", "10"); $communicator = Ice_initialize($argv, $initData); + +// This property is set by the test suite, howerver we need to override it for this test. +// Unlike C++, we can not pass $argv into Ice::createProperties, so we just set it after. +$communicator->getProperties()->setProperty("Ice.Warn.Connections", "0"); + $thrower = allTests($communicator); $thrower->shutdown(); $communicator->destroy(); diff --git a/php/test/Ice/exceptions/run.py b/php/test/Ice/exceptions/run.py index 87476ada6d2..9c5846ff6b0 100755 --- a/php/test/Ice/exceptions/run.py +++ b/php/test/Ice/exceptions/run.py @@ -21,25 +21,25 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with compact (default) format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Warn.Connections=0") +TestUtil.clientServerTest() print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat --Ice.Warn.Connections=0", +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0 --Ice.Warn.Connections=0", +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") print("Running test with compact (default) format and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Warn.Connections=0") +TestUtil.clientServerTest(server="serveramd") print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.SlicedFormat --Ice.Warn.Connections=0", +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0 --Ice.Warn.Connections=0", +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/python/test/Ice/slicing/exceptions/ServerPrivateAMD.ice b/python/test/Ice/slicing/exceptions/ServerPrivateAMD.ice index 3b9d0a22a00..5493dd451ed 100644 --- a/python/test/Ice/slicing/exceptions/ServerPrivateAMD.ice +++ b/python/test/Ice/slicing/exceptions/ServerPrivateAMD.ice @@ -34,4 +34,19 @@ exception UnknownMostDerived2 extends UnknownIntermediate string umd2; }; +class SPreservedClass extends BaseClass +{ + string spc; +}; + +exception SPreserved1 extends KnownPreservedDerived +{ + BaseClass p1; +}; + +exception SPreserved2 extends SPreserved1 +{ + BaseClass p2; +}; + }; diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py index 27af43dca48..bd8e4bb41e1 100755 --- a/scripts/TestUtil.py +++ b/scripts/TestUtil.py @@ -512,8 +512,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" : @@ -591,13 +592,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(): @@ -697,25 +700,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: @@ -768,29 +782,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 @@ -1164,7 +1162,7 @@ def getCommandLine(exe, config, options = "", interpreterOptions = ""): 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 +"\" -- ") @@ -1498,6 +1496,11 @@ def clientServerTest(additionalServerOptions = "", additionalClientOptions = "", clientdir = getMirrorDir(getClientCrossTestDir(testdir), clientLang) else: clientdir = getMirrorDir(testdir, clientLang) + + client = getDefaultClientFile(clientLang) + clientDesc = os.path.basename(client) + clientCfg.lang = clientLang + if not os.path.exists(clientdir): print("** no matching test for %s" % clientLang) return @@ -1516,9 +1519,6 @@ def clientServerTest(additionalServerOptions = "", additionalClientOptions = "", if clientenv is None: clientenv = getTestEnv(clientLang, clientdir) - if lang == "php": - phpSetup() - clientExe = client serverExe = server @@ -1648,9 +1648,6 @@ def clientEchoTest(additionalServerOptions = "", additionalClientOptions = "", if clientenv is None: clientenv = getTestEnv(clientLang, clientdir) - if lang == "php": - phpSetup() - clientExe = client serverExe = server @@ -1701,9 +1698,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, @@ -1713,7 +1714,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) @@ -2138,8 +2140,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") @@ -2397,6 +2400,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) |