Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tmpvar/mjsunit.runner
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpvar committed May 4, 2010
2 parents d44182f + 920f030 commit 1efe39e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ exports.run = function(testSuites) {
}

if (args.json) {
sys.puts(JSON.stringify({
process.stdio.write(JSON.stringify({
total: total,
pass: total-errors.length,
fail: errors.length
Expand All @@ -108,7 +108,7 @@ exports.run = function(testSuites) {
for (var i = 0; i<errors.length; i++)
{
sys.puts('\nFailure in ' + errors[i].suiteName + ' suite; method: ' + errors[i].method);
sys.puts(errors[i].error.stack);
sys.puts(errors[i].error.stack || errors[i].error.message);
}
}

Expand All @@ -117,30 +117,30 @@ exports.run = function(testSuites) {
sys.puts(errors.length + " of " + total + " failed (" + Math.floor(((total-errors.length)/total)*100) + "% success)" );
sys.puts(" ");
} else {
var numerator, denominator, percent;
sys.puts("");

var padName = function(name) {
while(name.length < 13) {
name+=" ";
}
return name;
}
var numerator, denominator, percent;
sys.puts("");
var padName = function(name) {
while(name.length < 13) {
name+=" ";
}
return name;
};

for (var suiteName in testSuites)
{
if (testSuites.hasOwnProperty(suiteName)) {
numerator = testSuites[suiteName].total - testSuites[suiteName].errors.length;
denominator = testSuites[suiteName].total;
percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts(padName(suiteName) + "\t" + numerator + "/" + denominator + "\t\t" + percent + "% passing");
for (var suiteName in testSuites)
{
if (testSuites.hasOwnProperty(suiteName)) {
numerator = testSuites[suiteName].total - testSuites[suiteName].errors.length;
denominator = testSuites[suiteName].total;
percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts(padName(suiteName) + "\t" + numerator + "/" + denominator + "\t\t" + percent + "% passing");
}
}
}

sys.puts("--------------------------------------------");
numerator = total-errors.length;
denominator = total;
percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts("TOTALS:\t\t" + numerator + "/" + denominator + "\t" + percent + "% passing\r\n");
sys.puts("--------------------------------------------");
numerator = total-errors.length;
denominator = total;
percent = Math.floor((numerator / denominator)*100) || 0;
sys.puts("TOTALS:\t\t" + numerator + "/" + denominator + "\t" + percent + "% passing\r\n");
}
};

0 comments on commit 1efe39e

Please sign in to comment.