summaryrefslogtreecommitdiff
path: root/cpp/allDemos.py
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/allDemos.py')
-rwxr-xr-xcpp/allDemos.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/cpp/allDemos.py b/cpp/allDemos.py
index 98936c9d3cc..66cd79d559c 100755
--- a/cpp/allDemos.py
+++ b/cpp/allDemos.py
@@ -10,6 +10,9 @@
import os, sys, getopt, re
+keepGoing = False
+testErrors = []
+
def isCygwin():
# The substring on sys.platform is required because some cygwin
# versions return variations like "cygwin_nt-4.01".
@@ -20,6 +23,8 @@ if sys.platform == "win32":
sys.exit(1)
def runDemos(args, demos, num = 0):
+ global testErrors
+ global keepGoing
rootPath = "demo"
if not os.path.exists(rootPath):
@@ -51,8 +56,15 @@ def runDemos(args, demos, num = 0):
if status:
if(num > 0):
print "[" + str(num) + "]",
- print "test in " + dir + " failed with exit status", status,
- sys.exit(status)
+ message = "demo in " + dir + " failed with exit status", status,
+ print message
+ if keepGoing == False:
+ print "exiting"
+ sys.exit(status)
+ else:
+ print " ** Error logged and will be displayed again when suite is completed **"
+ testErrors.append(message)
+
#
# List of all basic demos.
@@ -112,11 +124,13 @@ def usage():
print " --trace Run the demos with tracing enabled."
print " --host=host Set --Ice.Default.Host=<host>."
print " --mode=debug|release Run the demos with debug or release mode builds (win32 only)."
+ print " --continue Keep running when a demo fails."
sys.exit(2)
try:
opts, args = getopt.getopt(sys.argv[1:], "lr:R:", [
- "filter=", "rfilter=", "start-after=", "start=", "loop", "fast", "trace", "debug", "host=", "mode="])
+ "filter=", "rfilter=", "start-after=", "start=", "loop", "fast", "trace", "debug", "host=", "mode=",
+ "continue"])
except getopt.GetoptError:
usage()
@@ -136,6 +150,8 @@ arg = ""
for o, a in opts:
if o in ("-l", "--loop"):
loop = True
+ elif o in ("-c", "--continue"):
+ keepGoing = True
elif o in ("-r", "-R", "--filter", '--rfilter'):
regexp = re.compile(a)
if o in ("--rfilter", "-R"):
@@ -165,3 +181,9 @@ if loop:
num += 1
else:
runDemos(arg, demos)
+
+if len(testErrors) > 0:
+ print "The following errors occurred:"
+ for x in testErrors:
+ print x
+