Skip to content

Commit

Permalink
[minor] Nicer output from test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Dec 18, 2011
1 parent 38bd906 commit 5c3d41b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/core/run
Expand Up @@ -45,8 +45,9 @@ function runTest(test, callback) {
child.on('exit', function (exitCode) {
clearTimeout(killTimeout);

console.log(' ' + ((exitCode) ? '✘'.red : '✔'.green) + ' ' +
path.basename(test) + (exitCode && ' (exit code: ' + exitCode + ')'));
console.log(' ' + ((exitCode) ? '✘'.red : '✔'.green) + ' ' +
path.basename(test) +
(exitCode ? (' (exit code: ' + exitCode + ')') : ''));
results[test] = { exitCode: exitCode };
callback();
//
Expand All @@ -68,13 +69,14 @@ if (!tests.length) {
//
}

console.log('Running tests:'.bold);
async.forEachSeries(tests, runTest, function () {
var failed = [], ok = [];
for (var test in results) {
(results[test].exitCode != 0 ? failed : ok).push(test);
}

console.log('\nSummary:');
console.log('\nSummary:'.bold);
console.log((' ' + ok.length + '\tpassed tests').green);
console.log((' ' + failed.length + '\tfailed tests').red);
});
Expand Down

0 comments on commit 5c3d41b

Please sign in to comment.