<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JBoss Tools Tycho Build Code Coverage Report
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/dgolovin">Denis Golovin</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/community/jbosstools/blog/2010/07/07/jboss-tools-tycho-build-code-coverage-report">View the full blog post</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>JBoss Tools tycho build now provides code coverage report for eclipse-test-plugins. All eclipse-test-plugin pom.xml files provide meta information about what bundles are instrumented and what classes are included in coverage report through properties:</p><ul><li>emma.filter - emma filter to define what packages to include to or to exclude from report</li><li>emma.instrument.bundles - comma separated list of bundles to be instrumented on the fly during tests execution</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is an example from org.jboss.tools.common.test plug-ins</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;properties&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;emma.filter&gt;</span>org.jboss.tools.common*<span class="jive-xml-tag">&lt;/emma.filter&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;emma.instrument.bundles&gt;</span>org.jboss.tools.common<span class="jive-xml-tag">&lt;/emma.instrument.bundles&gt;</span>
<span class="jive-xml-tag">&lt;/properties&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To enable code coverage report generation during build</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">-Dcoverage
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>system property should be added to build command line. It activates maven coverage profile to generate coverage reports on per test plug-in basis in text and xml formats. Text reports are printed out to the build console output like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">&#160;&#160;&#160;&#160; [echo] [EMMA v2.0.5312 report, generated Wed Jul 07 12:11:50 PDT 2010]
&#160;&#160;&#160;&#160; [echo] -------------------------------------------------------------------------------
&#160;&#160;&#160;&#160; [echo] OVERALL COVERAGE SUMMARY:
&#160;&#160;&#160;&#160; [echo] 
&#160;&#160;&#160;&#160; [echo] [class, %]&#160;&#160;&#160;&#160; [method, %]&#160;&#160;&#160;&#160; [block, %]&#160;&#160;&#160;&#160; [line, %]&#160;&#160;&#160;&#160; [name]
&#160;&#160;&#160;&#160; [echo] 61%&#160; (22/36)!&#160;&#160;&#160;&#160; 28%&#160; (93/328)!&#160;&#160;&#160;&#160; 17%&#160; (1056/6326)!&#160;&#160;&#160;&#160; 20%&#160; (308.2/1575)!&#160;&#160;&#160;&#160; all classes
&#160;&#160;&#160;&#160; [echo] 
&#160;&#160;&#160;&#160; [echo] OVERALL STATS SUMMARY:
&#160;&#160;&#160;&#160; [echo] 
&#160;&#160;&#160;&#160; [echo] total packages:&#160;&#160;&#160;&#160; 8
&#160;&#160;&#160;&#160; [echo] total classes:&#160;&#160;&#160;&#160; 36
&#160;&#160;&#160;&#160; [echo] total methods:&#160;&#160;&#160;&#160; 328
&#160;&#160;&#160;&#160; [echo] total executable files:&#160;&#160;&#160;&#160; 28
&#160;&#160;&#160;&#160; [echo] total executable lines:&#160;&#160;&#160;&#160; 1575
&#160;&#160;&#160;&#160; [echo] 
&#160;&#160;&#160;&#160; [echo] COVERAGE BREAKDOWN BY PACKAGE:
&#160;&#160;&#160;&#160; [echo] 
&#160;&#160;&#160;&#160; [echo] [class, %]&#160;&#160;&#160;&#160; [method, %]&#160;&#160;&#160;&#160; [block, %]&#160;&#160;&#160;&#160; [line, %]&#160;&#160;&#160;&#160; [name]
&#160;&#160;&#160;&#160; [echo] 0%&#160;&#160; (0/1)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/7)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/78)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/16)!&#160;&#160;&#160;&#160; org.jboss.tools.common.preferences
&#160;&#160;&#160;&#160; [echo] 0%&#160;&#160; (0/2)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/40)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/492)!&#160;&#160;&#160;&#160; 0%&#160;&#160; (0/125)!&#160;&#160;&#160;&#160; org.jboss.tools.common.text
&#160;&#160;&#160;&#160; [echo] 17%&#160; (1/6)!&#160;&#160;&#160;&#160; 4%&#160;&#160; (3/77)!&#160;&#160;&#160;&#160; 4%&#160;&#160; (92/2401)!&#160;&#160;&#160;&#160; 4%&#160;&#160; (24.9/562)!&#160;&#160;&#160;&#160; org.jboss.tools.common.util
&#160;&#160;&#160;&#160; [echo] 67%&#160; (4/6)!&#160;&#160;&#160;&#160; 35%&#160; (11/31)!&#160;&#160;&#160;&#160; 19%&#160; (77/396)!&#160;&#160;&#160;&#160; 23%&#160; (23.2/102)!&#160;&#160;&#160;&#160; org.jboss.tools.common.reporting
&#160;&#160;&#160;&#160; [echo] 75%&#160; (6/8)!&#160;&#160;&#160;&#160; 33%&#160; (25/75)!&#160;&#160;&#160;&#160; 21%&#160; (367/1734)!&#160;&#160;&#160;&#160; 24%&#160; (99.2/419)!&#160;&#160;&#160;&#160; org.jboss.tools.common.xml
&#160;&#160;&#160;&#160; [echo] 75%&#160; (3/4)!&#160;&#160;&#160;&#160; 48%&#160; (11/23)!&#160;&#160;&#160;&#160; 24%&#160; (135/562)!&#160;&#160;&#160;&#160; 32%&#160; (44.1/139)!&#160;&#160;&#160;&#160; org.jboss.tools.common
&#160;&#160;&#160;&#160; [echo] 75%&#160; (3/4)!&#160;&#160;&#160;&#160; 42%&#160; (23/55)!&#160;&#160;&#160;&#160; 36%&#160; (153/422)!&#160;&#160;&#160;&#160; 36%&#160; (52.4/144)!&#160;&#160;&#160;&#160; org.jboss.tools.common.log
&#160;&#160;&#160;&#160; [echo] 100% (5/5)&#160;&#160;&#160;&#160; 100% (20/20)&#160;&#160;&#160;&#160; 96%&#160; (232/241)&#160;&#160;&#160;&#160; 95%&#160; (64.4/68)&#160;&#160;&#160;&#160; org.jboss.tools.common.zip
&#160;&#160;&#160;&#160; [echo] -------------------------------------------------------------------------------



</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Reports are generated to /target/emma folder of test plug-in.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To enable code coverage for your test plug-in just add properties listed above to your plug-in pom.xml file and activate coverage profile as it explained above.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/community/jbosstools/blog/2010/07/07/jboss-tools-tycho-build-code-coverage-report">going to Community</a></p>

</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>