[RFC,1/1] Add basic support for code coverage analysis

Message ID 20220906164309.1771502-2-felix.moessbauer@siemens.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series Add support for code-coverage analysis |

Checks

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

Commit Message

Moessbauer, Felix Sept. 6, 2022, 4:43 p.m. UTC
  This patch adds basic support to get meaningful
code coverage statistics for some central components.
To keep things simple, we only focus on the parts that are
tested as part of the "fast-tests" suite.
This includes the lib as well as drivers that do not require
special hardware to be tested.

By providing the gcovr.cfg file in the project root,
modern versions of meson (>=0.63) can pass that information
to gcovr, making it possible to configure the coverage target
of meson.
This enables us to use the default meson coverage infrastructure
and customize it for the needs of the DPDK project.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Acked-by: William Lam <william.lam@bytedance.com>
Acked-by: Chriss Windle <chrisswindle@microsoft.com>
---
 gcovr.cfg | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 gcovr.cfg
  

Comments

Stephen Hemminger Aug. 20, 2023, 3:54 p.m. UTC | #1
On Tue,  6 Sep 2022 18:43:09 +0200
Felix Moessbauer <felix.moessbauer@siemens.com> wrote:

> This patch adds basic support to get meaningful
> code coverage statistics for some central components.
> To keep things simple, we only focus on the parts that are
> tested as part of the "fast-tests" suite.
> This includes the lib as well as drivers that do not require
> special hardware to be tested.
> 
> By providing the gcovr.cfg file in the project root,
> modern versions of meson (>=0.63) can pass that information
> to gcovr, making it possible to configure the coverage target
> of meson.
> This enables us to use the default meson coverage infrastructure
> and customize it for the needs of the DPDK project.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> Acked-by: William Lam <william.lam@bytedance.com>
> Acked-by: Chriss Windle <chrisswindle@microsoft.com>

Not sure why this patch stalled. Seems ok but the set of drivers seems
quite small. Would be good to do it across wider set.
  

Patch

diff --git a/gcovr.cfg b/gcovr.cfg
new file mode 100644
index 0000000000..6e247499e8
--- /dev/null
+++ b/gcovr.cfg
@@ -0,0 +1,8 @@ 
+filter = lib
+filter = drivers/bus/pci
+filter = drivers/bus/vdev
+filter = drivers/mempool/ring
+filter = drivers/event/skeleton
+filter = drivers/net/ring
+filter = drivers/net/null
+filter = drivers/raw/skeleton