added totals to console coverage report
This commit is contained in:
parent
9f77bdb0b6
commit
a57c690dc5
@ -9,8 +9,11 @@
|
||||
|
||||
public static function createConsoleReport(array $coverageData) {
|
||||
$coverageData = CoverageFilter::filter($coverageData);
|
||||
echo "\nCode coverage information:\n\n";
|
||||
//print_r($coverageData);
|
||||
fwrite(STDOUT, "\nCode coverage information:\n\n");
|
||||
|
||||
$totloc = 0;
|
||||
$totdloc = 0;
|
||||
$totcloc = 0;
|
||||
foreach ($coverageData as $file => $data) {
|
||||
fwrite(STDOUT, $file . "\n");
|
||||
$loc = 0;
|
||||
@ -29,7 +32,17 @@
|
||||
fwrite(STDOUT, " Covered: $cloc\n");
|
||||
fwrite(STDOUT, " Dead: $dloc\n");
|
||||
fwrite(STDOUT, " Executable: $loc (" . round($cloc / $loc * 100, 2) . "%)\n");
|
||||
|
||||
$totloc += $loc;
|
||||
$totdloc += $dloc;
|
||||
$totcloc += $cloc;
|
||||
}
|
||||
|
||||
fwrite(STDOUT, "\n\n");
|
||||
fwrite(STDOUT, "Totals:\n");
|
||||
fwrite(STDOUT, " Covered: $totcloc\n");
|
||||
fwrite(STDOUT, " Dead: $totdloc\n");
|
||||
fwrite(STDOUT, " Executable: $totloc (" . round($totcloc / $totloc * 100, 2) . "%)\n");
|
||||
}
|
||||
|
||||
public static function createXmlReport($file, array $coverageData) {
|
||||
@ -42,6 +55,14 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
$coverageData = CoverageFilter::filter($coverageData);
|
||||
foreach ($coverageData as $file => $data) {
|
||||
foreach ($data as $unitsCovered) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user