Author: dgolovin
Date: 2012-01-17 16:59:15 -0500 (Tue, 17 Jan 2012)
New Revision: 37918
Modified:
trunk/build/parent/pom.xml
Log:
https://issues.jboss.org/browse/JBDS-1876 emma code coverage in overall
jbosstools-3.3_trunk.soa-tooling.tests fails to find org.eclipse.bpel.* sources; cannot do
coverage report so builds fail
eclemma gather coverage data only for loaded classes, which means final coverage statistic
is usually higher that real coverage, because it dosen't consider classes that that
wasn't loaded during test. To get real coverage for all classes metadata should be
generated manually for plugins included in coverage report. Now it is not possible for
plugins that are outside component codebase and are not part of the build.
I fixed error by skipping metadata generation for unreachable plugins, but it means
coverage report shows coverage results higher then they really are.
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-01-17 20:56:23 UTC (rev 37917)
+++ trunk/build/parent/pom.xml 2012-01-17 21:59:15 UTC (rev 37918)
@@ -547,11 +547,9 @@
<version>${tychoVersion}</version>
<configuration>
<systemProperties combine.children="append">
- <emma.session.out.file>${emma.session.out.file}
- </emma.session.out.file>
+ <emma.session.out.file>${emma.session.out.file}</emma.session.out.file>
<emma.filter>${emma.filter}</emma.filter>
- <eclemma.instrument.bundles>${emma.instrument.bundles}
- </eclemma.instrument.bundles>
+ <eclemma.instrument.bundles>${emma.instrument.bundles}</eclemma.instrument.bundles>
</systemProperties>
<frameworkExtensions>
<frameworkExtension>
@@ -617,17 +615,25 @@
<sequential>
<property name="@{bundle}-classes"
location="${project.build.directory}/../../../plugins/@{bundle}"
/>
- <echo>instruments ${@{bundle}-classes}</echo>
- <emma enabled="true">
- <instr
metadatafile="${project.build.directory}/emma/(a){bundle}-coverage.em"
- mode="copy"
outdir="${project.build.directory}/instrumented-classes/@{bundle}">
- <instrpath>
- <dirset dir="${@{bundle}-classes}">
- <include name="target/*classes"/>
- </dirset>
- </instrpath>
- </instr>
- </emma>
+ <if>
+ <available file="${@{bundle}-classes}" type="dir"
/>
+ <then>
+ <echo>Generating coverage metadata for
${@{bundle}-classes}</echo>
+ <emma enabled="true">
+ <instr
metadatafile="${project.build.directory}/emma/(a){bundle}-coverage.em"
+ mode="copy"
outdir="${project.build.directory}/instrumented-classes/@{bundle}">
+ <instrpath>
+ <dirset dir="${@{bundle}-classes}">
+ <include name="target/*classes"/>
+ </dirset>
+ </instrpath>
+ </instr>
+ </emma>
+ </then>
+ <else>
+ <echo>Skipping coverage metadata generation for
${@{bundle}-classes}</echo>
+ </else>
+ </if>
</sequential>
</for>
<emma enabled="true">