def main(): args = parse_args() logger.info('\nParsing Subunit input: %r [%s bytes]' % ( args.subunit_file, os.path.getsize(args.subunit_file)) ) stream = open(args.subunit_file, 'rb') suite = ByteStreamToStreamResult(stream) logger.info('\nExtracting details...\n') result = StreamToExtendedDecorator(FileSaveResult()) result.startTestRun() try: suite.run(result) finally: result.stopTestRun() logger.info('\nDone.')
def make_result(self, get_id, test_command, previous_run=None): if getattr(self.options, 'subunit', False): if v2_avail: serializer = subunit.StreamResultToBytes(self._stdout) else: serializer = StreamToExtendedDecorator( subunit.TestProtocolClient(self._stdout)) # By pass user transforms - just forward it all, result = serializer # and interpret everything as success. summary = testtools.StreamSummary() summary.startTestRun() summary.stopTestRun() return result, summary else: # Apply user defined transforms. filter_tags = test_command.get_filter_tags() output = CLITestResult(self, get_id, self._stdout, previous_run, filter_tags=filter_tags) summary = output._summary return output, summary
def f(output): return StreamToExtendedDecorator(JUnitXmlResult(output))
def main(): run_filter_script( lambda output: StreamToExtendedDecorator( JUnitXmlResult(output)), "Convert to junitxml", protocol_version=2)