test: more robust check for location of node.exe

look for the actual produced `exe` not just the directory

PR-URL: https://github.com/nodejs/node/pull/12120
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
This commit is contained in:
Refael Ackermann 2017-03-29 10:09:04 -04:00 committed by James M Snell
parent 2ff107dad7
commit 394b6ac5cb

View File

@ -893,14 +893,12 @@ class Context(object):
# http://code.google.com/p/gyp/issues/detail?id=40
# It will put the builds into Release/node.exe or Debug/node.exe
if utils.IsWindows():
out_dir = os.path.join(dirname(__file__), "..", "out")
if not exists(out_dir):
if mode == 'debug':
name = os.path.abspath('Debug/node.exe')
else:
name = os.path.abspath('Release/node.exe')
else:
name = os.path.abspath(name + '.exe')
if not exists(name + '.exe'):
name = name.replace('out/', '')
name = os.path.abspath(name + '.exe')
if not exists(name):
raise ValueError('Could not find executable. Should be ' + name)
return name