forked from bbyars/RestMvc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NCover.targets
57 lines (51 loc) · 2.53 KB
/
NCover.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NCoverDirectory>Dependencies\NCover</NCoverDirectory>
<NCoverExplorerDirectory>Dependencies\NCoverExplorer</NCoverExplorerDirectory>
<NCoverExplorerExtrasDirectory>Dependencies\NCoverExplorer.Extras</NCoverExplorerExtrasDirectory>
<CoverageFile>$(BuildDirectory)\ReleaseTestResults.xml</CoverageFile>
<CoverageReport>$(BuildDirectory)\$(ProjectName)-Coverage.html</CoverageReport>
<CoverageLog>$(BuildDirectory)\Coverage.log</CoverageLog>
<CoverageExclusions>
<CoverageExclusion>
<ExclusionType>Namespace</ExclusionType>
<Pattern>*.Tests</Pattern>
</CoverageExclusion>
</CoverageExclusions>
<NCoverExcludeAttributes>System.CodeDom.Compiler.GeneratedCodeAttribute</NCoverExcludeAttributes>
</PropertyGroup>
<ItemGroup>
<NCoverAssemblies Include="**\bin\$(Configuration)\RestMvc.dll;**\bin\$(Configuration)\Shaw.*.exe" />
</ItemGroup>
<UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCoverExplorer" AssemblyFile="$(NCoverExplorerExtrasDirectory)\NCoverExplorer.MSBuildTasks.dll" />
<UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCover" AssemblyFile="$(NCoverExplorerExtrasDirectory)\NCoverExplorer.MSBuildTasks.dll" />
<Target Name="Coverage" DependsOnTargets="Clean;Compile;RegisterNCover;RunCoverage;UnregisterNCover" />
<Target Name="RegisterNCover">
<Exec Command="regsvr32 /s coverlib.dll" WorkingDirectory="$(NCoverDirectory)" />
</Target>
<Target Name="UnregisterNCover">
<Exec Command="regsvr32 /u /s coverlib.dll" WorkingDirectory="$(NCoverDirectory)" />
</Target>
<Target Name="RunCoverage" DependsOnTargets="RegisterNCover">
<NCover
ToolPath="$(NCoverDirectory)"
CommandLineArgs="$(UnitTestProject)\bin\$(Configuration)\$(UnitTestProject).dll"
CommandLineExe="$(NUnitDirectory)\nunit-console-x86.exe"
CoverageFile="$(CoverageFile)"
WorkingDirectory="."
LogFile="$(CoverageLog)"
ExcludeAttributes="$(NCoverExcludeAttributes)"
AssemblyList="@(NCoverAssemblies)" />
<NCoverExplorer
ToolPath="$(NCoverExplorerDirectory)"
ProjectName="$(UnitTestProject)"
OutputDir="."
CoverageFiles="$(BuildDirectory)\*.xml"
SatisfactoryCoverage="80"
HtmlReportName="$(CoverageReport)"
ReportType="ModuleClassSummary"
Exclusions="$(CoverageExclusions)"
ShowExcluded="True" />
</Target>
</Project>