Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,24 +726,40 @@ function runConsoleTests(defaultReporter, defaultSubsets) {
subsetRegexes = subsets.map(function (sub) { return "^" + sub + ".*$"; });
subsetRegexes.push("^(?!" + subsets.join("|") + ").*$");
}
var counter = subsetRegexes.length;
var errorStatus;
subsetRegexes.forEach(function (subsetRegex, i) {
tests = subsetRegex ? ' -g "' + subsetRegex + '"' : '';
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
console.log(cmd);
function finish() {
function finish(status) {
counter--;
// save first error status
if (status !== undefined && errorStatus === undefined) {
errorStatus = status;
}

deleteTemporaryProjectOutput();
complete();
if (counter !== 0 || errorStatus === undefined) {
// run linter when last worker is finished
if (lintFlag && counter === 0) {
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
});
lint.invoke();
}
complete();
}
else {
fail("Process exited with code " + status);
}
}
exec(cmd, function () {
if (lintFlag && i === 0) {
var lint = jake.Task['lint'];
lint.addListener('complete', function () {
complete();
});
lint.invoke();
}
finish();
}, finish);
}, function(e, status) {
finish(status);
});
});
}

Expand Down