Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 561b149

Browse filesBrowse 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 <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>
1 parent 16af467 commit 561b149
Copy full SHA for 561b149

File tree

Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def HasRun(self, output):
298298

299299
if output.HasCrashed():
300300
self.severity = 'crashed'
301-
exit_code = output.output.exit_code
301+
exit_code = output.output.exit_code
302302
self.traceback = "oh no!\nexit code: " + PrintCrashed(exit_code)
303303

304304
if output.HasTimedOut():
@@ -1461,6 +1461,13 @@ def SplitPath(s):
14611461
stripped = [ c.strip() for c in s.split('/') ]
14621462
return [ Pattern(s) for s in stripped if len(s) > 0 ]
14631463

1464+
def NormalizePath(path):
1465+
# strip the extra path information of the specified test
1466+
if path.startswith('test/'):
1467+
path = path[5:]
1468+
if path.endswith('.js'):
1469+
path = path[:-3]
1470+
return path
14641471

14651472
def GetSpecialCommandProcessor(value):
14661473
if (not value) or (value.find('@') == -1):
@@ -1534,7 +1541,7 @@ def Main():
15341541
else:
15351542
paths = [ ]
15361543
for arg in args:
1537-
path = SplitPath(arg)
1544+
path = SplitPath(NormalizePath(arg))
15381545
paths.append(path)
15391546

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.