From 49ee30b8ac3277c20d9c4760457dde16daf4caf5 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Wed, 29 Mar 2017 10:09:04 -0400 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock Reviewed-By: Nikolai Vavilov --- tools/test.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/test.py b/tools/test.py index 05a2dd92ae9f2f..ff9ba7cbc49172 100755 --- a/tools/test.py +++ b/tools/test.py @@ -890,14 +890,12 @@ def GetVm(self, arch, mode): # 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