diff options
-rwxr-xr-x | cpp/allDemos.py | 28 | ||||
-rw-r--r-- | cpp/include/IceUtil/StringUtil.h | 5 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 73 | ||||
-rw-r--r-- | cpp/src/IceUtil/StringUtil.cpp | 15 | ||||
-rwxr-xr-x | cpp/src/Slice/Preprocessor.cpp | 9 | ||||
-rw-r--r-- | cppe/include/IceE/StringUtil.h | 5 | ||||
-rw-r--r-- | cppe/src/IceE/Properties.cpp | 72 | ||||
-rw-r--r-- | cppe/src/IceE/StringUtil.cpp | 16 | ||||
-rwxr-xr-x | cs/allDemos.py | 28 | ||||
-rw-r--r-- | cs/src/Ice/PropertiesI.cs | 67 | ||||
-rwxr-xr-x | java/allDemos.py | 27 | ||||
-rw-r--r-- | java/src/Ice/PropertiesI.java | 59 | ||||
-rw-r--r-- | javae/jdk/Ice/Properties.java | 56 | ||||
-rwxr-xr-x | javae/midp/Ice/Properties.java | 56 | ||||
-rwxr-xr-x | py/allDemos.py | 26 | ||||
-rwxr-xr-x | rb/allDemos.py | 26 | ||||
-rwxr-xr-x | vb/allDemos.py | 26 |
17 files changed, 381 insertions, 213 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 + diff --git a/cpp/include/IceUtil/StringUtil.h b/cpp/include/IceUtil/StringUtil.h index b7859ec6946..351739cc311 100644 --- a/cpp/include/IceUtil/StringUtil.h +++ b/cpp/include/IceUtil/StringUtil.h @@ -35,6 +35,11 @@ ICE_UTIL_API bool unescapeString(const std::string&, std::string::size_type, std ICE_UTIL_API bool splitString(const std::string&, const std::string&, std::vector<std::string>&); // +// Trim white space +// +ICE_UTIL_API std::string trim(const std::string&); + +// // If a single or double quotation mark is found at the start // position, then the position of the matching closing quote is // returned. If no quotation mark is found at the start position, then diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 94a8f0cf276..cc60f9bde79 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -406,49 +406,56 @@ Ice::PropertiesI::PropertiesI(StringSeq& args, const PropertiesPtr& defaults, co void Ice::PropertiesI::parseLine(const string& line, const StringConverterPtr& converter) { - const string delim = " \t\r\n"; string s = line; - string::size_type idx = s.find('#'); - if(idx != string::npos) - { - s.erase(idx); - } - - idx = s.find_last_not_of(delim); - if(idx != string::npos && idx + 1 < s.length()) - { - s.erase(idx + 1); - } - - string::size_type beg = s.find_first_not_of(delim); - if(beg == string::npos) + // + // Remove comments and unescape #'s + // + string::size_type idx = 0; + while((idx = s.find("#", idx)) != string::npos) { - return; + if(idx != 0 && s[idx - 1] == '\\') + { + s.erase(idx - 1, 1); + ++idx; + } + else + { + s.erase(idx); + break; + } } - - string::size_type end = s.find_first_of(delim + "=", beg); - if(end == string::npos) + + // + // Split key/value and unescape ='s + // + string::size_type split = string::npos; + idx = 0; + while((idx = s.find("=", idx)) != string::npos) { - return; + if(idx != 0 && s[idx - 1] == '\\') + { + s.erase(idx - 1, 1); + } + else if(split == string::npos) + { + split = idx; + } + ++idx; } - - string key = s.substr(beg, end - beg); - - end = s.find('=', end); - if(end == string::npos) + + if(split == 0 || split == string::npos) { + s = IceUtilInternal::trim(s); + if(s.length() != 0) + { + getProcessLogger()->warning("invalid config file entry: \"" + line + "\""); + } return; } - ++end; - string value; - beg = s.find_first_not_of(delim, end); - if(beg != string::npos) - { - end = s.length(); - value = s.substr(beg, end - beg); - } + string key = IceUtilInternal::trim(s.substr(0, split)); + string value = IceUtilInternal::trim(s.substr(split + 1, s.length() - split - 1)); if(converter) { diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp index 62bd9e1f44d..54e1a1d6253 100644 --- a/cpp/src/IceUtil/StringUtil.cpp +++ b/cpp/src/IceUtil/StringUtil.cpp @@ -364,6 +364,21 @@ IceUtilInternal::splitString(const string& str, const string& delim, vector<stri return true; } +// +// Trim white space (" \t\r\n") +// +string +IceUtilInternal::trim(const string& s) +{ + const string delim = " \t\r\n"; + if(s.length() != 0) + { + string::size_type beg = s.find_first_not_of(delim); + string::size_type end = s.find_last_not_of(delim); + return s.substr(beg, end - beg + 1); + } + return s; +} // // If a single or double quotation mark is found at the start position, diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 7b3acd99500..869dc5ca760 100755 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -284,14 +284,7 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin while((end = unprocessed.find(".ice", pos)) != string::npos) { end += 4; - string file = unprocessed.substr(pos, end - pos); - - // - // Strip white space from the file name. - // - size_t b = file.find_first_not_of(" \t"); - size_t e = file.find_last_not_of(" \t"); - file = file.substr(b, e - b + 1); + string file = IceUtilInternal::trim(unprocessed.substr(pos, end - pos)); // // Normalize paths if not relative path. diff --git a/cppe/include/IceE/StringUtil.h b/cppe/include/IceE/StringUtil.h index 0fb19848a55..06b6523d4f8 100644 --- a/cppe/include/IceE/StringUtil.h +++ b/cppe/include/IceE/StringUtil.h @@ -27,6 +27,11 @@ ICE_API std::string escapeString(const std::string&, const std::string&); ICE_API bool unescapeString(const std::string&, std::string::size_type, std::string::size_type, std::string&); // +// Trim white space +// +ICE_API std::string trim(const std::string&); + +// // If a single or double quotation mark is found at the start // position, then the position of the matching closing quote is // returned. If no quotation mark is found at the start position, then diff --git a/cppe/src/IceE/Properties.cpp b/cppe/src/IceE/Properties.cpp index fa7002fc246..515323ea477 100644 --- a/cppe/src/IceE/Properties.cpp +++ b/cppe/src/IceE/Properties.cpp @@ -291,50 +291,52 @@ Ice::Properties::parseLine(const string& line #endif ) { - const string delim = " \t\r\n"; string s = line; - - string::size_type idx = s.find('#'); - if(idx != string::npos) - { - s.erase(idx); - } - - idx = s.find_last_not_of(delim); - if(idx != string::npos && idx + 1 < s.length()) - { - s.erase(idx + 1); - } - - string::size_type beg = s.find_first_not_of(delim); - if(beg == string::npos) - { - return; - } - - string::size_type end = s.find_first_of(delim + "=", beg); - if(end == string::npos) + + // + // Remove comments and unescape #'s + // + string::size_type idx = 0; + while((idx = s.find("#", idx)) != string::npos) { - return; + if(idx != 0 && s[idx - 1] == '\\') + { + s.erase(idx - 1, 1); + ++idx; + } + else + { + s.erase(idx); + break; + } } - - string key = s.substr(beg, end - beg); - - end = s.find('=', end); - if(end == string::npos) + + // + // Split key/value and unescape ='s + // + string::size_type split = string::npos; + idx = 0; + while((idx = s.find("=", idx)) != string::npos) { - return; + if(idx != 0 && s[idx - 1] == '\\') + { + s.erase(idx - 1, 1); + } + else if(split == string::npos) + { + split = idx; + } + ++idx; } - ++end; - string value; - beg = s.find_first_not_of(delim, end); - if(beg != string::npos) + if(split == 0 || split == string::npos) { - end = s.length(); - value = s.substr(beg, end - beg); + return; } + string key = IceUtil::trim(s.substr(0, split)); + string value = IceUtil::trim(s.substr(split + 1, s.length() - split - 1)); + #ifdef ICEE_HAS_WSTRING if(converter) { diff --git a/cppe/src/IceE/StringUtil.cpp b/cppe/src/IceE/StringUtil.cpp index 8ea102ad407..1a797592071 100644 --- a/cppe/src/IceE/StringUtil.cpp +++ b/cppe/src/IceE/StringUtil.cpp @@ -309,6 +309,22 @@ IceUtil::unescapeString(const string& s, string::size_type start, string::size_t } // +// Trim white space (" \t\r\n") +// +string +IceUtil::trim(const string& s) +{ + const string delim = " \t\r\n"; + if(s.length() != 0) + { + string::size_type beg = s.find_first_not_of(delim); + string::size_type end = s.find_last_not_of(delim); + return s.substr(beg, end - beg + 1); + } + return s; +} + +// // If a single or double quotation mark is found at the start position, // then the position of the matching closing quote is returned. If no // quotation mark is found at the start position, then 0 is returned. diff --git a/cs/allDemos.py b/cs/allDemos.py index 1ce097ed672..b8f0e4e5743 100755 --- a/cs/allDemos.py +++ b/cs/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,14 @@ 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. @@ -65,7 +76,7 @@ demos = [ "Ice/invoke", "Ice/latency", "Ice/minimal", - #"Ice/multicast", + "Ice/multicast", "Ice/nested", "Ice/session", "Ice/throughput", @@ -91,11 +102,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() @@ -115,6 +128,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"): @@ -144,3 +159,8 @@ if loop: num += 1 else: runDemos(arg, demos) + +if len(testErrors) > 0: + print "The following errors occurred:" + for x in testErrors: + print x diff --git a/cs/src/Ice/PropertiesI.cs b/cs/src/Ice/PropertiesI.cs index eb6524fe6ae..f837be112eb 100644 --- a/cs/src/Ice/PropertiesI.cs +++ b/cs/src/Ice/PropertiesI.cs @@ -421,48 +421,51 @@ namespace Ice private void parseLine(string line) { string s = line; - - int hash = s.IndexOf('#'); - if(hash == 0) - { - return; // ignore comment lines - } - else if(hash != - 1) - { - s = s.Substring(0, (hash) - (0)); - } - - s = s.Trim(); - - char[] arr = s.ToCharArray(); - int end = -1; - for(int i = 0; i < arr.Length; i++) + + // + // Remove comments and unescape #'s + // + int idx = 0; + while((idx = s.IndexOf("#", idx)) != -1) { - if(arr[i] == ' ' || arr[i] == '\t' || arr[i] == '\r' || arr[i] == '\n' || arr[i] == '=') + if(idx == 0 || s[idx - 1] != '\\') { - end = i; + s = s.Substring(0, idx); break; } + ++idx; } - if(end == -1) + s = s.Replace("\\#", "#"); + + // + // Split key/value and unescape ='s + // + int split = -1; + idx = 0; + while((idx = s.IndexOf("=", idx)) != -1) { - return; + if(idx == 0 || s[idx - 1] != '\\') + { + split = idx; + break; + } + ++idx; } - - string key = s.Substring(0, end); - - end = s.IndexOf('=', end); - if(end == -1) + if(split == 0 || split == -1) { + s = s.Trim(); + if(s.Length != 0) + { + Ice.Util.getProcessLogger().warning("invalid config file entry: \"" + line + "\""); + } return; } - ++end; - - string val = ""; - if(end < s.Length) - { - val = s.Substring(end).Trim(); - } + + string key = s.Substring(0, split).Trim(); + string val = s.Substring(split + 1, s.Length - split - 1).Trim(); + + key = key.Replace("\\=", "="); + val = val.Replace("\\=", "="); setProperty(key, val); } diff --git a/java/allDemos.py b/java/allDemos.py index d511afbc961..d70d265f19e 100755 --- a/java/allDemos.py +++ b/java/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. @@ -102,11 +114,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() @@ -126,6 +140,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"): @@ -155,3 +171,8 @@ if loop: num += 1 else: runDemos(arg, demos) + +if len(testErrors) > 0: + print "The following errors occurred:" + for x in testErrors: + print x diff --git a/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java index d78651ae2d7..cc266f79004 100644 --- a/java/src/Ice/PropertiesI.java +++ b/java/src/Ice/PropertiesI.java @@ -431,47 +431,50 @@ public final class PropertiesI implements Properties { String s = line; - int hash = s.indexOf('#'); - if(hash == 0) - { - return; // ignore comment lines - } - else if(hash != -1) + // + // Remove comments and unescape #'s + // + int idx = 0; + while((idx = s.indexOf("#", idx)) != -1) { - s = s.substring(0, hash); + if(idx == 0 || s.charAt(idx - 1) != '\\') + { + s = s.substring(0, idx); + break; + } + ++idx; } + s = s.replace("\\#", "#"); - s = s.trim(); - - final char[] arr = s.toCharArray(); - int end = -1; - for(int i = 0; i < arr.length; i++) + // + // Split key/value and unescape ='s + // + int split = -1; + idx = 0; + while((idx = s.indexOf("=", idx)) != -1) { - if(arr[i] == ' ' || arr[i] == '\t' || arr[i] == '\r' || arr[i] == '\n' || arr[i] == '=') + if(idx == 0 || s.charAt(idx - 1) != '\\') { - end = i; + split = idx; break; } + ++idx; } - if(end == -1) + if(split == 0 || split == -1) { + s = s.trim(); + if(s.length() != 0) + { + Ice.Util.getProcessLogger().warning("invalid config file entry: \"" + line + "\""); + } return; } - String key = s.substring(0, end); + String key = s.substring(0, split).trim(); + String value = s.substring(split + 1, s.length()).trim(); - end = s.indexOf('=', end); - if(end == -1) - { - return; - } - ++end; - - String value = ""; - if(end < s.length()) - { - value = s.substring(end).trim(); - } + key = key.replace("\\=", "="); + value = value.replace("\\=", "="); setProperty(key, value); } diff --git a/javae/jdk/Ice/Properties.java b/javae/jdk/Ice/Properties.java index 31a73f64263..a0afad8db15 100644 --- a/javae/jdk/Ice/Properties.java +++ b/javae/jdk/Ice/Properties.java @@ -242,47 +242,45 @@ public final class Properties { String s = line; - int hash = s.indexOf('#'); - if(hash == 0) + // + // Remove comments and unescape #'s + // + int idx = 0; + while((idx = s.indexOf("#", idx)) != -1) { - return; // ignore comment lines - } - else if(hash != -1) - { - s = s.substring(0, hash); + if(idx == 0 || s.charAt(idx - 1) != '\\') + { + s = s.substring(0, idx); + break; + } + ++idx; } - - s = s.trim(); - - final char[] arr = s.toCharArray(); - int end = -1; - for(int i = 0; i < arr.length; i++) + s = s.replace("\\#", "#"); + + // + // Split key/value and unescape ='s + // + int split = -1; + idx = 0; + while((idx = s.indexOf("=", idx)) != -1) { - if(arr[i] == ' ' || arr[i] == '\t' || arr[i] == '\r' || arr[i] == '\n' || arr[i] == '=') + if(idx == 0 || s.charAt(idx - 1) != '\\') { - end = i; + split = idx; break; } + ++idx; } - if(end == -1) + if(split == 0 || split == -1) { return; } - String key = s.substring(0, end); + String key = s.substring(0, split).trim(); + String value = s.substring(split + 1, s.length()).trim(); - end = s.indexOf('=', end); - if(end == -1) - { - return; - } - ++end; - - String value = ""; - if(end < s.length()) - { - value = s.substring(end).trim(); - } + key = key.replace("\\=", "="); + value = value.replace("\\=", "="); setProperty(key, value); } diff --git a/javae/midp/Ice/Properties.java b/javae/midp/Ice/Properties.java index a11b70f6b50..8c0967950f0 100755 --- a/javae/midp/Ice/Properties.java +++ b/javae/midp/Ice/Properties.java @@ -242,47 +242,45 @@ public final class Properties { String s = line; - int hash = s.indexOf('#'); - if(hash == 0) + // + // Remove comments and unescape #'s + // + int idx = 0; + while((idx = s.indexOf("#", idx)) != -1) { - return; // ignore comment lines - } - else if(hash != -1) - { - s = s.substring(0, hash); + if(idx == 0 || s.charAt(idx - 1) != '\\') + { + s = s.substring(0, idx); + break; + } + ++idx; } - - s = s.trim(); - - final char[] arr = s.toCharArray(); - int end = -1; - for(int i = 0; i < arr.length; i++) + s = s.replace("\\#", "#"); + + // + // Split key/value and unescape ='s + // + int split = -1; + idx = 0; + while((idx = s.indexOf("=", idx)) != -1) { - if(arr[i] == ' ' || arr[i] == '\t' || arr[i] == '\r' || arr[i] == '\n' || arr[i] == '=') + if(idx == 0 || s.charAt(idx - 1) != '\\') { - end = i; + split = idx; break; } + ++idx; } - if(end == -1) + if(split == 0 || split == -1) { return; } - String key = s.substring(0, end); + String key = s.substring(0, split).trim(); + String value = s.substring(split + 1, s.length()).trim(); - end = s.indexOf('=', end); - if(end == -1) - { - return; - } - ++end; - - String value = ""; - if(end < s.length()) - { - value = s.substring(end).trim(); - } + key = key.replace("\\=", "="); + value = value.replace("\\=", "="); setProperty(key, value); } diff --git a/py/allDemos.py b/py/allDemos.py index 5d96eae07b5..e95bf221e71 100755 --- a/py/allDemos.py +++ b/py/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,14 @@ 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. @@ -86,11 +97,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() @@ -110,6 +123,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"): @@ -139,3 +154,8 @@ if loop: num += 1 else: runDemos(arg, demos) + +if len(testErrors) > 0: + print "The following errors occurred:" + for x in testErrors: + print x diff --git a/rb/allDemos.py b/rb/allDemos.py index 692310fdf32..4153a5cf20f 100755 --- a/rb/allDemos.py +++ b/rb/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,14 @@ 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. @@ -80,11 +91,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() @@ -104,6 +117,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"): @@ -133,3 +148,8 @@ if loop: num += 1 else: runDemos(arg, demos) + +if len(testErrors) > 0: + print "The following errors occurred:" + for x in testErrors: + print x diff --git a/vb/allDemos.py b/vb/allDemos.py index 8782b4da4ba..4b35171b312 100755 --- a/vb/allDemos.py +++ b/vb/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,14 @@ 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. @@ -89,11 +100,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() @@ -113,6 +126,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"): @@ -142,3 +157,8 @@ if loop: num += 1 else: runDemos(arg, demos) + +if len(testErrors) > 0: + print "The following errors occurred:" + for x in testErrors: + print x |