Permalink
Browse files

Upgrade OpenCover and ReportGenerator, parameterize OpenCover to build

Now one can run coverage with open cover using -D:test.coverage.tool=opencover
  • Loading branch information...
1 parent adb3498 commit 10b6d3a7473a185e4ea3eba94f9cd7769e91e414 @lahma lahma committed Jan 13, 2013
View
@@ -139,6 +139,8 @@ Commandline Examples:
<property name="project.build.sign" value="false" overwrite="false" />
<property name="test.withcoverage" value="false" overwrite="true" />
+ <!-- what coverage tool to use: ncover or opencover -->
+ <property name="test.coverage.tool" value="ncover" overwrite="false" />
<!-- import non-redistributables if available -->
<!-- to build certain libraries (e.g. Spring.Messaging.Ems), 3rd party libraries are required
@@ -454,15 +456,19 @@ Commandline Examples:
<!-- Main solutions and examples are compiled via task build-solutions -->
<!-- build coverage summary -->
- <exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false">
- <arg value="/xml:&quot;${current.bin.dir}/TestCoverageSummary.xml&quot;" />
- <arg value="/report:ModuleClassFunctionSummary" />
- <arg value="/sort:4" />
- <arg value="/minCoverage:80" />
- <arg value="/q" />
- <arg path="${current.bin.dir}/*-TestCoverage.xml" />
- </exec>
-
+ <exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false" if="${test.coverage.tool == 'ncover' and test.withcoverage}">
+ <arg value="/xml:&quot;${current.bin.dir}/TestCoverageSummary.xml&quot;" />
+ <arg value="/report:ModuleClassFunctionSummary" />
+ <arg value="/sort:4" />
+ <arg value="/minCoverage:80" />
+ <arg value="/q" />
+ <arg path="${current.bin.dir}/*-TestCoverage.xml" />
+ </exec>
+
+ <exec program="${tool.dir}\ReportGenerator\bin\ReportGenerator.exe" workingdir="${current.bin.dir}" verbose="true" if="${test.coverage.tool == 'opencover' and test.withcoverage}">
+ <arg value="*-TestCoverage.xml" />
+ <arg path="${current.bin.dir}\CoverageReport\Summary" />
+ </exec>
</target>
<target name="compile-net-3.5" description="Builds .NET Framework 3.5 version"

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
+ </configSections>
+
+ <log4net>
+ <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
+ <mapping>
+ <level value="ERROR" />
+ <foreColor value="White" />
+ <backColor value="Red, HighIntensity" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <backColor value="Green" />
+ </mapping>
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%message%newline" />
+ </layout>
+ </appender>
+
+ <root>
+ <appender-ref ref="ColoredConsoleAppender" />
+ </root>
+
+ </log4net>
+
+</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,34 +12,31 @@
DESCRIPTION
ReportGenerator converts XML reports generated by PartCover, OpenCover
-or NCover into a readable HTML report.
-In contrast to the XSLT-Transformation included in PartCover, the
-report is more detailed.
-It does not only show the coverage quota, but also includes the source
-code and visualizes which line has been covered.
+or NCover into a readable report in various formats.
+The reports do not only show the coverage quota, but also include the
+source code and visualize which line has been covered.
ReportGenerator supports merging several reports into one.
-If you pass several reports to ReportGenerator, the reports will be
-merged into one.
It is also possible to pass one XML file containing several reports to
ReportGenerator (e.g. a build log file).
-Several output formats are supported by ReportGenerator. The following
-report types can be generated:
+The following output formats are supported by ReportGenerator:
-HTML, HTMLSummary
-XML, XMLSummary
-Latex, LatexSummary
-=======================================================================
-
-COMPATIBILITY
+Compatibility:
OpenCover
PartCover 4.0
PartCover 2.2, 2.3
+Visual Studio
NCover (tested version 1.5.8, other versions may not work)
+Also available as NuGet package:
+http://nuget.org/List/Packages/ReportGenerator
+
=======================================================================
LICENSE
@@ -54,6 +51,95 @@ For further details take a look at LICENSE.txt.
CHANGELOG
+1.7.1.0
+
+ * Fix: Issue #9706: Trailing slashes in command line arguments
+
+1.7.0.0
+
+ * New: Issue #9698: Added "coverbytest" support of OpenCover
+ * Fix: Issue #9671: Reduced length of report filenames
+ * Fix: Reports can now be located in an UNC path
+
+1.6.1.0
+
+ * Fix: Issue #9646: Unhandled IO-Exception when source directories
+ are supplied
+
+1.6.0.0
+
+ * New: Added support for Visual Studio coverage reports
+ * New: Issue #9534: Added support for wildcards in report file
+ pattern
+ * Fix: OpenCoverParser supports coverage for methods that 'yield'
+ the result
+
+1.5.0.0
+
+ * Fix: Improved merging of metrics (now using full signature)
+ * Fix: Reduced memory usage during report generation
+
+1.4.1.0
+
+ * New: Added verbosity switch
+ * New: Added possibility to generate several output formats at once
+
+1.4.0.0
+
+ * Fix: Issue #9372: Reduced memory usage
+
+1.3.0.0
+
+ * New: Added more report preprocessing to deal with auto properties
+ and source files that don't appear in OpenCover/PartCover
+ reports
+ * New: Added possibility to filter assemblies
+
+1.2.7.0
+
+ * Fix: Issue #9266: Improved performance
+
+1.2.6.0
+
+ * Fix: Issue #9141: Handling of same assembly in different
+ directories in OpenCoverParser
+
+1.2.5.0
+
+ * New: Excluded ignored classes from OpenCoverParser
+
+1.2.4.0
+
+ * Fix: Issue #9065: Rounding of coverage quota down to the last
+ significant figure
+ * Fix: Issue #9041: Merging reports doesn't work when the same
+ module is used from different paths
+
+1.2.3.0
+
+ * Fix: Issue #8992: Improved HTML Summary (collapsing of classes)
+
+1.2.2.0
+
+ * Fix: Issue #8931: Improved layout of Html reports
+ * Fix: Issue #8958: Coverage for types with no sequence points
+ * Fix: Issue #8936: Additional statistics for assemblies
+
+1.2.1.0
+
+ * Fix: Issue #8653: NCover - OutOfMemoryException on a seqpoint with
+ a magic line
+ * Fix: Improved layout of Latex reports
+
+1.2.0.0
+
+ * New: Added support for OpenCover metrics
+ * New: Added support for AutoProperties in OpenCover/PartCover
+
+1.1.1.0
+
+ * Fix: Reports now saved with more unique filename
+
1.1.0.0
* New: Added support for OpenCover
@@ -112,11 +198,4 @@ CHANGELOG
0.1.0.0
- * New: Initial release
-
-=======================================================================
-
-KNOWN ISSUES
-
-The reports generated by PartCover do not contain enough information to
-correctly get the coverage of 'Auto Properties'.
+ * New: Initial release
Binary file not shown.
Binary file not shown.
View
@@ -191,7 +191,8 @@ ${test.withcoverage}: flag indicating whether to invoke tests with test-coverage
</if>
<if test="${test.withcoverage}" >
- <call target="common.run-tests.ncover" />
+ <call target="common.run-tests.ncover" if="${test.coverage.tool == 'ncover'}" />
+ <call target="common.run-tests.opencover" if="${test.coverage.tool == 'opencover'}" />
</if>
</target>

0 comments on commit 10b6d3a

Please sign in to comment.