Instructions for generating code coverage report 77/48177/4
authorPawel Kubik <p.kubik@samsung.com>
Tue, 15 Sep 2015 13:40:41 +0000 (15:40 +0200)
committerJan Olszak <j.olszak@samsung.com>
Wed, 16 Sep 2015 15:48:18 +0000 (08:48 -0700)
[Feature]       Instructions in markdown
[Cause]         Need for local coverage reports
[Solution]      N/A
[Verification]  Follow instructions in the file and check report

Change-Id: I69df0752268585c622b5006107ab91a59b840ea7

doc/coverage_report.md [new file with mode: 0644]

diff --git a/doc/coverage_report.md b/doc/coverage_report.md
new file mode 100644 (file)
index 0000000..cb9ef8e
--- /dev/null
@@ -0,0 +1,40 @@
+Generating Code Coverage Report
+===============================
+
+Requirements
+------------
+ - [**gcc**](gcc.gnu.org) - provides `gcov` which generates coverage summary
+ - [**gcovr**](gcovr.com) - recursively runs `gcov` and generates HTML report.
+    [*PyPI*](pypi.python.org/pypi/gcovr) should provide the newest version.
+    You can use `pip` command (available in most repositories):
+    ```bash
+    sudo pip install gcovr
+    ```
+
+Instructions
+------------
+
+All command should be run from within your build directory. **repodir** is a
+path to your repository root.
+
+1. Generate your build using CCOV profile
+```bash
+cmake -DCMAKE_BUILD_TYPE=CCOV repodir
+```
+
+2. Compile, install and run tests in order to generate coverage files (.gcda extension)
+```bash
+make
+sudo make install
+sudo vsm_all_tests.py
+```
+   **Make sure that no other Vasum binaries are being used after installation
+   except from those used by tests!**
+
+3. Generate HTML report
+```bash
+gcovr -e tests -s -v -r repodir --html -o coverage.html
+```
+
+4. Coverage report consists of single page **coverage.html**. Find it in your
+   build directory and open in a web browser.