Skip to content

Commit

Permalink
test: test.py add option to use node in path
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
George Adams authored and gibfahn committed Jan 4, 2017
1 parent c57caf5 commit 4198253
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import copy

from os.path import join, dirname, abspath, basename, isdir, exists
from distutils.spawn import find_executable
from datetime import datetime
from Queue import Queue, Empty

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

def GetVm(self, arch, mode):
parser = BuildOptions()
(options, args) = parser.parse_args()
if not ProcessOptions(options):
parser.print_help()
return 1
if options.path:
name = find_executable("node")
return name
if arch == 'none':
name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
else:
Expand Down Expand Up @@ -1385,6 +1394,8 @@ def BuildOptions():
result.add_option('--repeat',
help='Number of times to repeat given tests',
default=1, type="int")
result.add_option('--path',
help='Use node in the path rather than out/Release', default=False, action="store_true")
return result


Expand Down

0 comments on commit 4198253

Please sign in to comment.