Home | History | Annotate | Download | only in doc

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 creates 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
158 <td><code>enabled</code></td>
159 <td>If set to <code>true</code> coverage data will be collected for the contained task.</td>
160 <td><code>true</code></td>
163 <td><code>destfile</code></td>
165 <td><code>jacoco.exec</code></td>
168 <td><code>append</code></td>
169 <td>If set to <code>true</code> and the execution data file already
171 <code>false</code>, an existing execution data file will be replaced.
173 <td><code>true</code></td>
176 <td><code>includes</code></td>
178 The list entries are separated by a colon (<code>:</code>) and
179 may use wildcard characters (<code>*</code> and <code>?</code>).
183 <td><code>*</code> (all classes)</td>
186 <td><code>excludes</code></td>
188 The list entries are separated by a colon (<code>:</code>) and
189 may use wildcard characters (<code>*</code> and <code>?</code>).
196 <td><code>exclclassloader</code></td>
199 (<code>:</code>) and may use wildcard characters (<code>*</code> and
200 <code>?</code>). This option might be required in case of special
201 frameworks that conflict with JaCoCo code instrumentation, in
205 <td><code>sun.reflect.DelegatingClassLoader</code></td>
208 <td><code>inclbootstrapclasses</code></td>
213 <td><code>false</code></td>
216 <td><code>sessionid</code></td>
223 <td><code>dumponexit</code></td>
224 <td>If set to <code>true</code> coverage data will be written on VM
227 <td><code>true</code></td>
230 <td><code>output</code></td>
233 <li><code>file</code>: At VM termination execution data is written to
234 the file specified in the <code>destfile</code> attribute.</li>
235 <li><code>tcpserver</code>: The agent listens for incoming connections
236 on the TCP port specified by the <code>address</code> and
237 <code>port</code> attribute. Execution data is written to this
239 <li><code>tcpclient</code>: At startup the agent connects to the TCP
240 port specified by the <code>address</code> and <code>port</code>
242 <li><code>none</code>: Do not produce any output.</li>
245 <td><code>file</code></td>
248 <td><code>address</code></td>
250 <code>tcpserver</code> or connect to when the output method is
251 <code>tcpclient</code>. In <code>tcpserver</code> mode the value
252 "<code>*</code>" causes the agent to accept connections on any local
258 <td><code>port</code></td>
259 <td>Port to bind to when the output method is <code>tcpserver</code> or
260 connect to when the output method is <code>tcpclient</code>. In
261 <code>tcpserver</code> mode the port must be available, which means
265 <td><code>6300</code></td>
268 <td><code>classdumpdir</code></td>
277 <td><code>jmx</code></td>
278 <td>If set to <code>true</code> the agent exposes
280 JMX under the name <code>org.jacoco:type=Runtime</code>.
282 <td><code>false</code></td>
288 <h2><a name="agent">Task <code>agent</code></a></h2>
291 If the <code>coverage</code> task is not suitable for your launch target, you
292 might alternatively use the <code>agent</code> task to create the
294 Ant property with the name <code>agentvmparam</code> that can be directly used
303 This task has the same attributes as the <code>coverage</code> task plus an
317 <td><code>enabled</code></td>
318 <td>When this variable is set to <code>false</code> the value of <code>property</code> will be set to an empty string, effectively
320 <td><code>true</code></td>
323 <td><code>property</code></td>
328 <td colspan="3"><i>All attributes of the <code>coverage</code> task.</i></td>
334 <h2><a name="dump">Task <code>dump</code></a></h2>
352 configured with <code>output</code> mode <code>tcpserver</code>. See
353 <a href="#coverage"><code>coverage</code></a> and
354 <a href="#agent"><code>agent</code></a> tasks above.
358 The <code>dump</code> task has the following attributes:
371 <td><code>address</code></td>
373 <td><code>localhost</code></td>
376 <td><code>port</code></td>
378 <td><code>6300</code></td>
381 <td><code>retryCount</code></td>
385 <td><code>10</code></td>
388 <td><code>dump</code></td>
390 <td><code>true</code></td>
393 <td><code>reset</code></td>
396 <td><code>false</code></td>
399 <td><code>destfile</code></td>
404 <td><code>append</code></td>
405 <td>If set to <code>true</code> and the execution data file already
407 <code>false</code>, an existing execution data file will be replaced.
409 <td><code>true</code></td>
415 <h2><a name="merge">Task <code>merge</code></a></h2>
443 <td><code>destfile</code></td>
451 <h2><a name="report">Task <code>report</code></a></h2>
454 Finally different reports can be created with the <code>report</code> task.
481 As you can see from the example above the <code>report</code> task is based
485 <h3>Element <code>executiondata</code></h3>
490 file is specified, execution data is combined. A particular piece of code is
494 <h3>Element <code>structure</code></h3>
502 <li><code>classfiles</code>: Container element for Ant resources and resource
506 <li><code>sourcefiles</code>: Optional container element for Ant resources and
508 files are specified, some report formats include highlighted source code.
513 The <code>sourcefiles</code> element has these optional attributes:
526 <td><code>encoding</code></td>
531 <td><code>tabwidth</code></td>
545 Note that the <code>classfiles</code> and <code>sourcefiles</code> elements
562 convenient to use Ant's <code>zipfileset</code> to specify class or source
568 The structure can be refined with a hierarchy of <code>group</code> elements.
599 Both <code>structure</code> and <code>group</code> elements have the following
613 <td><code>name</code></td>
620 <h3>Element <code>html</code></h3>
637 <td><code>destdir</code></td>
639 <code>destfile</code> has to be supplied.</td>
643 <td><code>destfile</code></td>
645 <code>destdir</code> has to be supplied.</td>
649 <td><code>footer</code></td>
654 <td><code>encoding</code></td>
656 <td><code>UTF-8</code></td>
659 <td><code>locale</code></td>
660 <td>Locale specified as ISO code (en, fr, jp, ...) used for number
668 <h3>Element <code>xml</code></h3>
684 <td><code>destfile</code></td>
689 <td><code>encoding</code></td>
691 <td><code>UTF-8</code></td>
696 <h3>Element <code>csv</code></h3>
712 <td><code>destfile</code></td>
717 <td><code>encoding</code></td>
719 <td><code>UTF-8</code></td>
724 <h3>Element <code>check</code></h3>
744 The <code>check</code> element has the following attributes:
757 <td><code>rules</code></td>
762 <td><code>failonviolation</code></td>
764 <td><code>true</code></td>
767 <td><code>violationsproperty</code></td>
776 Within the <code>check</code> element any number of <code>rule</code> elements
790 <td><code>element</code></td>
792 <code>BUNLDE</code>, <code>PACKAGE</code>, <code>CLASS</code>,
793 <code>SOURCEFILE</code> and <code>METHOD</code>.</td>
794 <td><code>BUNLDE</code></td>
797 <td><code>includes</code></td>
800 <td><code>*</code></td>
803 <td><code>excludes</code></td>
809 <td><code>limits</code></td>
817 Within the <code>rule</code> element any number of <code>limit</code> elements
831 <td><code>counter</code></td>
833 Possible options are <code>INSTRUCTION</code>, <code>LINE</code>,
834 <code>BRANCH</code>, <code>COMPLEXITY</code>, <code>METHOD</code> and
835 <code>CLASS</code>.</td>
836 <td><code>INSTRUCTION</code></td>
839 <td><code>value</code></td>
841 <code>TOTALCOUNT</code>, <code>MISSEDCOUNT</code>,
842 <code>COVEREDCOUNT</code>, <code>MISSEDRATIO</code> and
843 <code>COVEREDRATIO</code>.</td>
844 <td><code>COVEREDRATIO</code></td>
847 <td><code>minimum</code></td>
854 <td><code>maximum</code></td>
861 <h2><a name="instrument">Task <code>instrument</code></a></h2>
864 <b>Warning:</b> The preferred way for code coverage analysis with JaCoCo is
901 <td><code>destdir</code></td>
906 <td><code>removesignatures</code></td>
907 <td>If set to <code>true</code> all signature related information is
910 <td><code>true</code></td>