[v2] doc: add code coverage report generation guide
diff mbox series

Message ID 20190923121533.1191-1-marcinx.a.zapolski@intel.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • [v2] doc: add code coverage report generation guide
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Marcin Zapolski Sept. 23, 2019, 12:15 p.m. UTC
Add unit tests and code coverage reports generation guides to Meson
build documentation.

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
---
v2: fix trailing whitespaces
---
 doc/build-sdk-meson.txt | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

Patch
diff mbox series

diff --git a/doc/build-sdk-meson.txt b/doc/build-sdk-meson.txt
index fc7fe37b5..691950a62 100644
--- a/doc/build-sdk-meson.txt
+++ b/doc/build-sdk-meson.txt
@@ -192,3 +192,43 @@  From examples/helloworld/Makefile::
 
 	build:
 		@mkdir -p $@
+
+Running DPDK unit-tests
+-----------------------
+
+To run all defined unit tests we can use the command::
+
+	meson test -C build
+
+from DPDK root direcotry, where build is the project build directory. It is the
+equivalent to running::
+
+	ninja test
+
+in ``build`` directory.
+To run a set of tests belonging to a specific test suite, we can use::
+
+	meson test -C build --suite <test-suite>
+
+where <test-suite> can be ``fast-tests``, ``perf-tests``, ``driver-tests`` or
+``debug-tests``.
+
+Generating code coverage reports
+--------------------------------
+
+To gather code coverage data, we need to give meson the  ``-Db_coverage=true``
+command line flag::
+
+	meson configure -Db_coverage=true
+
+To generate code coverage reports, the ``gcovr`` tool needs to be installed. On
+most linux distributions it is available through the package manager, eg.
+``sudo apt-get install gcovr``.
+Then, after running the tests, we can generate the reports simply by running::
+
+	ninja coverage
+
+in project build directory. The reports will be generated in
+``build/meson-logs`` directory, in ``html``, ``xml`` and ``txt`` formats.
+To generate the coverage reports in only one format, we can use one of
+``coverage-html``, ``coverage-xml`` or ``coverage-txt`` meson targets.