From 5b72f891a8b992cb4461c917a6ca59ed95e7b2a9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 21 May 2016 12:43:57 +0200 Subject: [PATCH] test: fix component printing on windows Commit 084b2ec ("test: include component in tap output") introduced an in hindsight glaringly obvious but fortunately not very critical Windows-specific bug by failing to take the path separator into account. This commit rectifies that, the prefix is now correctly stripped. PR-URL: https://github.com/nodejs/node/pull/6915 Refs: https://github.com/nodejs/node/pull/6653 Reviewed-By: Anna Henningsen --- tools/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 142ad9ef5f4b51..a8df0b937ec66e 100755 --- a/tools/test.py +++ b/tools/test.py @@ -273,10 +273,11 @@ def HasRun(self, 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. - prefix = abspath(join(dirname(__file__), '../test')) + '/' + prefix = abspath(join(dirname(__file__), '../test')) + os.sep command = output.command[-1] if command.endswith('.js'): command = command[:-3] if command.startswith(prefix): command = command[len(prefix):] + command = command.replace('\\', '/') if output.UnexpectedOutput(): status_line = 'not ok %i %s' % (self._done, command)