Adjust coverage script after lcov upgrade 93/309193/1
authorDariusz Michaluk <d.michaluk@samsung.com>
Fri, 5 Apr 2024 10:36:34 +0000 (12:36 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Fri, 5 Apr 2024 10:45:30 +0000 (12:45 +0200)
Change-Id: I7b19431a6c445a83ed2caa10f11e2ac013ffa404

test/cynara-coverage.sh.in

index 36c6d7f39b7f2bc9b745c057c24944570702bbe3..f8a34e0d33525590e65ddb0153a83fbe09fb0433 100644 (file)
@@ -25,13 +25,25 @@ cp -r "@COVERAGE_BUILD_DIR@"/* "@COVERAGE_DIR@"
 
 # prepare report
 rm -f $STDERR
-lcov --no-external -c -d "@COVERAGE_DIR@" -b "@CMAKE_BINARY_DIR@" -o $REPORT 2>$STDERR
-lcov -r $REPORT "@CMAKE_BINARY_DIR@/test/*" -o $REPORT
 
-# check warnings
+# Due to mismatch in the version of gcc/gcov and lcov, we need to ignore few errors
+IGNORE_ERRORS=" --ignore-errors unused,unused \
+                               --ignore-errors empty,empty \
+                               --ignore-errors mismatch,mismatch \
+                               --ignore-errors gcov,gcov "
+
+lcov $IGNORE_ERRORS --no-external -c -d "@COVERAGE_DIR@" -b "@CMAKE_BINARY_DIR@" -o $REPORT 2>$STDERR
+lcov $IGNORE_ERRORS -r $REPORT "@CMAKE_BINARY_DIR@/test/*" -o $REPORT
+
+# Let's skip lcov warning
+# geninfo: WARNING: using JSON module "JSON::PP" - which is much slower than some alternatives.
+# Consider installing one of JSON::XS or Cpanel::JSON::XS
+sed -i '/WARNING/d' $STDERR
+
+# check errors
 if [ -s $STDERR ]
 then
-       echo "Warnings detected (see $STDERR). Aborting."
+       echo "Errors detected (see $STDERR). Aborting."
        exit 1
 fi