]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: hacking: Add 'Code coverage reports' section
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Mar 2019 17:03:15 +0000 (13:03 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 15 Mar 2019 00:47:15 +0000 (20:47 -0400)
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
docs/hacking.html.in

index f99d143b7b828da55408005ddcc6fd9d96b1934b..902d05430f6b3345163cbb708cbc5709f8157a2b 100644 (file)
@@ -1412,5 +1412,34 @@ int foo()
         in the same way, but still make sure they get reviewed if non-trivial.
       </li>
     </ul>
+    <h2><a id="coverage">Code coverage reports</a></h2>
+
+    <p>
+      Code coverage HTML reports can be generated with:
+    </p>
+
+<pre>
+  make coverage
+</pre>
+
+    <p>
+      Reports will be generated in the <code>cov/</code> directory. Point a
+      web browser at <code>cov/index.html</code> for the full report.
+    </p>
+
+    <p>
+      The <code>make coverage</code> target is provided by <code>gnulib</code>.
+      It is a convenience helper for calling the following 3 targets in order.
+      It may be useful to occasionally call these directly.
+
+    <ul>
+      <li><code>make init-coverage</code>: run <code>make clean</code> and
+          remove all code coverage counter files (*.gcno, etc.)</li>
+      <li><code>make build-coverage</code>: run <code>make</code> and
+          <code>make check</code> with <code>CFLAGS</code> filled in with
+          necessary coverage flags</li>
+      <li><code>make gen-coverage</code>: generate the HTML report</li>
+    </ul>
+    </p>
   </body>
 </html>