Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit ffa3166

Browse files
dkrutskikhcbracken
authored andcommitted
Enhance LCOV formatter (#215)
Add number of instrumented lines 'LF' and number of lines with a non-zero execution count 'LH'
1 parent af4c5bd commit ffa3166

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/src/formatter.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ class LcovFormatter implements Formatter {
5050
}
5151

5252
buf.write('SF:$source\n');
53-
v.keys.toList()
54-
..sort()
55-
..forEach((int k) {
56-
buf.write('DA:$k,${v[k]}\n');
57-
});
53+
final lines = v.keys.toList()..sort();
54+
lines.forEach((int k) {
55+
buf.write('DA:$k,${v[k]}\n');
56+
});
57+
buf.write('LF:${lines.length}\n');
58+
buf.write('LH:${lines.where((k) => v[k] > 0).length}\n');
5859
buf.write('end_of_record\n');
5960
}
6061

0 commit comments

Comments
 (0)