summaryrefslogtreecommitdiff
path: root/js/test/Common/run.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-11-10 12:20:12 +0100
committerJose <jose@zeroc.com>2014-11-10 12:20:12 +0100
commit8b1a9f2bb11ae7dccffd7a912da2119ca5cd74a7 (patch)
tree6756fa7ec44ddf48e94f458e3e8d9a508aec27a6 /js/test/Common/run.py
parentupdating ice.spec to rename some RPMs, fix JAR file names (diff)
downloadice-8b1a9f2bb11ae7dccffd7a912da2119ca5cd74a7.tar.bz2
ice-8b1a9f2bb11ae7dccffd7a912da2119ca5cd74a7.tar.xz
ice-8b1a9f2bb11ae7dccffd7a912da2119ca5cd74a7.zip
Fixed (ICE-5856) - IceJS browser test Ice/timeout fails on Chrome
Diffstat (limited to 'js/test/Common/run.py')
-rwxr-xr-xjs/test/Common/run.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/js/test/Common/run.py b/js/test/Common/run.py
index db0d32e2eb2..13e9fe76d77 100755
--- a/js/test/Common/run.py
+++ b/js/test/Common/run.py
@@ -32,6 +32,23 @@ import Ice, Expect
Ice.loadSlice("\"" + os.path.join(TestUtil.toplevel, "js", "test", "Common", "Controller.ice") + "\"")
import Test
+# The NodeJS interpreter is called "nodejs" on some platforms
+# (e.g., Ubuntu)
+#
+nodeCmd = "node"
+if "NODE" in os.environ:
+ nodeCmd = os.environ["NODE"]
+else:
+ for path in os.environ["PATH"].split(os.pathsep):
+ #
+ # Stop if we find "php" in the PATH first.
+ #
+ if os.path.exists(os.path.join(path, "node")):
+ break
+ elif os.path.exists(os.path.join(path, "nodejs")):
+ nodeCmd = "nodejs"
+ break
+
class ServerI(Test.Server):
def __init__(self, name, process):
self.name = name
@@ -123,7 +140,7 @@ class Reader(threading.Thread):
class Server(Ice.Application):
def run(self, args):
jsDir = os.path.join(TestUtil.toplevel, "js")
- httpServer = subprocess.Popen("node \"" + os.path.join(jsDir, "bin", "HttpServer.js") + "\"", shell = True,
+ httpServer = subprocess.Popen(nodeCmd + " \"" + os.path.join(jsDir, "bin", "HttpServer.js") + "\"", shell = True,
stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT,
bufsize = 0)
#