Skip to content

Commit 10b6d3a

Browse files
committed
Upgrade OpenCover and ReportGenerator, parameterize OpenCover to build
Now one can run coverage with open cover using -D:test.coverage.tool=opencover
1 parent adb3498 commit 10b6d3a

13 files changed

+311
-30
lines changed

Spring.build

+15-9
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Commandline Examples:
139139
<property name="project.build.sign" value="false" overwrite="false" />
140140

141141
<property name="test.withcoverage" value="false" overwrite="true" />
142+
<!-- what coverage tool to use: ncover or opencover -->
143+
<property name="test.coverage.tool" value="ncover" overwrite="false" />
142144

143145
<!-- import non-redistributables if available -->
144146
<!-- to build certain libraries (e.g. Spring.Messaging.Ems), 3rd party libraries are required
@@ -454,15 +456,19 @@ Commandline Examples:
454456
<!-- Main solutions and examples are compiled via task build-solutions -->
455457

456458
<!-- build coverage summary -->
457-
<exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false">
458-
<arg value="/xml:&quot;${current.bin.dir}/TestCoverageSummary.xml&quot;" />
459-
<arg value="/report:ModuleClassFunctionSummary" />
460-
<arg value="/sort:4" />
461-
<arg value="/minCoverage:80" />
462-
<arg value="/q" />
463-
<arg path="${current.bin.dir}/*-TestCoverage.xml" />
464-
</exec>
465-
459+
<exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false" if="${test.coverage.tool == 'ncover' and test.withcoverage}">
460+
<arg value="/xml:&quot;${current.bin.dir}/TestCoverageSummary.xml&quot;" />
461+
<arg value="/report:ModuleClassFunctionSummary" />
462+
<arg value="/sort:4" />
463+
<arg value="/minCoverage:80" />
464+
<arg value="/q" />
465+
<arg path="${current.bin.dir}/*-TestCoverage.xml" />
466+
</exec>
467+
468+
<exec program="${tool.dir}\ReportGenerator\bin\ReportGenerator.exe" workingdir="${current.bin.dir}" verbose="true" if="${test.coverage.tool == 'opencover' and test.withcoverage}">
469+
<arg value="*-TestCoverage.xml" />
470+
<arg path="${current.bin.dir}\CoverageReport\Summary" />
471+
</exec>
466472
</target>
467473

468474
<target name="compile-net-3.5" description="Builds .NET Framework 3.5 version"

build-support/tools/OpenCover/License.rtf

+166
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<configSections>
4+
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
5+
</configSections>
6+
7+
<log4net>
8+
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
9+
<mapping>
10+
<level value="ERROR" />
11+
<foreColor value="White" />
12+
<backColor value="Red, HighIntensity" />
13+
</mapping>
14+
<mapping>
15+
<level value="DEBUG" />
16+
<backColor value="Green" />
17+
</mapping>
18+
<layout type="log4net.Layout.PatternLayout">
19+
<conversionPattern value="%message%newline" />
20+
</layout>
21+
</appender>
22+
23+
<root>
24+
<appender-ref ref="ColoredConsoleAppender" />
25+
</root>
26+
27+
</log4net>
28+
29+
</configuration>
282 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

build-support/tools/ReportGenerator/bin/Readme.txt

+99-20
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,31 @@
1212
DESCRIPTION
1313

1414
ReportGenerator converts XML reports generated by PartCover, OpenCover
15-
or NCover into a readable HTML report.
16-
In contrast to the XSLT-Transformation included in PartCover, the
17-
report is more detailed.
18-
It does not only show the coverage quota, but also includes the source
19-
code and visualizes which line has been covered.
15+
or NCover into a readable report in various formats.
16+
The reports do not only show the coverage quota, but also include the
17+
source code and visualize which line has been covered.
2018

2119
ReportGenerator supports merging several reports into one.
22-
If you pass several reports to ReportGenerator, the reports will be
23-
merged into one.
2420
It is also possible to pass one XML file containing several reports to
2521
ReportGenerator (e.g. a build log file).
2622

27-
Several output formats are supported by ReportGenerator. The following
28-
report types can be generated:
23+
The following output formats are supported by ReportGenerator:
2924

3025
-HTML, HTMLSummary
3126
-XML, XMLSummary
3227
-Latex, LatexSummary
3328

