diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-07-20 19:07:54 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-07-20 19:07:54 +0000 |
commit | 3bae8a775ca9d4f3caec63030f7ab49db0c2f50c (patch) | |
tree | 14dc7634e4a03b19f7a590608633f11838d99d7d /php/allTests.py | |
parent | minor edits (diff) | |
download | ice-3bae8a775ca9d4f3caec63030f7ab49db0c2f50c.tar.bz2 ice-3bae8a775ca9d4f3caec63030f7ab49db0c2f50c.tar.xz ice-3bae8a775ca9d4f3caec63030f7ab49db0c2f50c.zip |
AIX compatibility
Diffstat (limited to 'php/allTests.py')
-rwxr-xr-x | php/allTests.py | 72 |
1 files changed, 46 insertions, 26 deletions
diff --git a/php/allTests.py b/php/allTests.py index d9680af85f8..160ed8034d9 100755 --- a/php/allTests.py +++ b/php/allTests.py @@ -9,6 +9,7 @@ # ********************************************************************** import os, sys +import getopt for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.normpath(toplevel) @@ -20,6 +21,30 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil +def runTests(tests, num = 0): + + # + # Run each of the tests. + # + for i in tests: + + i = os.path.normpath(i) + dir = os.path.join(toplevel, "test", i) + + print + if(num > 0): + print "[" + str(num) + "]", + print "*** running tests in " + dir, + print + + status = os.system(os.path.join(dir, "run.py")) + + if status and not (sys.platform.startswith("aix") and status == 256): + if(num > 0): + print "[" + str(num) + "]", + print "test in " + dir + " failed with exit status", status, + sys.exit(status) + # # List of all basic tests. # @@ -33,32 +58,27 @@ tests = [ \ "Ice/slicing/objects", \ ] -# -# The user can supply a subset of tests on the command line. -# -if sys.argv[1:]: - print "limiting tests" - newtests = [] - for i in tests: - if i in sys.argv[1:]: - newtests.append(i) - tests = newtests +def usage(): + print "usage: " + sys.argv[0] + " [-l]" + sys.exit(2) -# -# Run each of the tests. -# -for i in tests: - - i = os.path.normpath(i) - dir = os.path.join(toplevel, "test", i) +try: + opts, args = getopt.getopt(sys.argv[1:], "l") +except getopt.GetoptError: + usage() - print - print "*** running tests in " + dir + ":" - print +if(args): + usage() - try: - execfile(os.path.join(dir, "run.py")) - except SystemExit, (status,): - if status: - print "test failed with exit status", status - sys.exit(status) +loop = 0 +for o, a in opts: + if o == "-l": + loop = 1 + +if loop: + num = 1 + while 1: + runTests(tests, num) + num += 1 +else: + runTests(tests) |