@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
-Fix summary output format for culture de-DE [#1263](https://github.com/coverlet-coverage/coverlet/issues/1263)
|
||||
-Fix branch coverage issue for finally block with await [#1233](https://github.com/coverlet-coverage/coverlet/issues/1233)
|
||||
-Fix threshold doesn't work when coverage empty [#1205](https://github.com/coverlet-coverage/coverlet/issues/1205)
|
||||
-Fix branch coverage issue for il switch [#1177](https://github.com/coverlet-coverage/coverlet/issues/1177)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -248,7 +249,7 @@ namespace Coverlet.Console
|
||||
var branchPercent = summary.CalculateBranchCoverage(_module.Value).Percent;
|
||||
var methodPercent = summary.CalculateMethodCoverage(_module.Value).Percent;
|
||||
|
||||
coverageTable.AddRow(Path.GetFileNameWithoutExtension(_module.Key), $"{linePercent}%", $"{branchPercent}%", $"{methodPercent}%");
|
||||
coverageTable.AddRow(Path.GetFileNameWithoutExtension(_module.Key), $"{InvariantFormat(linePercent)}%", $"{InvariantFormat(branchPercent)}%", $"{InvariantFormat(methodPercent)}%");
|
||||
}
|
||||
|
||||
logger.LogInformation(coverageTable.ToStringAlternative());
|
||||
@@ -257,8 +258,8 @@ namespace Coverlet.Console
|
||||
coverageTable.Rows.Clear();
|
||||
|
||||
coverageTable.AddColumn(new[] { "", "Line", "Branch", "Method" });
|
||||
coverageTable.AddRow("Total", $"{totalLinePercent}%", $"{totalBranchPercent}%", $"{totalMethodPercent}%");
|
||||
coverageTable.AddRow("Average", $"{averageLinePercent}%", $"{averageBranchPercent}%", $"{averageMethodPercent}%");
|
||||
coverageTable.AddRow("Total", $"{InvariantFormat(totalLinePercent)}%", $"{InvariantFormat(totalBranchPercent)}%", $"{InvariantFormat(totalMethodPercent)}%");
|
||||
coverageTable.AddRow("Average", $"{InvariantFormat(averageLinePercent)}%", $"{InvariantFormat(averageBranchPercent)}%", $"{InvariantFormat(averageMethodPercent)}%");
|
||||
|
||||
logger.LogInformation(coverageTable.ToStringAlternative());
|
||||
if (process.ExitCode > 0)
|
||||
@@ -314,5 +315,7 @@ namespace Coverlet.Console
|
||||
}
|
||||
|
||||
static string GetAssemblyVersion() => typeof(Program).Assembly.GetName().Version.ToString();
|
||||
|
||||
static string InvariantFormat(double value) => value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -206,7 +207,7 @@ namespace Coverlet.MSbuild.Tasks
|
||||
var branchPercent = summary.CalculateBranchCoverage(module.Value).Percent;
|
||||
var methodPercent = summary.CalculateMethodCoverage(module.Value).Percent;
|
||||
|
||||
coverageTable.AddRow(Path.GetFileNameWithoutExtension(module.Key), $"{linePercent}%", $"{branchPercent}%", $"{methodPercent}%");
|
||||
coverageTable.AddRow(Path.GetFileNameWithoutExtension(module.Key), $"{InvariantFormat(linePercent)}%", $"{InvariantFormat(branchPercent)}%", $"{InvariantFormat(methodPercent)}%");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
@@ -216,8 +217,8 @@ namespace Coverlet.MSbuild.Tasks
|
||||
coverageTable.Rows.Clear();
|
||||
|
||||
coverageTable.AddColumn(new[] { "", "Line", "Branch", "Method" });
|
||||
coverageTable.AddRow("Total", $"{totalLinePercent}%", $"{totalBranchPercent}%", $"{totalMethodPercent}%");
|
||||
coverageTable.AddRow("Average", $"{averageLinePercent}%", $"{averageBranchPercent}%", $"{averageMethodPercent}%");
|
||||
coverageTable.AddRow("Total", $"{InvariantFormat(totalLinePercent)}%", $"{InvariantFormat(totalBranchPercent)}%", $"{InvariantFormat(totalMethodPercent)}%");
|
||||
coverageTable.AddRow("Average", $"{InvariantFormat(averageLinePercent)}%", $"{InvariantFormat(averageBranchPercent)}%", $"{InvariantFormat(averageMethodPercent)}%");
|
||||
|
||||
Console.WriteLine(coverageTable.ToStringAlternative());
|
||||
|
||||
@@ -254,5 +255,7 @@ namespace Coverlet.MSbuild.Tasks
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string InvariantFormat(double value) => value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user