summaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2018-12-05 14:37:59 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-12-21 20:43:07 -0500
commit9e5c7c5358bac3dc0890cf00848704dad47ad1ba (patch)
tree0a619d80df2149e2005e2b06cb0773c3ebbe53bb /pom.xml
parentccc21c7d4abf3ec893591b1348cfb5e7932c9d6a (diff)
downloadjgit-9e5c7c5358bac3dc0890cf00848704dad47ad1ba.tar.gz
jgit-9e5c7c5358bac3dc0890cf00848704dad47ad1ba.zip
Capture test coverage and add an aggregate test coverage report
Configure Maven build to capture test coverage using jacoco. Add new org.eclipse.jgit.coverage Maven module to aggregate jacoco test coverage results and generate test coverage HTML report at org.eclipse.jgit.coverage/target/site/jacoco-aggregate/index.html See https://www.eclemma.org/jacoco/trunk/doc/maven.html Change-Id: Iaeec4033e448ebc16965c05ab54109c4155a307a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml56
1 files changed, 55 insertions, 1 deletions
diff --git a/pom.xml b/pom.xml
index c3b92b7aa5..cf875f1460 100644
--- a/pom.xml
+++ b/pom.xml
@@ -211,7 +211,7 @@
<!-- Properties to enable jacoco code coverage analysis -->
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
- <sonar.jacoco.reportPath>../target/jacoco.exec</sonar.jacoco.reportPath>
+ <sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
</properties>
<repositories>
@@ -297,6 +297,7 @@
<configuration>
<forkCount>${test-fork-count}</forkCount>
<reuseForks>true</reuseForks>
+ <argLine>@{argLine}</argLine>
</configuration>
</plugin>
@@ -498,6 +499,7 @@
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
+ <id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
@@ -512,6 +514,38 @@
<append>true</append>
</configuration>
</execution>
+ <execution>
+ <id>default-report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <haltOnFailure>false</haltOnFailure>
+ <rules>
+ <rule>
+ <element>BUNDLE</element>
+ <limits>
+ <limit>
+ <counter>INSTRUCTION</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>50%</minimum>
+ </limit>
+ <limit>
+ <counter>CLASS</counter>
+ <value>MISSEDCOUNT</value>
+ <maximum>10</maximum>
+ </limit>
+ </limits>
+ </rule>
+ </rules>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
@@ -589,6 +623,24 @@
</reportSet>
</reportSets>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>report</report>
+ </reports>
+ </reportSet>
+ <reportSet>
+ <id>aggregate</id>
+ <inherited>false</inherited>
+ <reports>
+ <report>report-aggregate</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
</plugins>
</reporting>
@@ -938,6 +990,8 @@
<module>org.eclipse.jgit.lfs.test</module>
<module>org.eclipse.jgit.lfs.server.test</module>
<module>org.eclipse.jgit.ssh.apache.test</module>
+
+ <module>org.eclipse.jgit.coverage</module>
</modules>
</project>