Skip to content

Commit 394b6ac

Browse files
refackjasnell
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 2ff107d commit 394b6ac

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/test.py

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

905903
return name
906904

0 commit comments

Comments
 (0)