Browse Source

test: run tests even if os.cpus() fails

Currently if the os.cpus() call fails every test will fail. As there is
already a test for os.cpus(), the other tests should run even if the
os.cpus() call fails.

PR-URL: https://github.com/nodejs/node/pull/9616

Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6.x
Bethany Griggs 8 years ago
committed by Anna Henningsen
parent
commit
333e5d1c49
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 3
      test/common.js

3
test/common.js

@ -32,7 +32,8 @@ exports.isOSX = process.platform === 'darwin';
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */
const cpus = os.cpus();
exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999;
exports.enoughTestCpu = Array.isArray(cpus) &&
(cpus.length > 1 || cpus[0].speed > 999);
exports.rootDir = exports.isWindows ? 'c:\\' : '/';
exports.buildType = process.config.target_defaults.default_configuration;

Loading…
Cancel
Save