ci: use gcovr 5.0 to generate code coverage reports

Change-Id: I680b476bb93cffff389071437e7a818f16b6334d
diff --git a/.jenkins.d/30-coverage.sh b/.jenkins.d/30-coverage.sh
index 7ea2a91..a0e25e5 100755
--- a/.jenkins.d/30-coverage.sh
+++ b/.jenkins.d/30-coverage.sh
@@ -2,29 +2,30 @@
 set -ex
 
 if [[ $JOB_NAME == *"code-coverage" ]]; then
-    gcovr --object-directory=build \
-          --output=build/coverage.xml \
-          --exclude="$PWD/tests" \
-          --root=. \
-          --xml
+    # Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
+    # Note: trailing slashes are important in the paths below. Do not remove them!
+    gcovr -j$WAF_JOBS \
+          --object-directory build \
+          --filter tools/ \
+          --exclude-throw-branches \
+          --exclude-unreachable-branches \
+          --print-summary \
+          --html-details build/gcovr/ \
+          --xml build/coverage.xml
 
-    # Generate also a detailed HTML output, but using lcov (better results)
+    # Generate a detailed HTML report using lcov
     lcov --quiet \
          --capture \
          --directory . \
+         --exclude "$PWD/tests/*" \
          --no-external \
          --rc lcov_branch_coverage=1 \
-         --output-file build/coverage-with-tests.info
-
-    lcov --quiet \
-         --remove build/coverage-with-tests.info "$PWD/tests/*" \
-         --rc lcov_branch_coverage=1 \
          --output-file build/coverage.info
 
     genhtml --branch-coverage \
             --demangle-cpp \
             --legend \
-            --output-directory build/coverage \
+            --output-directory build/lcov \
             --title "ndn-tools unit tests" \
             build/coverage.info
 fi