Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5bbf009

Browse filesBrowse files
yhwangMylesBorins
authored andcommitted
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: #18535 Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: #18806 Refs: #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>
1 parent 6ae2caf commit 5bbf009
Copy full SHA for 5bbf009

File tree

Expand file treeCollapse file tree

2 files changed

+22
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+22
-1
lines changed
Open diff view settings
Collapse file

‎test/common/shared-lib-util.js‎

Copy file name to clipboardExpand all lines: test/common/shared-lib-util.js
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable required-modules */
22
'use strict';
3+
const common = require('../common');
34
const path = require('path');
45

56
// If node executable is linked to shared lib, need to take care about the
@@ -27,3 +28,17 @@ exports.addLibraryPath = function(env) {
2728
(env.PATH ? env.PATH + path.delimiter : '') +
2829
path.dirname(process.execPath);
2930
};
31+
32+
// Get the full path of shared lib
33+
exports.getSharedLibPath = function() {
34+
if (common.isWindows) {
35+
return path.join(path.dirname(process.execPath), 'node.dll');
36+
} else if (common.isOSX) {
37+
return path.join(path.dirname(process.execPath),
38+
`libnode.${process.config.variables.shlib_suffix}`);
39+
} else {
40+
return path.join(path.dirname(process.execPath),
41+
'lib.target',
42+
`libnode.${process.config.variables.shlib_suffix}`);
43+
}
44+
};
Collapse file

‎test/parallel/test-postmortem-metadata.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-postmortem-metadata.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
const common = require('../common');
88
const assert = require('assert');
99
const { spawnSync } = require('child_process');
10-
const args = [process.execPath];
10+
const { getSharedLibPath } = require('../common/shared-lib-util.js');
11+
12+
// For shared lib case, check shared lib instead
13+
const args = [
14+
process.config.variables.node_shared ?
15+
getSharedLibPath() : process.execPath
16+
];
1117

1218
if (common.isAIX)
1319
args.unshift('-Xany', '-B');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.