34-
=======================================================================
35-
36-
COMPATIBILITY
29+
Compatibility:
3730

3831
OpenCover
3932
PartCover 4.0
4033
PartCover 2.2, 2.3
34+
Visual Studio
4135
NCover (tested version 1.5.8, other versions may not work)
4236

37+
Also available as NuGet package:
38+
http://nuget.org/List/Packages/ReportGenerator
39+
4340
=======================================================================
4441

4542
LICENSE
@@ -54,6 +51,95 @@ For further details take a look at LICENSE.txt.
5451

5552
CHANGELOG
5653

54+
1.7.1.0
55+
56+
* Fix: Issue #9706: Trailing slashes in command line arguments
57+
58+
1.7.0.0
59+
60+
* New: Issue #9698: Added "coverbytest" support of OpenCover
61+
* Fix: Issue #9671: Reduced length of report filenames
62+
* Fix: Reports can now be located in an UNC path
63+
64+
1.6.1.0
65+
66+
* Fix: Issue #9646: Unhandled IO-Exception when source directories
67+
are supplied
68+
69+
1.6.0.0
70+
71+
* New: Added support for Visual Studio coverage reports
72+
* New: Issue #9534: Added support for wildcards in report file
73+
pattern
74+
* Fix: OpenCoverParser supports coverage for methods that 'yield'
75+
the result
76+
77+
1.5.0.0
78+
79+
* Fix: Improved merging of metrics (now using full signature)
80+
* Fix: Reduced memory usage during report generation
81+
82+
1.4.1.0
83+
84+
* New: Added verbosity switch
85+
* New: Added possibility to generate several output formats at once
86+
87+
1.4.0.0
88+
89+
* Fix: Issue #9372: Reduced memory usage
90+
91+
1.3.0.0
92+
93+
* New: Added more report preprocessing to deal with auto properties
94+
and source files that don't appear in OpenCover/PartCover
95+
reports
96+
* New: Added possibility to filter assemblies
97+
98+
1.2.7.0
99+
100+
* Fix: Issue #9266: Improved performance
101+
102+
1.2.6.0
103+
104+
* Fix: Issue #9141: Handling of same assembly in different
105+
directories in OpenCoverParser
106+
107+
1.2.5.0
108+
109+
* New: Excluded ignored classes from OpenCoverParser
110+
111+
1.2.4.0
112+
113+
* Fix: Issue #9065: Rounding of coverage quota down to the last
114+
significant figure
115+
* Fix: Issue #9041: Merging reports doesn't work when the same
116+
module is used from different paths
117+
118+
1.2.3.0
119+
120+
* Fix: Issue #8992: Improved HTML Summary (collapsing of classes)
121+
122+
1.2.2.0
123+
124+
* Fix: Issue #8931: Improved layout of Html reports
125+
* Fix: Issue #8958: Coverage for types with no sequence points
126+
* Fix: Issue #8936: Additional statistics for assemblies
127+
128+
1.2.1.0
129+
130+
* Fix: Issue #8653: NCover - OutOfMemoryException on a seqpoint with
131+
a magic line
132+
* Fix: Improved layout of Latex reports
133+
134+
1.2.0.0
135+
136+
* New: Added support for OpenCover metrics
137+
* New: Added support for AutoProperties in OpenCover/PartCover
138+
139+
1.1.1.0
140+
141+
* Fix: Reports now saved with more unique filename
142+
57143
1.1.0.0
58144

59145
* New: Added support for OpenCover
@@ -112,11 +198,4 @@ CHANGELOG
112198

113199
0.1.0.0
114200

115-
* New: Initial release
116-
117-
=======================================================================
118-
119-
KNOWN ISSUES
120-
121-
The reports generated by PartCover do not contain enough information to
122-
correctly get the coverage of 'Auto Properties'.
201+
* New: Initial release
Binary file not shown.
Binary file not shown.

common-project.include

+2-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ ${test.withcoverage}: flag indicating whether to invoke tests with test-coverage
191191
</if>
192192

193193
<if test="${test.withcoverage}" >
194-
<call target="common.run-tests.ncover" />
194+
<call target="common.run-tests.ncover" if="${test.coverage.tool == 'ncover'}" />
195+
<call target="common.run-tests.opencover" if="${test.coverage.tool == 'opencover'}" />
195196
</if>
196197

197198
</target>

0 commit comments

Comments
 (0)