Permalink
Browse files

Add emma support

  • Loading branch information...
hpychan committed Sep 7, 2011
1 parent 74da6e6 commit 0c71eb942cdd44c40b0fd582740706454517b1de
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/vows/coverage/report-emma.js
@@ -104,25 +104,25 @@ this.report = function (coverageMap) {
buffer.push(tag('coverage', { type : 'class, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'method, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'block, %', value : '100% (1/1)'}, true) );
- buffer.push(tag('coverage', { type : 'line, %', value : (totalhits*1.0/totalsloc * 100.0) + '% ('+totalhits+'/'+totalsloc+')'}, true) );
+ buffer.push(tag('coverage', { type : 'line, %', value : (totalhits*1.0/totalsloc * 100.0).toFixed(2) + '% ('+totalhits+'/'+totalsloc+')'}, true) );
// package
buffer.push(tag('package', {name: '{root}'}, false));
buffer.push(tag('coverage', { type : 'class, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'method, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'block, %', value : '100% (1/1)'}, true) );
- buffer.push(tag('coverage', { type : 'line, %', value : (totalhits*1.0/totalsloc * 100.0) + '% ('+totalhits+'/'+totalsloc+')'}, true) );
+ buffer.push(tag('coverage', { type : 'line, %', value : (totalhits*1.0/totalsloc * 100.0).toFixed(2) + '% ('+totalhits+'/'+totalsloc+')'}, true) );
for ( var i = 0; i < output.coverage.length; i++) {
var sloc = output.coverage[i].sloc;
var hits = output.coverage[i].hits;
- var file = output.coverage[i].file;
+ var filename = output.coverage[i].file;
- buffer.push(tag('srcfile', { name : file }, false) );
+ buffer.push(tag('srcfile', { name : filename }, false) );
buffer.push(tag('coverage', { type : 'class, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'method, %', value : '100% (1/1)'}, true) );
buffer.push(tag('coverage', { type : 'block, %', value : '100% (1/1)'}, true) );
- buffer.push(tag('coverage', { type : 'line, %', value : (hits*1.0/sloc * 100.0) + '% ('+hits+'/'+sloc+')'}, true) );
+ buffer.push(tag('coverage', { type : 'line, %', value : (hits*1.0/sloc * 100.0).toFixed(2) + '% ('+hits+'/'+sloc+')'}, true) );
buffer.push(end('srcfile'));
}

0 comments on commit 0c71eb9

Please sign in to comment.