summaryrefslogtreecommitdiff
path: root/selftest/filter-subunit
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-11-03 16:30:40 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-11-03 17:05:19 +0000
commit4f87f8f33e5df1d2236bb07e66eb0c5a9cee65b6 (patch)
tree205c69ccaf6ec6ad40e097babb00b65d9b507a6a /selftest/filter-subunit
parentf6a1f46b5e6e5daddcaf57ca8d9a96580c3676fe (diff)
downloadsamba-4f87f8f33e5df1d2236bb07e66eb0c5a9cee65b6.tar.gz
samba-4f87f8f33e5df1d2236bb07e66eb0c5a9cee65b6.tar.bz2
samba-4f87f8f33e5df1d2236bb07e66eb0c5a9cee65b6.zip
filter-subunit: Add --fail-on-empty argument.
Diffstat (limited to 'selftest/filter-subunit')
-rwxr-xr-xselftest/filter-subunit11
1 files changed, 8 insertions, 3 deletions
diff --git a/selftest/filter-subunit b/selftest/filter-subunit
index 872d07fdb1..84b6610480 100755
--- a/selftest/filter-subunit
+++ b/selftest/filter-subunit
@@ -21,10 +21,10 @@ parser.add_option("--strip-passed-output", action="store_true",
help="Whether to strip output from tests that passed")
parser.add_option("--fail-immediately", action="store_true",
help="Whether to stop on the first error", default=False)
-
parser.add_option("--prefix", type="string",
help="Add prefix to all test names")
-
+parser.add_option("--fail-on-empty", default=False,
+ action="store_true", help="Fail if there was no subunit output")
opts, args = parser.parse_args()
if opts.expected_failures:
@@ -51,7 +51,12 @@ msg_ops = subunithelper.FilterOps(out, opts.prefix, expected_failures,
fail_immediately=opts.fail_immediately)
try:
- sys.exit(subunithelper.parse_results(msg_ops, statistics, sys.stdin))
+ ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
except subunithelper.ImmediateFail:
sys.stdout.flush()
sys.exit(1)
+
+if opts.fail_on_empty and not msg_ops.seen_output:
+ sys.exit(1)
+else:
+ sys.exit(ret)