aboutsummaryrefslogtreecommitdiffstats
path: root/guide/coverage.html
diff options
context:
space:
mode:
Diffstat (limited to 'guide/coverage.html')
-rw-r--r--guide/coverage.html21
1 files changed, 20 insertions, 1 deletions
diff --git a/guide/coverage.html b/guide/coverage.html
index 9cbd27a..85d5935 100644
--- a/guide/coverage.html
+++ b/guide/coverage.html
@@ -33,7 +33,26 @@ div.navfooter{margin-bottom:1em}
</header>
<main>
-<div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="triq.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ci.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="coverage"></a>Chapter 22. Code coverage</h2></div></div></div><p>Placeholder chapter.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="triq.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tests.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ci.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
+<div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="triq.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ci.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="coverage"></a>Chapter 23. Code coverage</h2></div></div></div><p>Erlang.mk provides support for code coverage via the tool
+<code class="literal">cover</code> that comes with Erlang/OTP. Code coverage lets you
+see what parts of your code are covered by the tests.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_enabling_cover_when_running_tests"></a>23.1. Enabling cover when running tests</h2></div></div></div><p>To run tests with code coverage enabled, simply define
+<code class="literal">COVER=1</code> either on the command line or in your Makefile:</p><pre class="programlisting">$ make tests COVER=1</pre><p>When running the targets <code class="literal">tests</code> or <code class="literal">check</code> the code
+coverage report will be built automatically. This is
+not the case for test framework specific targets,
+however. In those cases you can generate the reports
+manually:</p><pre class="programlisting">$ make eunit proper COVER=1
+$ make cover-report</pre><p>Note that Common Test has some support for <code class="literal">cover</code>
+built-in and that it will generate code coverage
+reports in the Common Test logs regardless. The
+report that Erlang.mk generates is however common
+to all test frameworks and might be more useful.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_adding_applications_to_the_cover_report"></a>23.2. Adding applications to the cover report</h2></div></div></div><p>By default Erlang.mk will include all the applications
+in the code coverage report, except external dependencies.</p><p>To include some dependencies in the report, you can
+define the <code class="literal">COVER_DEPS</code> variable:</p><pre class="programlisting">COVER_DEPS = cowlib</pre><p>When using multi application repositories you can exclude
+some applications by defining the <code class="literal">COVER_APPS</code> variable:</p><pre class="programlisting">COVER_APPS = presence backend</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_configuring_paths"></a>23.3. Configuring paths</h2></div></div></div><p>By default Erlang.mk will store <span class="emphasis"><em>coverdata</em></span> files and
+code coverage reports under the <span class="emphasis"><em>cover/</em></span> directory. The
+variables <code class="literal">COVER_DATA_DIR</code> and <code class="literal">COVER_REPORT_DIR</code> can be
+set to use a different location.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_merging_coverdata_files"></a>23.4. Merging coverdata files</h2></div></div></div><p>The target <code class="literal">all.coverdata</code> will take all existing
+<span class="emphasis"><em>coverdata</em></span> files and merge them into one:</p><pre class="programlisting">$ make all.coverdata</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="triq.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tests.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ci.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
</main>
</body>
</html>