Skip to content

Commit a11ed6a

Browse files
refackitaloacasas
authored andcommitted
test: more robust check for location of node.exe
look for the actual produced `exe` not just the directory PR-URL: #12120 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Nikolai Vavilov <[email protected]>
1 parent 6083e7a commit a11ed6a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/test.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -890,14 +890,12 @@ def GetVm(self, arch, mode):
890890
# http://code.google.com/p/gyp/issues/detail?id=40
891891
# It will put the builds into Release/node.exe or Debug/node.exe
892892
if utils.IsWindows():
893-
out_dir = os.path.join(dirname(__file__), "..", "out")
894-
if not exists(out_dir):
895-
if mode == 'debug':
896-
name = os.path.abspath('Debug/node.exe')
897-
else:
898-
name = os.path.abspath('Release/node.exe')
899-
else:
900-
name = os.path.abspath(name + '.exe')
893+
if not exists(name + '.exe'):
894+
name = name.replace('out/', '')
895+
name = os.path.abspath(name + '.exe')
896+
897+
if not exists(name):
898+
raise ValueError('Could not find executable. Should be ' + name)
901899

902900
return name
903901

0 commit comments

Comments
 (0)