summaryrefslogtreecommitdiff
path: root/scripts/TestUtil.py
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2016-09-01 09:30:59 -0400
committerJoe George <joe@zeroc.com>2016-09-01 09:30:59 -0400
commit4bf297bf9158e3878cc346490233c37dbeea1a5c (patch)
tree8e3cc735c923538808dfc809bf391f8e2a15d61f /scripts/TestUtil.py
parentICE-7307 - cross failure in Ice/objects with java-compat (diff)
downloadice-4bf297bf9158e3878cc346490233c37dbeea1a5c.tar.bz2
ice-4bf297bf9158e3878cc346490233c37dbeea1a5c.tar.xz
ice-4bf297bf9158e3878cc346490233c37dbeea1a5c.zip
Fix java-compat cross tests not working
Diffstat (limited to 'scripts/TestUtil.py')
-rwxr-xr-xscripts/TestUtil.py33
1 files changed, 21 insertions, 12 deletions
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index 81c650b0f80..c74851ebc37 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -1273,9 +1273,14 @@ def directoryToPackage():
"""Determine the package name from the directory."""
base = os.getcwd()
after = []
- before = base
lang = getDefaultMapping()
- lang = 'java' if lang == 'java-compat' else lang
+
+ if "java" in lang:
+ # Remove Java's extra directory structure from the path while we search it
+ base = base.replace(os.path.join("src", "main", "java", "test"), '')
+
+ before = base
+
while len(before) > 0:
current = os.path.basename(before)
before = os.path.dirname(before)
@@ -1459,27 +1464,26 @@ def getMirrorDir(base, mapping):
"""Get the mirror directory for the current test in the given mapping."""
lang = getDefaultMapping()
after = []
+
if lang == "js":
base = base.replace("/es5", "")
+ elif "java" in lang:
+ # Remove Java's extra directory structure from the path while we search it
+ base = base.replace(os.path.join("src", "main", "java", "test"), '')
+
before = base
while len(before) > 0:
current = os.path.basename(before)
before = os.path.dirname(before)
if current == lang:
- # Deal with Java's different directory structure
- if lang == "java" or lang == "java-compat":
- while len(before) > 0:
- current = os.path.basename(before)
- before = os.path.dirname(before)
- if current == lang:
- break
break
after.insert(0, current)
else:
raise RuntimeError("cannot find language dir")
+
dir = os.path.join(before, mapping)
# Deal with Java's different directory structure
- if mapping == "java" or mapping == "java-compat":
+ if "java" in mapping:
dir = os.path.join(dir, "test", "src", "main", "java")
return os.path.join(dir, *after)
@@ -1599,7 +1603,6 @@ def clientServerTest(cfgName = None, additionalServerOptions = "", additionalCli
if appverifier:
setAppVerifierSettings([clientExe, serverExe])
-
if not controller:
sys.stdout.write("starting " + serverDesc + "... ")
sys.stdout.flush()
@@ -2030,7 +2033,13 @@ def getTestEnv(lang, testdir):
def getTestName():
lang = getDefaultMapping()
- here = os.getcwd().split(os.sep)
+ base = os.getcwd()
+
+ if "java" in lang:
+ # Remove Java's extra directory structure from the path while we search it
+ base = base.replace(os.path.join("src", "main", "java", "test"), '')
+
+ here = base.split(os.sep)
here.reverse()
for i in range(0, len(here)):
if here[i] == lang: