mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-29 09:34:58 +03:00
Run main process tests in test.js
This commit is contained in:
parent
3d71112d75
commit
976c8007b8
@ -11,22 +11,37 @@ 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
|
||||
]
|
||||
|
||||
function runCoreSpecs (callback) {
|
||||
console.log('Executing core specs...'.bold.green)
|
||||
function runCoreMainProcessTests (callback) {
|
||||
const testPath = path.join(CONFIG.repositoryRootPath, 'spec', 'main-process')
|
||||
const testArguments = [
|
||||
'--resource-path', resourcePath,
|
||||
'--test', '--main-process', testPath
|
||||
]
|
||||
|
||||
console.log('Executing core main process tests...'.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) {
|
||||
function runCoreRenderProcessTests (callback) {
|
||||
const testPath = path.join(CONFIG.repositoryRootPath, 'spec')
|
||||
const testArguments = [
|
||||
'--resource-path', resourcePath,
|
||||
'--test', testPath
|
||||
]
|
||||
|
||||
console.log('Executing core render process tests...'.bold.green)
|
||||
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit'})
|
||||
cp.on('error', error => { callback(error) })
|
||||
cp.on('close', exitCode => { callback(null, exitCode) })
|
||||
}
|
||||
|
||||
const testSuitesToRun = [runCoreMainProcessTests, runCoreRenderProcessTests]
|
||||
|
||||
async.parallelLimit(testSuitesToRun, 2, function (err, exitCodes) {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user