File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ private void CalculateCoverage()
9393 {
9494 foreach ( var result in _results )
9595 {
96+ if ( ! File . Exists ( result . HitsFilePath ) ) { continue ; }
9697 var lines = File . ReadAllLines ( result . HitsFilePath ) ;
9798 for ( int i = 0 ; i < lines . Length ; i ++ )
9899 {
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ public CoverageSummary(CoverageResult result)
1212 public CoverageSummaryResult CalculateSummary ( )
1313 {
1414 CoverageSummaryResult result = new CoverageSummaryResult ( ) ;
15+ int totalModuleLines = 0 , moduleLinesCovered = 0 ;
16+
1517 foreach ( var mod in _result . Modules )
1618 {
1719 int totalLines = 0 , linesCovered = 0 ;
@@ -30,10 +32,11 @@ public CoverageSummaryResult CalculateSummary()
3032 }
3133 }
3234 }
33-
35+ totalModuleLines += totalLines ;
36+ moduleLinesCovered += linesCovered ;
3437 result . Add ( System . IO . Path . GetFileNameWithoutExtension ( mod . Key ) , ( linesCovered * 100 ) / totalLines ) ;
3538 }
36-
39+ result . Add ( "Covered" , ( moduleLinesCovered * 100 ) / totalModuleLines ) ;
3740 return result ;
3841 }
3942 }
You can’t perform that action at this time.
0 commit comments