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 adee998

Browse filesBrowse files
sam-githubBridgeAR
authored andcommitted
test: debug output for dlopen-ping-pong test
Make test failures easier to diagnose through progress logging, and reporting of dlerror(). PR-URL: #29818 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent a711304 commit adee998
Copy full SHA for adee998

File tree

Expand file treeCollapse file tree

2 files changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎test/addons/dlopen-ping-pong/binding.cc‎

Copy file name to clipboardExpand all lines: test/addons/dlopen-ping-pong/binding.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static ping ping_func;
2626
void LoadLibrary(const FunctionCallbackInfo<Value>& args) {
2727
const String::Utf8Value filename(args.GetIsolate(), args[0]);
2828
void* handle = dlopen(*filename, RTLD_LAZY);
29+
if (handle == nullptr) fprintf(stderr, "%s\n", dlerror());
2930
assert(handle != nullptr);
3031
ping_func = reinterpret_cast<ping>(dlsym(handle, "dlopen_ping"));
3132
assert(ping_func != nullptr);
Collapse file

‎test/addons/dlopen-ping-pong/test.js‎

Copy file name to clipboardExpand all lines: test/addons/dlopen-ping-pong/test.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ const path = require('path');
99
const os = require('os');
1010

1111
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
12+
console.log('process.dlopen:', bindingPath);
1213
process.dlopen(module, bindingPath,
1314
os.constants.dlopen.RTLD_NOW | os.constants.dlopen.RTLD_GLOBAL);
15+
console.log('module.exports.load:', `${path.dirname(bindingPath)}/ping.so`);
1416
module.exports.load(`${path.dirname(bindingPath)}/ping.so`);
1517
assert.strictEqual(module.exports.ping(), 'pong');
1618

1719
// Check that after the addon is loaded with
1820
// process.dlopen() a require() call fails.
21+
console.log('require:', `./build/${common.buildType}/binding`);
1922
const re = /^Error: Module did not self-register\.$/;
2023
assert.throws(() => require(`./build/${common.buildType}/binding`), re);

0 commit comments

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