mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[flutter_tools] add more info to coverage script (#64065)
Also output covered | total lines, and a summary percentage at the end + Kick tree
This commit is contained in:
parent
61362cff85
commit
f0dd4ad530
@ -38,10 +38,16 @@ void main(List<String> args) {
|
|||||||
final double rightPercent = right.testedLines / right.totalLines;
|
final double rightPercent = right.testedLines / right.totalLines;
|
||||||
return leftPercent.compareTo(rightPercent);
|
return leftPercent.compareTo(rightPercent);
|
||||||
});
|
});
|
||||||
|
double overallNumerator = 0;
|
||||||
|
double overallDenominator = 0;
|
||||||
|
print('% | tested | total');
|
||||||
for (final Coverage coverage in coverages) {
|
for (final Coverage coverage in coverages) {
|
||||||
|
overallNumerator += coverage.testedLines;
|
||||||
|
overallDenominator += coverage.totalLines;
|
||||||
final String coveragePercent = (coverage.testedLines / coverage.totalLines * 100).toStringAsFixed(2);
|
final String coveragePercent = (coverage.testedLines / coverage.totalLines * 100).toStringAsFixed(2);
|
||||||
print('${coverage.library}: $coveragePercent%');
|
print('${coverage.library}: $coveragePercent% | ${coverage.testedLines} | ${coverage.totalLines}');
|
||||||
}
|
}
|
||||||
|
print('OVERALL: ${overallNumerator/overallDenominator}');
|
||||||
}
|
}
|
||||||
|
|
||||||
class Coverage {
|
class Coverage {
|
||||||
|
Loading…
Reference in New Issue
Block a user