summaryrefslogtreecommitdiff
path: root/python/test/Slice/import/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Slice/import/run.py')
-rwxr-xr-xpython/test/Slice/import/run.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/python/test/Slice/import/run.py b/python/test/Slice/import/run.py
index 2054bdd7692..02a58b177d9 100755
--- a/python/test/Slice/import/run.py
+++ b/python/test/Slice/import/run.py
@@ -8,7 +8,7 @@
#
# **********************************************************************
-import os, sys
+import os, sys, shutil, subprocess
path = [ ".", "..", "../..", "../../..", "../../../.." ]
head = os.path.dirname(sys.argv[0])
@@ -20,6 +20,30 @@ if len(path) == 0:
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil
+testdir = os.path.dirname(os.path.abspath(__file__))
+
+if os.path.exists(os.path.join(testdir, "Test1_ice.py")):
+ os.remove(os.path.join(testdir, "Test1_ice.py"))
+if os.path.exists(os.path.join(testdir, "Test2_ice.py")):
+ os.remove(os.path.join(testdir, "Test2_ice.py"))
+if os.path.exists(os.path.join(testdir, "Test")):
+ shutil.rmtree(os.path.join(testdir, "Test"))
+
+if os.environ.get("USE_BIN_DIST", "no") == "yes":
+ if TestUtil.isDarwin():
+ slice2py = "/usr/local/bin/slice2py"
+ elif TestUtil.isWin32():
+ pythonHome = os.path.dirname(sys.executable)
+ slice2py = os.path.join(pythonHome, "Scripts", "slice2py.exe")
+ else:
+ import slice2py
+ slice2py = os.path.normpath(os.path.join(slice2py.__file__, '..', '..', '..', '..', 'bin', 'slice2py'))
+else:
+ slice2py = os.path.join(path[0], "python", "config", "s2py.py")
+
+subprocess.call([sys.executable, slice2py, "Test1.ice"])
+subprocess.call([sys.executable, slice2py, "Test2.ice"])
+
sys.stdout.write("starting client... ")
sys.stdout.flush()
clientProc = TestUtil.startClient("Client.py", "--Ice.Default.Host=127.0.0.1", startReader = False)