diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2012-12-19 08:10:17 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-02-20 21:50:55 +0400 |
commit | 9d45b945f7903ea7db8427fe8b9cf08fd8d42ef5 (patch) | |
tree | 062b7fd92bfd0a75fcf3d868e9660c0213e3e147 /tools | |
parent | 326746458602d0bd313bc90e209e6818f7320905 (diff) |
test: add TAP output to the test runner
This is a back-port of commit 14ed173 from the master branch.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py index d711f9ca1d9..e94ad24f830 100755 --- a/tools/test.py +++ b/tools/test.py @@ -221,6 +221,31 @@ class DotsProgressIndicator(SimpleProgressIndicator): sys.stdout.flush() +class TapProgressIndicator(SimpleProgressIndicator): + + def Starting(self): + print '1..%i' % len(self.cases) + self._done = 0 + + def AboutToRun(self, case): + pass + + def HasRun(self, output): + self._done += 1 + command = basename(output.command[1]) + if output.UnexpectedOutput(): + print 'not ok %i - %s' % (self._done, command) + for l in output.output.stderr.split(os.linesep): + print '#' + l + for l in output.output.stdout.split(os.linesep): + print '#' + l + else: + print 'ok %i - %s' % (self._done, command) + + def Done(self): + pass + + class CompactProgressIndicator(ProgressIndicator): def __init__(self, cases, templates): @@ -311,6 +336,7 @@ PROGRESS_INDICATORS = { 'verbose': VerboseProgressIndicator, 'dots': DotsProgressIndicator, 'color': ColorProgressIndicator, + 'tap': TapProgressIndicator, 'mono': MonochromeProgressIndicator } @@ -1140,7 +1166,7 @@ def BuildOptions(): result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons", default=[], action="append") result.add_option("-p", "--progress", - help="The style of progress indicator (verbose, dots, color, mono)", + help="The style of progress indicator (verbose, dots, color, mono, tap)", choices=PROGRESS_INDICATORS.keys(), default="mono") result.add_option("--no-build", help="Don't build requirements", default=True, action="store_true") |