summaryrefslogtreecommitdiff
path: root/filters
diff options
context:
space:
mode:
authorJohn Arbash Meinel <john@arbash-meinel.com>2010-08-24 17:41:12 -0500
committerJohn Arbash Meinel <john@arbash-meinel.com>2010-08-24 17:41:12 -0500
commit8fa9c2b1ac2ab8e9b4df8d6506965d47839e0240 (patch)
treeea125220c058d91b65cf0117b1b3228d9473a82b /filters
parent7a7a14024f445a18bbdab8a7dbfe45328ae6e5d6 (diff)
downloadsubunit-8fa9c2b1ac2ab8e9b4df8d6506965d47839e0240.tar.gz
(bug #623642) Add --no-xfail and -F to subunit-filter.
The existing --no-success only filtered out genuine success cases. Now we can filter everything down to stuff that would actually be considered a 'failure'.
Diffstat (limited to 'filters')
-rwxr-xr-xfilters/subunit-filter22
1 files changed, 19 insertions, 3 deletions
diff --git a/filters/subunit-filter b/filters/subunit-filter
index c06a03a..ffd43e5 100755
--- a/filters/subunit-filter
+++ b/filters/subunit-filter
@@ -51,18 +51,34 @@ parser.add_option("--no-passthrough", action="store_true",
help="Hide all non subunit input.", default=False, dest="no_passthrough")
parser.add_option("-s", "--success", action="store_false",
help="include successes", dest="success")
-parser.add_option("--no-skip", action="store_true",
- help="exclude skips", dest="skip")
parser.add_option("--no-success", action="store_true",
help="exclude successes", default=True, dest="success")
+parser.add_option("--no-skip", action="store_true",
+ help="exclude skips", dest="skip")
+parser.add_option("--xfail", action="store_false",
+ help="include expected falures", default=True, dest="xfail")
+parser.add_option("--no-xfail", action="store_true",
+ help="exclude expected falures", default=True, dest="xfail")
parser.add_option("-m", "--with", type=str,
help="regexp to include (case-sensitive by default)",
action="append", dest="with_regexps")
parser.add_option("--without", type=str,
help="regexp to exclude (case-sensitive by default)",
action="append", dest="without_regexps")
+# TODO: This could be done as a callback to allow following options to override
+# parts. As is, we just use it as a big hammer...
+parser.add_option("-F", "--only-genuine-failures", action="store_true",
+ default=False,
+ help="Only pass through failures and exceptions.")
(options, args) = parser.parse_args()
+if options.only_genuine_failures:
+ options.success = True
+ options.skip = True
+ options.xfail = True
+ options.no_passthrough = True
+ # options.error = False
+ # options.failures = False
def _compile_re_from_list(l):
@@ -94,7 +110,7 @@ regexp_filter = _make_regexp_filter(options.with_regexps,
result = TestProtocolClient(sys.stdout)
result = TestResultFilter(result, filter_error=options.error,
filter_failure=options.failure, filter_success=options.success,
- filter_skip=options.skip,
+ filter_skip=options.skip, filter_xfail=options.xfail,
filter_predicate=regexp_filter)
if options.no_passthrough:
passthrough_stream = DiscardStream()