libcli/security: add a function that checks for MS NFS ACEs
[Samba.git] / selftest / format-subunit
blob58321bf368a3c4f2d80ab53973cedcfca770d28e
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
7 import optparse
8 import os
9 import signal
10 import sys
12 sys.path.insert(0, "bin/python")
13 import samba
14 samba.ensure_external_module("mimeparse", "mimeparse")
15 samba.ensure_external_module("extras", "extras")
16 samba.ensure_external_module("testtools", "testtools")
17 samba.ensure_external_module("subunit", "subunit/python")
19 import subunithelper
21 parser = optparse.OptionParser("format-subunit [options]")
22 parser.add_option("--verbose", action="store_true",
23 help="Be verbose")
24 parser.add_option("--immediate", action="store_true",
25 help="Show failures immediately, don't wait until test run has finished")
26 parser.add_option("--prefix", type="string", default=".",
27 help="Prefix to write summary to")
29 opts, args = parser.parse_args()
31 def handle_sigint(sig, stack):
32 sys.exit(0)
34 signal.signal(signal.SIGINT, handle_sigint)
36 statistics = {
37 'SUITES_FAIL': 0,
38 'TESTS_UNEXPECTED_OK': 0,
39 'TESTS_EXPECTED_OK': 0,
40 'TESTS_UNEXPECTED_FAIL': 0,
41 'TESTS_EXPECTED_FAIL': 0,
42 'TESTS_ERROR': 0,
43 'TESTS_SKIP': 0,
46 msg_ops = subunithelper.PlainFormatter(opts.verbose, opts.immediate, statistics)
48 expected_ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
50 summaryfile = os.path.join(opts.prefix, "summary")
52 msg_ops.write_summary(summaryfile)
54 print "\nA summary with detailed information can be found in:"
55 print " %s" % summaryfile
57 sys.exit(expected_ret)