From 43e414208f1bffee724b0bd2af7a3949979eefaf Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 5 Feb 2009 19:57:32 +0100 Subject: Add Ice/nrvo demo to allDemos --- cpp/allDemos.py | 1 + 1 file changed, 1 insertion(+) (limited to 'cpp/allDemos.py') diff --git a/cpp/allDemos.py b/cpp/allDemos.py index cf7015fe9be..18a7b325c78 100755 --- a/cpp/allDemos.py +++ b/cpp/allDemos.py @@ -38,6 +38,7 @@ demos = [ "Ice/session", "Ice/throughput", "Ice/value", + "Ice/nrvo", "IceBox/hello", "IceStorm/clock", "IceStorm/counter", -- cgit v1.2.3 From c029d3b7363807873008c868b2207fce20f52a2e Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Fri, 6 Mar 2009 11:26:42 -0330 Subject: Added expect scripts for protobuf demos --- cpp/allDemos.py | 6 +++++- cpp/demo/Ice/protobuf/expect.py | 30 ++++++++++++++++++++++++++++++ demoscript/Ice/protobuf.py | 30 ++++++++++++++++++++++++++++++ demoscript/Util.py | 7 +++++-- java/allDemos.py | 6 +++++- java/demo/Ice/protobuf/expect.py | 30 ++++++++++++++++++++++++++++++ py/allDemos.py | 7 ++++++- py/demo/Ice/protobuf/expect.py | 30 ++++++++++++++++++++++++++++++ 8 files changed, 141 insertions(+), 5 deletions(-) create mode 100755 cpp/demo/Ice/protobuf/expect.py create mode 100644 demoscript/Ice/protobuf.py create mode 100755 java/demo/Ice/protobuf/expect.py create mode 100755 py/demo/Ice/protobuf/expect.py (limited to 'cpp/allDemos.py') diff --git a/cpp/allDemos.py b/cpp/allDemos.py index 18a7b325c78..0d6fb5990dd 100755 --- a/cpp/allDemos.py +++ b/cpp/allDemos.py @@ -65,5 +65,9 @@ demos = [ "book/lifecycle", ] +protoDemos = [ + "Ice/protobuf" +] + if __name__ == "__main__": - Util.run(demos) + Util.run(demos, protoDemos) diff --git a/cpp/demo/Ice/protobuf/expect.py b/cpp/demo/Ice/protobuf/expect.py new file mode 100755 index 00000000000..eab2c166f54 --- /dev/null +++ b/cpp/demo/Ice/protobuf/expect.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2009 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 sys, os + +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] +if len(path) == 0: + raise "can't find toplevel directory!" +sys.path.append(path[0]) + +from demoscript import * +from demoscript.Ice import protobuf + +server = Util.spawn('./server --Ice.PrintAdapterReady --Ice.Warn.Connections=0') +server.expect('.* ready') +client = Util.spawn('./client --Ice.Warn.Connections=0') +client.expect('.*==>') + +protobuf.run(client, server) diff --git a/demoscript/Ice/protobuf.py b/demoscript/Ice/protobuf.py new file mode 100644 index 00000000000..23ad94fc48d --- /dev/null +++ b/demoscript/Ice/protobuf.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2009 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 sys +from demoscript import * +from scripts import Expect + +def run(client, server): + print "testing...", + sys.stdout.flush() + client.sendline('t') + server.expect('Hello World from id: 1') + server.expect('name: "Fred Jones"') + server.expect('email: "fred@jones.com"') + print "ok" + + print "shutting down...", + client.sendline('s') + server.waitTestSuccess() + + client.sendline('x') + client.waitTestSuccess() + print "ok" diff --git a/demoscript/Util.py b/demoscript/Util.py index c6151083974..0becb3d58dd 100644 --- a/demoscript/Util.py +++ b/demoscript/Util.py @@ -310,13 +310,14 @@ def runDemos(start, args, demos, num = 0, script = False, root = False): demoErrors.append(message) -def run(demos, root = False): +def run(demos, protobufDemos = [], root = False): def usage(): print """usage: %s --start=index Start running the demos at the given demo." --loop Run the demos in a loop." --filter= Run all the demos that match the given regex." --rfilter= Run all the demos that do not match the given regex." + --protobuf Run the protobuf demos." --debug Display debugging information on each demos." --trace= Run the demos with tracing enabled." --host=host Set --Ice.Default.Host=." @@ -336,7 +337,7 @@ def run(demos, root = False): try: opts, args = getopt.getopt(sys.argv[1:], "lr:R:", [ "filter=", "rfilter=", "start=", "loop", "fast", "trace=", "debug", "host=", "mode=", - "continue", "ice-home=", "x64", "java2", "preferIPv4", "env", "noenv", "script"]) + "continue", "ice-home=", "x64", "java2", "preferIPv4", "env", "noenv", "script", "protobuf"]) except getopt.GetoptError: usage() @@ -380,6 +381,8 @@ def run(demos, root = False): start = int(a) elif o in '--script': script = True + elif o in '--protobuf': + demos = demos + protobufDemos for demoFilter, removeFilter in filters: if removeFilter: diff --git a/java/allDemos.py b/java/allDemos.py index 6110b47efeb..06030ff7a90 100755 --- a/java/allDemos.py +++ b/java/allDemos.py @@ -53,5 +53,9 @@ demos = [ "book/lifecycle", ] +protoDemos = [ + "Ice/protobuf" +] + if __name__ == "__main__": - Util.run(demos) + Util.run(demos, protoDemos) diff --git a/java/demo/Ice/protobuf/expect.py b/java/demo/Ice/protobuf/expect.py new file mode 100755 index 00000000000..60dabda57bf --- /dev/null +++ b/java/demo/Ice/protobuf/expect.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2009 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 sys, os + +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] +if len(path) == 0: + raise "can't find toplevel directory!" +sys.path.append(path[0]) + +from demoscript import * +from demoscript.Ice import protobuf + +server = Util.spawn('java Server --Ice.PrintAdapterReady --Ice.Warn.Connections=0') +server.expect('.* ready') +client = Util.spawn('java Client --Ice.Warn.Connections=0') +client.expect('.*==>') + +protobuf.run(client, server) diff --git a/py/allDemos.py b/py/allDemos.py index 5829ada88a7..230ffb8286e 100755 --- a/py/allDemos.py +++ b/py/allDemos.py @@ -41,5 +41,10 @@ demos = [ "book/simple_filesystem" ] +protoDemos = [ + "Ice/protobuf" +] + + if __name__ == "__main__": - Util.run(demos) + Util.run(demos, protoDemos) diff --git a/py/demo/Ice/protobuf/expect.py b/py/demo/Ice/protobuf/expect.py new file mode 100755 index 00000000000..6db9aa22652 --- /dev/null +++ b/py/demo/Ice/protobuf/expect.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2009 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 sys, os + +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] +if len(path) == 0: + raise "can't find toplevel directory!" +sys.path.append(path[0]) + +from demoscript import * +from demoscript.Ice import protobuf + +server = Util.spawn('Server.py --Ice.PrintAdapterReady --Ice.Warn.Connections=0') +server.expect('.* ready') +client = Util.spawn('Client.py --Ice.Warn.Connections=0') +client.expect('.*==>') + +protobuf.run(client, server) -- cgit v1.2.3