summaryrefslogtreecommitdiff
path: root/cpp/config/TestUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/config/TestUtil.py')
-rw-r--r--cpp/config/TestUtil.py102
1 files changed, 96 insertions, 6 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py
index 0c1b16d3c44..3adc3062b12 100644
--- a/cpp/config/TestUtil.py
+++ b/cpp/config/TestUtil.py
@@ -88,6 +88,96 @@ def isHpUx():
else:
return 0
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003
+# ZeroC, Inc.
+# Billerica, MA, USA
+#
+# All Rights Reserved.
+#
+# Ice is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License version 2 as published by
+# the Free Software Foundation.
+#
+# **********************************************************************
+
+#
+# Set protocol to "ssl" in case you want to run the tests with the SSL
+# protocol. Otherwise TCP is used.
+#
+
+#protocol = ""
+protocol = "ssl"
+
+#
+# Set compressed to 1 in case you want to run the tests with
+# protocol compression.
+#
+
+#compress = 0
+compress = 1
+
+#
+# Set the host to the host name the test servers are running on. If
+# not set, Ice will try to find out the IP address for the
+# hostname. If you DNS isn't set up propertly, you should therefore
+# use "localhost".
+#
+
+#host = "someotherhost"
+host = "localhost"
+
+#
+# Don't change anything below this line!
+#
+
+import sys, os, re
+
+def getIceVersion():
+
+ config = open(os.path.join(toplevel, "include", "IceUtil", "Config.h"), "r")
+ return re.search("ICE_STRING_VERSION \"([0-9\.]*)\"", config.read()).group(1)
+
+def getIceSoVersion():
+
+ config = open(os.path.join(toplevel, "include", "IceUtil", "Config.h"), "r")
+ intVersion = int(re.search("ICE_INT_VERSION ([0-9]*)", config.read()).group(1))
+ majorVersion = intVersion / 10000
+ minorVersion = intVersion / 100 - 100 * majorVersion
+ return '%d' % (majorVersion * 10 + minorVersion)
+
+def isCygwin():
+
+ # The substring on sys.platform is required because some cygwin
+ # versions return variations like "cygwin_nt-4.01".
+ if sys.platform[:6] == "cygwin":
+ return 1
+ else:
+ return 0
+
+def isWin32():
+
+ if sys.platform == "win32" or isCygwin():
+ return 1
+ else:
+ return 0
+
+def isSolaris():
+
+ if sys.platform == "sunos5":
+ return 1
+ else:
+ return 0
+
+def isDarwin():
+
+ if sys.platform == "darwin":
+ return 1
+ else:
+ return 0
+
serverPids = []
def killServers():
@@ -168,13 +258,13 @@ if isWin32():
os.environ["PATH"] = os.path.join(toplevel, "bin") + ":" + os.getenv("PATH", "")
else:
os.environ["PATH"] = os.path.join(toplevel, "bin") + ";" + os.getenv("PATH", "")
+elif isHpUx():
+ os.environ["SHLIB_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("SHLIB_PATH", "")
+elif isDarwin():
+ os.environ["DYLD_LIBRARY_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("DYLD_LIBRRARY_PATH", "")
else:
- if isHpUx():
- os.environ["SHLIB_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("SHLIB_PATH", "")
-# os.environ["LD_LIBRARY_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("LD_LIBRARY_PATH, "")
- else:
- os.environ["LD_LIBRARY_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("LD_LIBRARY_PATH", "")
- os.environ["LD_LIBRARY_PATH_64"] = os.path.join(toplevel, "lib") + ":" + os.getenv("LD_LIBRARY_PATH_64", "")
+ os.environ["LD_LIBRARY_PATH"] = os.path.join(toplevel, "lib") + ":" + os.getenv("LD_LIBRARY_PATH", "")
+ os.environ["LD_LIBRARY_PATH_64"] = os.path.join(toplevel, "lib") + ":" + os.getenv("LD_LIBRARY_PATH_64", "")
if protocol == "ssl":
plugin = " --Ice.Plugin.IceSSL=IceSSL:create"