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 963c6ee1391d8e..36c518a2f03c94 100644 --- a/test/common/shared-lib-util.js +++ b/test/common/shared-lib-util.js @@ -28,7 +28,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'); @@ -41,3 +41,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; +};