Skip to content

Commit 147a06d

Browse files
danbevFishrock123
authored andcommitted
test: enable addons test to pass with debug build
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 6cd5588 commit 147a06d

File tree

24 files changed

+37
-33
lines changed

24 files changed

+37
-33
lines changed

test/addons/async-hello-world/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../../common');
33
var assert = require('assert');
4-
var binding = require('./build/Release/binding');
4+
const binding = require(`./build/${common.buildType}/binding`);
55

66
binding(5, common.mustCall(function(err, val) {
77
assert.equal(null, err);

test/addons/at-exit/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
2-
require('../../common');
3-
require('./build/Release/binding');
2+
const common = require('../../common');
3+
require(`./build/${common.buildType}/binding`);

test/addons/buffer-free-callback/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22
// Flags: --expose-gc
33

4-
require('../../common');
5-
var binding = require('./build/Release/binding');
4+
const common = require('../../common');
5+
const binding = require(`./build/${common.buildType}/binding`);
66

77
function check(size, alignment, offset) {
88
var buf = binding.alloc(size, alignment, offset);

test/addons/heap-profiler/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
require('../../common');
3+
const common = require('../../common');
44

5-
const binding = require('./build/Release/binding');
5+
const binding = require(`./build/${common.buildType}/binding`);
66

77
// Create an AsyncWrap object.
88
const timer = setTimeout(function() {}, 1);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
require('../../common');
2+
const common = require('../../common');
33
var assert = require('assert');
4-
var binding = require('./build/Release/binding');
4+
const binding = require(`./build/${common.buildType}/binding`);
55
assert.equal('world', binding());
66
console.log('binding.hello() =', binding());

test/addons/hello-world/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
require('../../common');
2+
const common = require('../../common');
33
var assert = require('assert');
4-
var binding = require('./build/Release/binding');
4+
const binding = require(`./build/${common.buildType}/binding`);
55
assert.equal('world', binding.hello());
66
console.log('binding.hello() =', binding.hello());

test/addons/load-long-path/test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ for (var i = 0; i < 10; i++) {
2121
fs.mkdirSync(addonDestinationDir);
2222
}
2323

24-
const addonPath = path.join(__dirname, 'build', 'Release', 'binding.node');
24+
const addonPath = path.join(__dirname,
25+
'build',
26+
common.buildType,
27+
'binding.node');
2528
const addonDestinationPath = path.join(addonDestinationDir, 'binding.node');
2629

2730
// Copy binary to long path destination

test/addons/make-callback-recurse/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const common = require('../../common');
44
const assert = require('assert');
55
const domain = require('domain');
6-
const binding = require('./build/Release/binding');
6+
const binding = require(`./build/${common.buildType}/binding`);
77
const makeCallback = binding.makeCallback;
88

99
// Make sure this is run in the future.

test/addons/make-callback/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const common = require('../../common');
44
const assert = require('assert');
55
const vm = require('vm');
6-
const binding = require('./build/Release/binding');
6+
const binding = require(`./build/${common.buildType}/binding`);
77
const makeCallback = binding.makeCallback;
88

99
assert.strictEqual(42, makeCallback(process, common.mustCall(function() {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
// Flags: --expose-gc
33

4-
require('../../common');
5-
var binding = require('./build/Release/binding');
4+
const common = require('../../common');
5+
const binding = require(`./build/${common.buildType}/binding`);
66

77
binding.run();

0 commit comments

Comments
 (0)