Skip to content

Commit e80ef26

Browse files
committed
Display a coverage summary after running dotnet test
Works around coverlet-coverage/coverlet#681
1 parent f8546ac commit e80ef26

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/Serilog.Formatting.Log4Net.Tests.csproj

+9-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<ItemGroup>
4141
<CoverletReport Include="$(VSTestResultsDirectory)/*/coverage.cobertura.xml" />
4242
</ItemGroup>
43-
<ReportGenerator ReportFiles="@(CoverletReport)" TargetDirectory="$(CoverageReportDirectory)" />
43+
<ReportGenerator ReportFiles="@(CoverletReport)" TargetDirectory="$(CoverageReportDirectory)" ReportTypes="Html;TextSummary" />
4444
</Target>
4545

4646
<!-- Because of https://github.com/microsoft/vstest/issues/2378 -->
@@ -55,6 +55,14 @@
5555
<RemoveDir Directories="@(CoverletReportParentDirectory)" />
5656
</Target>
5757

58+
<Target Name="DisplayCoverageSummary" AfterTargets="MoveCoverletReport">
59+
<PropertyGroup>
60+
<CatCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">cat</CatCommand>
61+
<CatCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">type</CatCommand>
62+
</PropertyGroup>
63+
<Exec WorkingDirectory="$(CoverageReportDirectory)" Command="$(CatCommand) Summary.txt" />
64+
</Target>
65+
5866
<Target Name="OpenHtmlCoverageReport" AfterTargets="MoveCoverletReport" Condition="$(ContinuousIntegrationBuild) != 'true'">
5967
<PropertyGroup>
6068
<OpenCommand Condition="$([MSBuild]::IsOSPlatform('Linux'))">xdg-open</OpenCommand>

0 commit comments

Comments
 (0)