Skip to content

Commit 4198253

Browse files
George Adamsgibfahn
George Adams
authored andcommitted
test: test.py add option to use node in path
This pr adds the ability to run `tools/test.py --path`. This means that instead of defaulting to out/Release we can use the node version from the path. PR-URL: nodejs#9674 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c57caf5 commit 4198253

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/test.py

+11
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import copy
4646

4747
from os.path import join, dirname, abspath, basename, isdir, exists
48+
from distutils.spawn import find_executable
4849
from datetime import datetime
4950
from Queue import Queue, Empty
5051

@@ -865,6 +866,14 @@ def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail,
865866
self.repeat = repeat
866867

867868
def GetVm(self, arch, mode):
869+
parser = BuildOptions()
870+
(options, args) = parser.parse_args()
871+
if not ProcessOptions(options):
872+
parser.print_help()
873+
return 1
874+
if options.path:
875+
name = find_executable("node")
876+
return name
868877
if arch == 'none':
869878
name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
870879
else:
@@ -1385,6 +1394,8 @@ def BuildOptions():
13851394
result.add_option('--repeat',
13861395
help='Number of times to repeat given tests',
13871396
default=1, type="int")
1397+
result.add_option('--path',
1398+
help='Use node in the path rather than out/Release', default=False, action="store_true")
13881399
return result
13891400

13901401

0 commit comments

Comments
 (0)