source: vendor/current/selftest/format-subunit

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 1.3 KB
Line 
1#!/usr/bin/env python
2# vim: expandtab
3# Pretty-format subunit output
4# Copyright (C) 2008-2010 Jelmer Vernooij <jelmer@samba.org>
5# Published under the GNU GPL, v3 or later
6
7import optparse
8import os
9import signal
10import sys
11
12sys.path.insert(0, "bin/python")
13
14import subunithelper
15
16parser = optparse.OptionParser("format-subunit [options]")
17parser.add_option("--verbose", action="store_true",
18 help="Be verbose")
19parser.add_option("--immediate", action="store_true",
20 help="Show failures immediately, don't wait until test run has finished")
21parser.add_option("--prefix", type="string", default=".",
22 help="Prefix to write summary to")
23
24opts, args = parser.parse_args()
25
26def handle_sigint(sig, stack):
27 sys.exit(0)
28
29signal.signal(signal.SIGINT, handle_sigint)
30
31statistics = {
32 'SUITES_FAIL': 0,
33 'TESTS_UNEXPECTED_OK': 0,
34 'TESTS_EXPECTED_OK': 0,
35 'TESTS_UNEXPECTED_FAIL': 0,
36 'TESTS_EXPECTED_FAIL': 0,
37 'TESTS_ERROR': 0,
38 'TESTS_SKIP': 0,
39}
40
41msg_ops = subunithelper.PlainFormatter(opts.verbose, opts.immediate, statistics)
42
43expected_ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
44
45summaryfile = os.path.join(opts.prefix, "summary")
46
47msg_ops.write_summary(summaryfile)
48
49print "\nA summary with detailed information can be found in:"
50print " %s" % summaryfile
51
52sys.exit(expected_ret)
Note: See TracBrowser for help on using the repository browser.