Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: add TAP output to the test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
tjfontaine authored and bnoordhuis committed Dec 19, 2012
1 parent 43538f4 commit 14ed173
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tools/test.py
Expand Up @@ -221,6 +221,31 @@ def HasRun(self, output):
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):
Expand Down Expand Up @@ -311,6 +336,7 @@ def ClearLine(self, last_line_length):
'verbose': VerboseProgressIndicator,
'dots': DotsProgressIndicator,
'color': ColorProgressIndicator,
'tap': TapProgressIndicator,
'mono': MonochromeProgressIndicator
}

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 14ed173

Please sign in to comment.