summaryrefslogtreecommitdiff
path: root/tools/test.py
diff options
context:
space:
mode:
authorGeorge Adams <george.adams@uk.ibm.com>2016-11-18 13:57:56 +0000
committerGibson Fahnestock <gib@uk.ibm.com>2017-01-04 12:18:50 +0000
commit4198253a185e20b7a9d0fb363fabacece712200d (patch)
tree5b9cd34a1ba5e71018d1a641f51508eb8ecbb92e /tools/test.py
parentc57caf5c694e2cde08863f92ce745caf1ef4f574 (diff)
downloadnode-new-4198253a185e20b7a9d0fb363fabacece712200d.tar.gz
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: https://github.com/nodejs/node/pull/9674 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-xtools/test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/test.py b/tools/test.py
index c8edca2b99..18188e7b00 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -45,6 +45,7 @@ import errno
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
@@ -865,6 +866,14 @@ class Context(object):
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:
@@ -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