1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00
samba-mirror/selftest/format-subunit
2010-03-30 01:08:20 +02:00

39 lines
1014 B
Python
Executable File

#!/usr/bin/env python
# Pretty-format subunit output
# Copyright (C) 2008-2010 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL, v3 or later
import optparse
import os
import sys
import subunithelper
parser = optparse.OptionParser("format-subunit [options]")
parser.add_option("--verbose", action="store_true",
help="Be verbose")
parser.add_option("--immediate", action="store_true",
help="Show failures immediately, don't wait until test run has finished")
parser.add_option("--prefix", type="string", default=".",
help="Prefix to write summary to")
opts, args = parser.parse_args()
statistics = {
'SUITES_FAIL': 0,
'TESTS_UNEXPECTED_OK': 0,
'TESTS_EXPECTED_OK': 0,
'TESTS_UNEXPECTED_FAIL': 0,
'TESTS_EXPECTED_FAIL': 0,
'TESTS_ERROR': 0,
'TESTS_SKIP': 0,
}
msg_ops = PlainFormatter(os.path.join(opts.prefix, "summary"), opts.verbose, opts.immediate, statistics)
expected_ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
msg_ops.summary()
sys.exit(expected_ret)