1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

format-subunit: Split out summary file writing.

This commit is contained in:
Jelmer Vernooij 2010-10-02 18:40:44 +02:00
parent 4ece674a99
commit d7edb40fca

View File

@ -24,6 +24,10 @@ parser.add_option("--prefix", type="string", default=".",
opts, args = parser.parse_args()
def handle_sigint(sig, stack):
sys.exit(0)
signal.signal(signal.SIGINT, handle_sigint)
statistics = {
'SUITES_FAIL': 0,
'TESTS_UNEXPECTED_OK': 0,
@ -34,15 +38,15 @@ statistics = {
'TESTS_SKIP': 0,
}
def handle_sigint(sig, stack):
sys.exit(0)
signal.signal(signal.SIGINT, handle_sigint)
msg_ops = subunithelper.PlainFormatter(os.path.join(opts.prefix, "summary"), opts.verbose,
opts.immediate, statistics)
msg_ops = subunithelper.PlainFormatter(opts.verbose, opts.immediate, statistics)
expected_ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
msg_ops.summary()
summaryfile = os.path.join(opts.prefix, "summary")
msg_ops.write_summary(summaryfile)
print "\nA summary with detailed information can be found in:"
print " %s" % summaryfile
sys.exit(expected_ret)