61 |
|
|
62 |
opts, args = getopt.getopt(sys.argv[1:], 'v', ['verbose']) |
opts, args = getopt.getopt(sys.argv[1:], 'v', ['verbose']) |
63 |
for optchar, value in opts: |
for optchar, value in opts: |
64 |
if optchar in ("-v", "--stub-auto-login"): |
if optchar in ("-v", "--verbose"): |
65 |
verbosity = 2 |
verbosity = 2 |
66 |
else: |
else: |
67 |
print>>sys.stderr, "Unknown option", optchar |
print>>sys.stderr, "Unknown option", optchar |
71 |
# FIXME: It should be possible to run runtests.py even when not in |
# FIXME: It should be possible to run runtests.py even when not in |
72 |
# the test directory |
# the test directory |
73 |
files = os.listdir(os.curdir) |
files = os.listdir(os.curdir) |
74 |
names = [] |
if args: |
75 |
for file in files: |
names = args |
76 |
if file[:4] == "test" and file[-3:] == ".py": |
else: |
77 |
names.append(file[:-3]) |
names = [] |
78 |
|
for file in files: |
79 |
|
if file[:4] == "test" and file[-3:] == ".py": |
80 |
|
names.append(file[:-3]) |
81 |
|
|
82 |
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
83 |
runner = unittest.TextTestRunner(verbosity = verbosity) |
runner = support.ThubanTestRunner(verbosity = verbosity) |
84 |
result = runner.run(suite) |
result = support.execute_as_testsuite(runner.run, suite) |
|
|
|
|
support.print_additional_summary() |
|
85 |
|
|
86 |
sys.exit(not result.wasSuccessful()) |
sys.exit(not result.wasSuccessful()) |
87 |
|
|