Add --forward option to notify.

This commit is contained in:
Jelmer Vernooij
2010-01-17 18:47:37 +13:00
parent cbbebec02c
commit 357feddefe

View File

@@ -31,13 +31,20 @@ if not pynotify.init("Subunit-notify"):
parser = OptionParser(description=__doc__)
parser.add_option("--no-passthrough", action="store_true",
help="Hide all non subunit input.", default=False, dest="no_passthrough")
parser.add_option("-f", "--forward", action="store_true", default=False,
help="Forward subunit stream on stdout.")
(options, args) = parser.parse_args()
result = TestResultStats(sys.stdout)
if options.no_passthrough:
passthrough_stream = DiscardStream()
else:
passthrough_stream = None
test = ProtocolTestCase(sys.stdin, passthrough=passthrough_stream)
if options.forward:
forward_stream = sys.stdout
else:
forward_stream = None
test = ProtocolTestCase(sys.stdin, passthrough=passthrough_stream,
forward=forward_stream)
test.run(result)
if result.failed_tests > 0:
summary = "Test run failed"