mirror of
https://github.com/nodejs/node.git
synced 2025-08-18 07:08:50 +02:00
test: fix test suite to work with npm 7
PR-URL: https://github.com/nodejs/node/pull/35474 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
2e54524955
commit
c87641aa97
4 changed files with 12 additions and 35 deletions
2
Makefile
2
Makefile
|
@ -1384,7 +1384,7 @@ CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
|
|||
|
||||
# Related CI job: node-test-linter
|
||||
lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs
|
||||
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
|
||||
@if ! ( grep -IEqrs "$(CONFLICT_RE)" --exclude="error-message.js" benchmark deps doc lib src test tools ) \
|
||||
&& ! ( $(FIND) . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \
|
||||
exit 0 ; \
|
||||
else \
|
||||
|
|
|
@ -12,8 +12,16 @@ const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
|
|||
console.log('process.dlopen:', bindingPath);
|
||||
process.dlopen(module, bindingPath,
|
||||
os.constants.dlopen.RTLD_NOW | os.constants.dlopen.RTLD_GLOBAL);
|
||||
console.log('module.exports.load:', `${path.dirname(bindingPath)}/ping.so`);
|
||||
module.exports.load(`${path.dirname(bindingPath)}/ping.so`);
|
||||
|
||||
let pingSOPath = `${path.dirname(bindingPath)}/lib.target/ping.so`;
|
||||
|
||||
if (common.isOSX) {
|
||||
pingSOPath = `${path.dirname(bindingPath)}/ping.so`;
|
||||
}
|
||||
|
||||
console.log('module.exports.load:', pingSOPath);
|
||||
module.exports.load(pingSOPath);
|
||||
|
||||
assert.strictEqual(module.exports.ping(), 'pong');
|
||||
|
||||
// Check that after the addon is loaded with
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
// Notarization on macOS requires all binaries to be signed.
|
||||
// We sign our own binaries but check here if any binaries from our dependencies
|
||||
// (e.g. npm) are signed.
|
||||
const common = require('../common');
|
||||
|
||||
if (!common.isOSX) {
|
||||
common.skip('macOS specific test');
|
||||
}
|
||||
|
||||
const assert = require('assert');
|
||||
const { spawnSync } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
const debuglog = require('util').debuglog('test');
|
||||
|
||||
const binaries = [
|
||||
'deps/npm/node_modules/term-size/vendor/macos/term-size',
|
||||
];
|
||||
|
||||
for (const testbin of binaries) {
|
||||
const bin = path.resolve(__dirname, '..', '..', testbin);
|
||||
debuglog(`Checking ${bin}`);
|
||||
const cp = spawnSync('codesign', [ '-vvvv', bin ], { encoding: 'utf8' });
|
||||
debuglog(cp.stdout);
|
||||
debuglog(cp.stderr);
|
||||
assert.strictEqual(cp.signal, null);
|
||||
assert.strictEqual(cp.status, 0, `${bin} does not appear to be signed.\n` +
|
||||
`${cp.stdout}\n${cp.stderr}`);
|
||||
}
|
|
@ -14,5 +14,5 @@ const npmPathPackageJson = path.resolve(
|
|||
);
|
||||
|
||||
const pkg = require(npmPathPackageJson);
|
||||
assert(pkg.version.match(/^\d+\.\d+\.\d+$/),
|
||||
assert(pkg.version.match(/^\d+\.\d+\.\d+-rc\.\d+$/),
|
||||
`unexpected version number: ${pkg.version}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue