mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: fix test-abort-backtrace in shared lib build
When using shared lib build, the binary path in the stack frames points to shared lib. Change the checking criteria in the test case to match that. Refs: https://github.com/nodejs/node/issues/18535 Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: https://github.com/nodejs/node/pull/19213 Refs: https://github.com/nodejs/node/issues/18535 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
530b8a4077
commit
f0c8f6969f
|
|
@ -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}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user