Commit c1fee57c authored by Chris Withers's avatar Chris Withers

Added option to output to a file to workaround M$ OSes' inability to pipe the...

Added option to output to a file to workaround M$ OSes' inability to pipe the standard error stream.
parent e9166cf2
...@@ -90,7 +90,7 @@ class TestRunner: ...@@ -90,7 +90,7 @@ class TestRunner:
return 0 return 0
def runSuite(self, suite): def runSuite(self, suite):
runner=unittest.TextTestRunner(verbosity=self.verbosity) runner=unittest.TextTestRunner(stream=sys.stderr, verbosity=self.verbosity)
self.results.append(runner.run(suite)) self.results.append(runner.run(suite))
def report(self, message): def report(self, message):
...@@ -257,6 +257,11 @@ def main(args): ...@@ -257,6 +257,11 @@ def main(args):
whether it succeeded. Running with -q is the same as whether it succeeded. Running with -q is the same as
running with -v1. running with -v1.
-o filename
Output test results to the specified file rather than
to stderr.
-h -h
Display usage information. Display usage information.
...@@ -269,7 +274,7 @@ def main(args): ...@@ -269,7 +274,7 @@ def main(args):
mega_suite = 1 mega_suite = 1
set_python_path = 1 set_python_path = 1
options, arg=getopt.getopt(args, 'amPhd:f:v:qM') options, arg=getopt.getopt(args, 'amPhd:f:v:qMo:')
if not options: if not options:
err_exit(usage_msg) err_exit(usage_msg)
for name, value in options: for name, value in options:
...@@ -294,6 +299,9 @@ def main(args): ...@@ -294,6 +299,9 @@ def main(args):
verbosity = int(value) verbosity = int(value)
elif name == 'q': elif name == 'q':
verbosity = 1 verbosity = 1
elif name == 'o':
f = open(value,'w')
sys.stderr = f
else: else:
err_exit(usage_msg) err_exit(usage_msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment