diff --git a/build/package.json b/build/package.json index 141f64652..9c72e4a0c 100644 --- a/build/package.json +++ b/build/package.json @@ -2,6 +2,7 @@ "name": "atom-build-scripts", "description": "Atom build scripts", "dependencies": { + "async": "^2.0.1", "babel-core": "5.8.38", "coffee-script": "1.8.0", "colors": "1.1.2", diff --git a/build/test.js b/build/test.js index 046d0bb05..e1277b827 100755 --- a/build/test.js +++ b/build/test.js @@ -2,6 +2,7 @@ 'use strict' +const async = require('async') require('colors') const path = require('path') @@ -18,6 +19,19 @@ const testArguments = [ '--test', testPath ] -console.log('Executing core specs...'.bold.green) -const exitStatus = childProcess.spawnSync(executablePath, testArguments, {stdio: 'inherit'}).status -process.exit(exitStatus) +function runCoreSpecs (callback) { + console.log('Executing core specs...'.bold.green) + const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit'}) + cp.on('error', error => { callback(error) }) + cp.on('close', exitCode => { callback(null, exitCode) }) +} + +async.parallelLimit([runCoreSpecs], 2, function (err, exitCodes) { + if (err) { + console.error(err) + process.exit(1) + } else { + const testsPassed = exitCodes.every(exitCode => exitCode === 0) + process.exit(testsPassed ? 0 : 1) + } +})