Ejemplo n.º 1
0
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.')
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 def f(output):
     return StreamToExtendedDecorator(JUnitXmlResult(output))
def main():
    run_filter_script(
        lambda output: StreamToExtendedDecorator(
            JUnitXmlResult(output)), "Convert to junitxml", protocol_version=2)