Skip to content

Commit b1bd1c4

Browse files
reconbotMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 54c38eb commit b1bd1c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/test.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,13 @@ def SplitPath(s):
14761476
stripped = [ c.strip() for c in s.split('/') ]
14771477
return [ Pattern(s) for s in stripped if len(s) > 0 ]
14781478

1479+
def NormalizePath(path):
1480+
# strip the extra path information of the specified test
1481+
if path.startswith('test/'):
1482+
path = path[5:]
1483+
if path.endswith('.js'):
1484+
path = path[:-3]
1485+
return path
14791486

14801487
def GetSpecialCommandProcessor(value):
14811488
if (not value) or (value.find('@') == -1):
@@ -1548,7 +1555,7 @@ def Main():
15481555
else:
15491556
paths = [ ]
15501557
for arg in args:
1551-
path = SplitPath(arg)
1558+
path = SplitPath(NormalizePath(arg))
15521559
paths.append(path)
15531560

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

0 commit comments

Comments
 (0)