diff --git a/test/abort/test-abort-backtrace.js b/test/abort/test-abort-backtrace.js index e69ac3ddfdece8..7f87ef0e7f4559 100644 --- a/test/abort/test-abort-backtrace.js +++ b/test/abort/test-abort-backtrace.js @@ -19,7 +19,8 @@ if (process.argv[2] === 'child') { } if (!common.isWindows) { - if (!frames.some((frame) => frame.includes(`[${process.execPath}]`))) { + const { getBinaryPath } = require('../common/shared-lib-util'); + if (!frames.some((frame) => frame.includes(`[${getBinaryPath()}]`))) { assert.fail(`Some frames should include the binary name:\n${stderr}`); } } diff --git a/test/common/shared-lib-util.js b/test/common/shared-lib-util.js index baa989824cdc2c..89b1231e5cc66c 100644 --- a/test/common/shared-lib-util.js +++ b/test/common/shared-lib-util.js @@ -29,7 +29,7 @@ exports.addLibraryPath = function(env) { path.dirname(process.execPath); }; -// Get the full path of shared lib +// Get the full path of shared lib. exports.getSharedLibPath = function() { if (common.isWindows) { return path.join(path.dirname(process.execPath), 'node.dll'); @@ -42,3 +42,9 @@ exports.getSharedLibPath = function() { `libnode.${process.config.variables.shlib_suffix}`); } }; + +// Get the binary path of stack frames. +exports.getBinaryPath = function() { + return process.config.variables.node_shared ? + exports.getSharedLibPath() : process.execPath; +};