Skip to content

Commit

Permalink
Hook coverlet up to the 'RunTests' target
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Mar 8, 2019
1 parent 562722b commit 2b214bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
<ExcludeByFile />
</PropertyGroup>

<!-- Make sure coverage targets are defined even in projects where coverlet is not installed -->
<Target Name="InstrumentModulesAfterBuild" />
<Target Name="GenerateCoverageResult" />

</Project>
9 changes: 9 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsPackageVersion)" />
</ItemGroup>

<Target Name="InstrumentModulesNoBuildBeforeTest" Condition="'$(CollectCoverage)' == 'true'" BeforeTargets="RunTests">
<CallTarget Targets="InstrumentModulesAfterBuild" />
</Target>

<Target Name="GenerateCoverageResultAfterTest" Condition="'$(CollectCoverage)' == 'true'" AfterTargets="RunTests">
<CallTarget Targets="GenerateCoverageResult" />
</Target>

</Project>

0 comments on commit 2b214bc

Please sign in to comment.