2016-07-29 18:42:56 +03:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
'use strict'
|
|
|
|
|
2016-07-29 21:00:34 +03:00
|
|
|
const async = require('async')
|
2016-07-29 18:42:56 +03:00
|
|
|
require('colors')
|
|
|
|
|
|
|
|
const path = require('path')
|
|
|
|
const childProcess = require('child_process')
|
|
|
|
const CONFIG = require('./config')
|
|
|
|
|
|
|
|
const packagedAppPath = path.resolve(__dirname, '..', 'out', 'Atom-darwin-x64')
|
|
|
|
const executablePath = path.join(packagedAppPath, 'Atom.app', 'Contents', 'MacOS', 'Atom')
|
|
|
|
|
|
|
|
const resourcePath = CONFIG.repositoryRootPath
|
|
|
|
const testPath = path.join(CONFIG.repositoryRootPath, 'spec')
|
|
|
|
const testArguments = [
|
|
|
|
'--resource-path', resourcePath,
|
|
|
|
'--test', testPath
|
|
|
|
]
|
|
|
|
|
2016-07-29 21:00:34 +03:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
})
|