From 1c95e12b0dd2b4902a289328e8e54fde6eed0623 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Wed, 21 Jun 2023 23:14:38 -0400 Subject: tests docs: fix lcov code coverage report generation - Updated/rebased version of https://gerrit.fd.io/r/c/vpp/+/34199 Type: test Change-Id: I43913ecfd11a4578bdb10c4be76253fe38d57976 Signed-off-by: Nathan Skrzypczak Signed-off-by: Dave Wallace --- extras/lcov/README.rst | 48 ------------------------------------------------ extras/lcov/lcov_post | 12 ------------ extras/lcov/lcov_prep | 7 ------- 3 files changed, 67 deletions(-) delete mode 100644 extras/lcov/README.rst delete mode 100755 extras/lcov/lcov_post delete mode 100755 extras/lcov/lcov_prep (limited to 'extras/lcov') diff --git a/extras/lcov/README.rst b/extras/lcov/README.rst deleted file mode 100644 index 3dab9510215..00000000000 --- a/extras/lcov/README.rst +++ /dev/null @@ -1,48 +0,0 @@ -.. _lcov_code_coverage: - -Code coverage with lcov -======================= - -Prerequisites -------------- - -The Linux gcov and lcov tools are fussy about gcc / g++ compiler -versions. As of this writing, Ubuntu 18.04 gcov / lcov work with these -toolchain versions: - -$ gcc –version gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 $ g++ –version -g++ (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0 - -Refer to -https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version -for information on how to install multiple gcc / g++ versions, and -switch between them. - -You’ll need to install the following additional packages: - -$ sudo apt-get install gcovr ggcov lcov - -Compile an instrumented vpp image ---------------------------------- - -Two ways: - -$ cd $ make test-gcov $ ## interrupt compilation after building the -image - -or $ cd /build-root $ make PLATFORM=vpp TAG=vpp_gcov vpp-install - -Initialize the lcov database ----------------------------- - -$ cd $ ./extras/lcov/lcov_prep $ make test-gcov or make TEST=my_test -test-gcov $ # repeat or vary as desired to increase reported coverage $ -# Generate the report: $ ./extras/lcov/lcov_post - -You can run vpp manually, do anything you like. Results are cumulative -until you re-run the “prep” script. - -Look at the results -------------------- - -Point a browser at file:////build-root/html/index.html diff --git a/extras/lcov/lcov_post b/extras/lcov/lcov_post deleted file mode 100755 index 1aaf9865d24..00000000000 --- a/extras/lcov/lcov_post +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -cd build-root -rm -rf html -mkdir html -lcov --no-checksum --directory . --capture --output-file out.info -lcov --remove out.info \ - "/usr/include/*" "*/build-root/*" "/opt/*" "/usr/lib/*" \ - -o filtered.info -genhtml filtered.info -o html diff --git a/extras/lcov/lcov_prep b/extras/lcov/lcov_prep deleted file mode 100755 index 1212d0470a2..00000000000 --- a/extras/lcov/lcov_prep +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -cd build-root -rm -rf html -lcov --capture --initial --directory . --output-file lcov.out -- cgit 1.2.3-korg