diff options
author | Robert Collins <robertc@robertcollins.net> | 2013-08-25 22:38:56 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-08-25 22:38:56 +1200 |
commit | f025f2ea921ab8c551b7c6b7fa3de23099057504 (patch) | |
tree | 0a24acb7d7049a0317cc614a654d1985755327e6 /filters | |
parent | 705c09fd54abeb97acd214498f188ba00c545248 (diff) | |
download | subunit-f025f2ea921ab8c551b7c6b7fa3de23099057504.tar.gz |
* Most filters will now accept a file path argument instead of only reading
from stdin. (Robert Collins, #409206)
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/subunit-1to2 | 4 | ||||
-rwxr-xr-x | filters/subunit-2to1 | 5 | ||||
-rwxr-xr-x | filters/subunit-filter | 5 | ||||
-rwxr-xr-x | filters/subunit-ls | 5 | ||||
-rwxr-xr-x | filters/subunit2pyunit | 4 |
5 files changed, 14 insertions, 9 deletions
diff --git a/filters/subunit-1to2 b/filters/subunit-1to2 index bfb6658..9725820 100755 --- a/filters/subunit-1to2 +++ b/filters/subunit-1to2 @@ -22,7 +22,7 @@ import sys from testtools import ExtendedToStreamDecorator from subunit import StreamResultToBytes -from subunit.filters import run_tests_from_stream +from subunit.filters import find_stream, run_tests_from_stream def make_options(description): @@ -33,7 +33,7 @@ def make_options(description): def main(): parser = make_options(__doc__) (options, args) = parser.parse_args() - run_tests_from_stream(sys.stdin, + run_tests_from_stream(find_stream(sys.stdin, args), ExtendedToStreamDecorator(StreamResultToBytes(sys.stdout))) sys.exit(0) diff --git a/filters/subunit-2to1 b/filters/subunit-2to1 index 36632dd..0072307 100755 --- a/filters/subunit-2to1 +++ b/filters/subunit-2to1 @@ -22,7 +22,7 @@ import sys from testtools import StreamToExtendedDecorator from subunit import ByteStreamToStreamResult, TestProtocolClient -from subunit.filters import run_tests_from_stream +from subunit.filters import find_stream, run_tests_from_stream def make_options(description): @@ -33,7 +33,8 @@ def make_options(description): def main(): parser = make_options(__doc__) (options, args) = parser.parse_args() - case = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') + case = ByteStreamToStreamResult( + find_stream(sys.stdin, args), non_subunit_name='stdout') result = StreamToExtendedDecorator(TestProtocolClient(sys.stdout)) # What about stdout chunks? result.startTestRun() diff --git a/filters/subunit-filter b/filters/subunit-filter index 521b198..e9e2bb0 100755 --- a/filters/subunit-filter +++ b/filters/subunit-filter @@ -38,7 +38,7 @@ from subunit import ( StreamResultToBytes, read_test_list, ) -from subunit.filters import filter_by_result +from subunit.filters import filter_by_result, find_stream from subunit.test_results import ( and_predicates, make_tag_filter, @@ -156,7 +156,8 @@ def main(): output_path=None, passthrough=(not options.no_passthrough), forward=False, - protocol_version=2) + protocol_version=2, + input_stream=find_stream(sys.stdin, args)) sys.exit(0) diff --git a/filters/subunit-ls b/filters/subunit-ls index be4b29f..8c6a1e7 100755 --- a/filters/subunit-ls +++ b/filters/subunit-ls @@ -24,7 +24,7 @@ from testtools import ( StreamSummary) from subunit import ByteStreamToStreamResult -from subunit.filters import run_tests_from_stream +from subunit.filters import find_stream, run_tests_from_stream from subunit.test_results import ( CatFiles, TestIdPrintingResult, @@ -41,7 +41,8 @@ parser.add_option("--exists", action="store_true", parser.add_option("--no-passthrough", action="store_true", help="Hide all non subunit input.", default=False, dest="no_passthrough") (options, args) = parser.parse_args() -test = ByteStreamToStreamResult(sys.stdin, non_subunit_name="stdout") +test = ByteStreamToStreamResult( + find_stream(sys.stdin, args), non_subunit_name="stdout") result = TestIdPrintingResult(sys.stdout, options.times, options.exists) if not options.no_passthrough: result = StreamResultRouter(result) diff --git a/filters/subunit2pyunit b/filters/subunit2pyunit index 4737d67..d10ceea 100755 --- a/filters/subunit2pyunit +++ b/filters/subunit2pyunit @@ -24,6 +24,7 @@ import unittest from testtools import StreamToExtendedDecorator, DecorateTestCaseResult, StreamResultRouter from subunit import ByteStreamToStreamResult +from subunit.filters import find_stream from subunit.test_results import CatFiles parser = OptionParser(description=__doc__) @@ -33,7 +34,8 @@ parser.add_option("--progress", action="store_true", help="Use bzrlib's test reporter (requires bzrlib)", default=False) (options, args) = parser.parse_args() -test = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') +test = ByteStreamToStreamResult( + find_stream(sys.stdin, args), non_subunit_name='stdout') def wrap_result(result): result = StreamToExtendedDecorator(result) if not options.no_passthrough: |