summaryrefslogtreecommitdiff
path: root/rb/demo/Ice/throughput/expect.py
diff options
context:
space:
mode:
Diffstat (limited to 'rb/demo/Ice/throughput/expect.py')
-rwxr-xr-xrb/demo/Ice/throughput/expect.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/rb/demo/Ice/throughput/expect.py b/rb/demo/Ice/throughput/expect.py
new file mode 100755
index 00000000000..26bfa905f32
--- /dev/null
+++ b/rb/demo/Ice/throughput/expect.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import pexpect, sys, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+if os.path.exists("../../../../cpp"):
+ iceHome = "../../../../cpp"
+elif os.path.exists("../../../demo"):
+ iceHome = "../../../"
+else:
+ print "Cannot find C++ demos"
+ sys.exit(1)
+
+import demoscript.Util
+import demoscript.Ice.throughput
+
+cwd = os.getcwd()
+os.chdir('%s/demo/Ice/throughput' % (iceHome))
+server = demoscript.Util.spawn('./server --Ice.PrintAdapterReady')
+server.expect('.* ready')
+os.chdir(cwd)
+
+client = demoscript.Util.spawn('ruby Client.rb')
+
+demoscript.Ice.throughput.run(client, server)