File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ private void CalculateCoverage()
93
93
{
94
94
foreach ( var result in _results )
95
95
{
96
+ if ( ! File . Exists ( result . HitsFilePath ) ) { continue ; }
96
97
var lines = File . ReadAllLines ( result . HitsFilePath ) ;
97
98
for ( int i = 0 ; i < lines . Length ; i ++ )
98
99
{
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ public CoverageSummary(CoverageResult result)
12
12
public CoverageSummaryResult CalculateSummary ( )
13
13
{
14
14
CoverageSummaryResult result = new CoverageSummaryResult ( ) ;
15
+ int totalModuleLines = 0 , moduleLinesCovered = 0 ;
16
+
15
17
foreach ( var mod in _result . Modules )
16
18
{
17
19
int totalLines = 0 , linesCovered = 0 ;
@@ -30,10 +32,11 @@ public CoverageSummaryResult CalculateSummary()
30
32
}
31
33
}
32
34
}
33
-
35
+ totalModuleLines += totalLines ;
36
+ moduleLinesCovered += linesCovered ;
34
37
result . Add ( System . IO . Path . GetFileNameWithoutExtension ( mod . Key ) , ( linesCovered * 100 ) / totalLines ) ;
35
38
}
36
-
39
+ result . Add ( "Covered" , ( moduleLinesCovered * 100 ) / totalModuleLines ) ;
37
40
return result ;
38
41
}
39
42
}
You can’t perform that action at this time.
0 commit comments