From b4c7ad9112974725655e39dc7d2a5591da3a7e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 11 Dec 2018 15:05:14 +0100 Subject: Remove bullet from the website --- docs/en/erlang.mk/1/guide/coverage/index.html | 48 +++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'docs/en/erlang.mk/1/guide/coverage') diff --git a/docs/en/erlang.mk/1/guide/coverage/index.html b/docs/en/erlang.mk/1/guide/coverage/index.html index 2065dfab..dc452960 100644 --- a/docs/en/erlang.mk/1/guide/coverage/index.html +++ b/docs/en/erlang.mk/1/guide/coverage/index.html @@ -10,7 +10,7 @@ Nine Nines: Code coverage - + @@ -62,8 +62,50 @@

Code coverage

- -

Placeholder chapter.

+

Erlang.mk provides support for code coverage via the tool cover that comes with Erlang/OTP. Code coverage lets you see what parts of your code are covered by the tests.

+

Enabling cover when running tests

+

To run tests with code coverage enabled, simply define COVER=1 either on the command line or in your Makefile:

+
+
$ make tests COVER=1
+
+

When running the targets tests or check 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:

+
+
$ make eunit proper COVER=1
+$ make cover-report
+
+

Note that Common Test has some support for cover 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.

+

Adding applications to the cover report

+

By default Erlang.mk will include all the applications in the code coverage report, except external dependencies.

+

To include some dependencies in the report, you can define the COVER_DEPS variable:

+
+
COVER_DEPS = cowlib
+
+

When using multi application repositories you can exclude some applications by defining the COVER_APPS variable:

+
+
COVER_APPS = presence backend
+
+

Configuring paths

+

By default Erlang.mk will store coverdata files and code coverage reports under the cover/ directory. The variables COVER_DATA_DIR and COVER_REPORT_DIR can be set to use a different location.

+

Merging coverdata files

+

The target all.coverdata will take all existing coverdata files and merge them into one:

+
+
$ make all.coverdata
+
-- cgit v1.2.3