DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marcin Zapolski <marcinx.a.zapolski@intel.com>
To: dev@dpdk.org
Cc: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Subject: [dpdk-dev] [PATCH v2] doc: add code coverage report generation guide
Date: Mon, 23 Sep 2019 14:15:33 +0200
Message-ID: <20190923121533.1191-1-marcinx.a.zapolski@intel.com> (raw)
In-Reply-To: <20190923085226.1009-1-marcinx.a.zapolski@intel.com>

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(+)

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.
-- 
2.17.1


  reply	other threads:[~2019-09-23 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23  8:52 [dpdk-dev] [PATCH] " Marcin Zapolski
2019-09-23 12:15 ` Marcin Zapolski [this message]
2020-05-24 21:22   ` [dpdk-dev] [PATCH v2] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190923121533.1191-1-marcinx.a.zapolski@intel.com \
    --to=marcinx.a.zapolski@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git