The Wayback Machine - https://web.archive.org/web/20211209191621/https://github.com/nodejs/node/commit/b1bd1c42c0
Skip to content
Permalink
Browse files
tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
reconbot authored and MylesBorins committed Nov 26, 2016
1 parent 54c38eb commit b1bd1c42c03d52838480a0d21b15e076244739fa
Showing with 8 additions and 1 deletion.
  1. +8 −1 tools/test.py
@@ -1476,6 +1476,13 @@ def SplitPath(s):
stripped = [ c.strip() for c in s.split('/') ]
return [ Pattern(s) for s in stripped if len(s) > 0 ]

def NormalizePath(path):
# strip the extra path information of the specified test
if path.startswith('test/'):
path = path[5:]
if path.endswith('.js'):
path = path[:-3]
return path

def GetSpecialCommandProcessor(value):
if (not value) or (value.find('@') == -1):
@@ -1548,7 +1555,7 @@ def Main():
else:
paths = [ ]
for arg in args:
path = SplitPath(arg)
path = SplitPath(NormalizePath(arg))
paths.append(path)

# Check for --valgrind option. If enabled, we overwrite the special

0 comments on commit b1bd1c4

Please sign in to comment.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.