mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: check symbols in shared lib
When building the node with `--shared` option, we need to verify the symbols in shared lib instead of executable. 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/18806 Refs: https://github.com/nodejs/node/issues/18535 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
8fad7affd9
commit
2f6866e1d9
2 files changed
+22
-2
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable required-modules */
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const path = require('path');
|
||||
|
||||
// If node executable is linked to shared lib, need to take care about the
|
||||
@@ -27,3 +27,17 @@ exports.addLibraryPath = function(env) {
|
||||
(env.PATH ? env.PATH + path.delimiter : '') +
|
||||
path.dirname(process.execPath);
|
||||
};
|
||||
|
||||
// Get the full path of shared lib
|
||||
exports.getSharedLibPath = function() {
|
||||
if (common.isWindows) {
|
||||
return path.join(path.dirname(process.execPath), 'node.dll');
|
||||
} else if (common.isOSX) {
|
||||
return path.join(path.dirname(process.execPath),
|
||||
`libnode.${process.config.variables.shlib_suffix}`);
|
||||
} else {
|
||||
return path.join(path.dirname(process.execPath),
|
||||
'lib.target',
|
||||
`libnode.${process.config.variables.shlib_suffix}`);
|
||||
}
|
||||
};
|
||||
@@ -7,7 +7,13 @@
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { spawnSync } = require('child_process');
|
||||
const args = [process.execPath];
|
||||
const { getSharedLibPath } = require('../common/shared-lib-util.js');
|
||||
|
||||
// For shared lib case, check shared lib instead
|
||||
const args = [
|
||||
process.config.variables.node_shared ?
|
||||
getSharedLibPath() : process.execPath
|
||||
];
|
||||
|
||||
if (common.isAIX)
|
||||
args.unshift('-Xany', '-B');
|
||||
|
||||
Reference in new issue
Block a user