diff options
author | Jonathan Lange <jml@mumak.net> | 2012-04-20 12:16:26 +0100 |
---|---|---|
committer | Jonathan Lange <jml@mumak.net> | 2012-04-20 12:16:26 +0100 |
commit | 5386af7e467527183cc39cce2490d500e86736e7 (patch) | |
tree | 8155ab056841bda304880b6e9f6cee76d650d463 /filters | |
parent | c020fc0b4113e2654240ebe5cfe7827b77c4e155 (diff) | |
download | subunit-5386af7e467527183cc39cce2490d500e86736e7.tar.gz |
Factor subunit-filter some more.
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/subunit-filter | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/filters/subunit-filter b/filters/subunit-filter index 07a5857..945f80d 100755 --- a/filters/subunit-filter +++ b/filters/subunit-filter @@ -118,25 +118,35 @@ def _make_regexp_filter(with_regexps, without_regexps): return check_regexps + +def make_result(output, options, predicate): + """Make the result that we'll send the test outcomes to.""" + fixup_expected_failures = set() + for path in options.fixup_expected_failures or (): + fixup_expected_failures.update(read_test_list(path)) + return TestResultFilter( + TestProtocolClient(output), + filter_error=options.error, + filter_failure=options.failure, + filter_success=options.success, + filter_skip=options.skip, + filter_xfail=options.xfail, + filter_predicate=predicate, + fixup_expected_failures=fixup_expected_failures) + + regexp_filter = _make_regexp_filter(options.with_regexps, options.without_regexps) tag_filter = _make_tag_filter(options.with_tags, options.without_tags) filter_predicate = and_predicates([regexp_filter, tag_filter]) -fixup_expected_failures = set() -for path in options.fixup_expected_failures or (): - fixup_expected_failures.update(read_test_list(path)) -result = TestProtocolClient(sys.stdout) -result = TestResultFilter(result, filter_error=options.error, - filter_failure=options.failure, filter_success=options.success, - filter_skip=options.skip, filter_xfail=options.xfail, - filter_predicate=tag_filter, - fixup_expected_failures=fixup_expected_failures) if options.no_passthrough: passthrough_stream = DiscardStream() else: passthrough_stream = None + +result = make_result(sys.stdout, options, tag_filter) test = ProtocolTestCase(sys.stdin, passthrough=passthrough_stream) result.startTestRun() test.run(result) |