Lines Matching full:code
27 <a href="#coverage"><code>coverage</code></a>,
28 <a href="#agent"><code>agent</code></a>,
29 <a href="#dump"><code>dump</code></a> and
30 <a href="#merge"><code>merge</code></a>. Reports in different formats are
31 created with the <a href="#report"><code>report</code></a> task. For
33 <a href="#instrument"><code>instrument</code></a> can be used to prepare class
39 or you want source code highlighting the class files of the test target must
46 The JaCoCo distribution contains a simple example how code coverage can be
50 example is located in the <code>./doc/examples/build</code> folder of the
67 <p>All tasks are defined in <code>jacocoant.jar</code> (which is part of the
69 <code>taskdef</code> declaration:
85 Alternatively you might also place the <code>jacocoant.jar</code> in your
86 Ant <code><i>ANT_HOME</i>/lib</code> folder. If you use the name space URI
87 <code>antlib:org.jacoco.ant</code> for JaCoCo tasks Ant will find them
88 automatically without the <code>taskdef</code> declaration above.
94 <code>jacoco</code> prefix declared above. If you don't declare a separate
95 namespace the <code>jacoco</code> prefix must be removed from the following
99 <h2><a name="coverage">Task <code>coverage</code></a></h2>
102 The standard Ant tasks to launch Java programs are <code>java</code>, <code>junit</code> and
103 <code>testng</code>. To add code coverage recording to these tasks they can
104 simply be wrapped with the <code>coverage</code> task as shown in the
130 to a file when the process terminates. Note the <code>fork</code> attribute
131 above in the wrapped <code>java</code> task.
135 The nested task always has to declare <code>fork="true"</code>, otherwise the
136 <code>coverage</code> task can't record coverage information and will fail.
137 In addition the <code>junit</code> task should declare
138 <code>forkmode="once"</code> to avoid starting a new JVM for every single test
141 <code>forkmode="perTest"</code> or <code>forkmode="perBatch"</code> should not
142 be combined with <code>append="false"</code> as the execution data file is
161 <td><code>enabled</code></td>
162 <td>If set to <code>true</code> coverage data will be collected for the contained task.</td>
163 <td><code>true</code></td>
166 <td><code>destfile</code></td>
168 <td><code>jacoco.exec</code></td>
171 <td><code>append</code></td>
172 <td>If set to <code>true</code> and the execution data file already
174 <code>false</code>, an existing execution data file will be replaced.
176 <td><code>true</code></td>
179 <td><code>includes</code></td>
181 The list entries are separated by a colon (<code>:</code>) and
182 may use wildcard characters (<code>*</code> and <code>?</code>).
186 <td><code>*</code> (all classes)</td>
189 <td><code>excludes</code></td>
191 The list entries are separated by a colon (<code>:</code>) and
192 may use wildcard characters (<code>*</code> and <code>?</code>).
195 the report please configure the <code>report</code> task accordingly.
200 <td><code>exclclassloader</code></td>
203 (<code>:</code>) and may use wildcard characters (<code>*</code> and
204 <code>?</code>). This option might be required in case of special
205 frameworks that conflict with JaCoCo code instrumentation, in
209 <td><code>sun.reflect.DelegatingClassLoader</code></td>
212 <td><code>inclbootstrapclasses</code></td>
217 <td><code>false</code></td>
220 <td><code>inclnolocationclasses</code></td>
225 <td><code>false</code></td>
228 <td><code>sessionid</code></td>
235 <td><code>dumponexit</code></td>
236 <td>If set to <code>true</code> coverage data will be written on VM
239 <td><code>true</code></td>
242 <td><code>output</code></td>
245 <li><code>file</code>: At VM termination execution data is written to
246 the file specified in the <code>destfile</code> attribute.</li>
247 <li><code>tcpserver</code>: The agent listens for incoming connections
248 on the TCP port specified by the <code>address</code> and
249 <code>port</code> attribute. Execution data is written to this
251 <li><code>tcpclient</code>: At startup the agent connects to the TCP
252 port specified by the <code>address</code> and <code>port</code>
254 <li><code>none</code>: Do not produce any output.</li>
257 <td><code>file</code></td>
260 <td><code>address</code></td>
262 <code>tcpserver</code> or connect to when the output method is
263 <code>tcpclient</code>. In <code>tcpserver</code> mode the value
264 "<code>*</code>" causes the agent to accept connections on any local
270 <td><code>port</code></td>
271 <td>Port to bind to when the output method is <code>tcpserver</code> or
272 connect to when the output method is <code>tcpclient</code>. In
273 <code>tcpserver</code> mode the port must be available, which means
277 <td><code>6300</code></td>
280 <td><code>classdumpdir</code></td>
289 <td><code>jmx</code></td>
290 <td>If set to <code>true</code> the agent exposes
292 JMX under the name <code>org.jacoco:type=Runtime</code>.
294 <td><code>false</code></td>
300 <h2><a name="agent">Task <code>agent</code></a></h2>
303 If the <code>coverage</code> task is not suitable for your launch target, you
304 might alternatively use the <code>agent</code> task to create the
306 Ant property with the name <code>agentvmparam</code> that can be directly used
315 This task has the same attributes as the <code>coverage</code> task plus an
329 <td><code>enabled</code></td>
330 …<td>When this variable is set to <code>false</code> the value of <code>property</code> will be set…
332 <td><code>true</code></td>
335 <td><code>property</code></td>
340 <td colspan="3"><i>All attributes of the <code>coverage</code> task.</i></td>
346 <h2><a name="dump">Task <code>dump</code></a></h2>
364 configured with <code>output</code> mode <code>tcpserver</code>. See
365 <a href="#coverage"><code>coverage</code></a> and
366 <a href="#agent"><code>agent</code></a> tasks above.
370 The <code>dump</code> task has the following attributes:
383 <td><code>address</code></td>
385 <td><code>localhost</code></td>
388 <td><code>port</code></td>
390 <td><code>6300</code></td>
393 <td><code>retryCount</code></td>
397 <td><code>10</code></td>
400 <td><code>dump</code></td>
402 <td><code>true</code></td>
405 <td><code>reset</code></td>
408 <td><code>false</code></td>
411 <td><code>destfile</code></td>
416 <td><code>append</code></td>
417 <td>If set to <code>true</code> and the execution data file already
419 <code>false</code>, an existing execution data file will be replaced.
421 <td><code>true</code></td>
427 <h2><a name="merge">Task <code>merge</code></a></h2>
455 <td><code>destfile</code></td>
463 <h2><a name="report">Task <code>report</code></a></h2>
466 Finally different reports can be created with the <code>report</code> task.
493 As you can see from the example above the <code>report</code> task is based
497 <h3>Element <code>executiondata</code></h3>
502 file is specified, execution data is combined. A particular piece of code is
506 <h3>Element <code>structure</code></h3>
514 <li><code>classfiles</code>: Container element for Ant resources and resource
518 <li><code>sourcefiles</code>: Optional container element for Ant resources and
520 files are specified, some report formats include highlighted source code.
525 The <code>sourcefiles</code> element has these optional attributes:
538 <td><code>encoding</code></td>
543 <td><code>tabwidth</code></td>
557 Note that the <code>classfiles</code> and <code>sourcefiles</code> elements
574 convenient to use Ant's <code>zipfileset</code> to specify class or source
580 The structure can be refined with a hierarchy of <code>group</code> elements.
611 Both <code>structure</code> and <code>group</code> elements have the following
625 <td><code>name</code></td>
632 <h3>Element <code>html</code></h3>
649 <td><code>destdir</code></td>
651 <code>destfile</code> has to be supplied.</td>
655 <td><code>destfile</code></td>
657 <code>destdir</code> has to be supplied.</td>
661 <td><code>footer</code></td>
666 <td><code>encoding</code></td>
668 <td><code>UTF-8</code></td>
671 <td><code>locale</code></td>
672 <td>Locale specified as ISO code (en, fr, jp, ...) used for number
680 <h3>Element <code>xml</code></h3>
696 <td><code>destfile</code></td>
701 <td><code>encoding</code></td>
703 <td><code>UTF-8</code></td>
708 <h3>Element <code>csv</code></h3>
724 <td><code>destfile</code></td>
729 <td><code>encoding</code></td>
731 <td><code>UTF-8</code></td>
736 <h3>Element <code>check</code></h3>
756 The <code>check</code> element has the following attributes:
769 <td><code>rules</code></td>
774 <td><code>failonviolation</code></td>
776 <td><code>true</code></td>
779 <td><code>violationsproperty</code></td>
788 Within the <code>check</code> element any number of <code>rule</code> elements
802 <td><code>element</code></td>
804 <code>BUNDLE</code>, <code>PACKAGE</code>, <code>CLASS</code>,
805 <code>SOURCEFILE</code> and <code>METHOD</code>.</td>
806 <td><code>BUNDLE</code></td>
809 <td><code>includes</code></td>
812 <td><code>*</code></td>
815 <td><code>excludes</code></td>
821 <td><code>limits</code></td>
829 Within the <code>rule</code> element any number of <code>limit</code> elements
843 <td><code>counter</code></td>
845 Possible options are <code>INSTRUCTION</code>, <code>LINE</code>,
846 <code>BRANCH</code>, <code>COMPLEXITY</code>, <code>METHOD</code> and
847 <code>CLASS</code>.</td>
848 <td><code>INSTRUCTION</code></td>
851 <td><code>value</code></td>
853 <code>TOTALCOUNT</code>, <code>MISSEDCOUNT</code>,
854 <code>COVEREDCOUNT</code>, <code>MISSEDRATIO</code> and
855 <code>COVEREDRATIO</code>.</td>
856 <td><code>COVEREDRATIO</code></td>
859 <td><code>minimum</code></td>
868 <td><code>maximum</code></td>
869 <td>Expected maximum value, see <code>minimum</code> for details.</td>
875 <h2><a name="instrument">Task <code>instrument</code></a></h2>
878 <b>Warning:</b> The preferred way for code coverage analysis with JaCoCo is
915 <td><code>destdir</code></td>
920 <td><code>removesignatures</code></td>
921 <td>If set to <code>true</code> all signature related information is
924 <td><code>true</code></td>