aboutsummaryrefslogtreecommitdiff
path: root/tools/test.py
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-05-09 15:50:56 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-05-13 23:38:24 +0200
commit084b2ec19879a717cd6c8fd4a978784b3b534cc0 (patch)
tree6ef1891d32bc3ccd8c125517a1eea13276b3ca89 /tools/test.py
parent5d64ff4f672157f621c73ec80373569e7f55046b (diff)
downloadandroid-node-v8-084b2ec19879a717cd6c8fd4a978784b3b534cc0.tar.gz
android-node-v8-084b2ec19879a717cd6c8fd4a978784b3b534cc0.tar.bz2
android-node-v8-084b2ec19879a717cd6c8fd4a978784b3b534cc0.zip
test: include component in tap output
Print test name as (for example) "parallel/test-assert". Tests that are scraped from the addons documentation are all named test.js, making it hard to decipher what test is running when only the filename is printed. Fixes: https://github.com/nodejs/node/issues/6651 PR-URL: https://github.com/nodejs/node/pull/6653 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-xtools/test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py
index c98e98501d..12da869e57 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -269,7 +269,15 @@ class TapProgressIndicator(SimpleProgressIndicator):
def HasRun(self, output):
self._done += 1
- command = basename(output.command[-1])
+
+ # Print test name as (for example) "parallel/test-assert". Tests that are
+ # scraped from the addons documentation are all named test.js, making it
+ # hard to decipher what test is running when only the filename is printed.
+ prefix = abspath(join(dirname(__file__), '../test')) + '/'
+ command = output.command[-1]
+ if command.endswith('.js'): command = command[:-3]
+ if command.startswith(prefix): command = command[len(prefix):]
+
if output.UnexpectedOutput():
status_line = 'not ok %i %s' % (self._done, command)
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE: