From 2246c986d65786b11b32c57c876d66d29cc9107a Mon Sep 17 00:00:00 2001 From: Kevin Valerio <24193167+kevin-valerio@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:56:01 +0200 Subject: [PATCH 1/2] Replace relative to absolute path for `cov-clang.sh` When being on top directory, this fixes the warning `stderr: geninfo: WARNING: Can't exec "./cov-clang.sh": No such file or directory` --- cov-generate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cov-generate.sh b/cov-generate.sh index 81893c9..63ca120 100755 --- a/cov-generate.sh +++ b/cov-generate.sh @@ -21,7 +21,7 @@ test -d "$1" || { echo Error: directory $1 does not exist; exit 1; } test -x "$2" || { echo Error: $2 is not an executable; exit 1; } OPT= -test -n "$CLANG" && OPT="--gcov-tool cov-clang.sh" +test -n "$CLANG" && OPT="--gcov-tool $PWD/cov-clang.sh" DIR=`dirname $0` test -n "$DIR" && export PATH=$PATH:$DIR From 8e968c6526540944c711d75aaefd1542a17e4803 Mon Sep 17 00:00:00 2001 From: Kevin Valerio <24193167+kevin-valerio@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:46:09 +0200 Subject: [PATCH 2/2] Ignore more errors as a try-harder mode Most of the time `lcov` and `genhtml` will stop because of some errors and/or warning. We can ignore them to still generate the report. --- cov-generate.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cov-generate.sh b/cov-generate.sh index 63ca120..7a6acbd 100755 --- a/cov-generate.sh +++ b/cov-generate.sh @@ -27,12 +27,12 @@ DIR=`dirname $0` test -n "$DIR" && export PATH=$PATH:$DIR mkdir report 2> /dev/null -lcov $OPT --no-checksum --zerocounters --directory . || exit -lcov $OPT --no-checksum --capture --initial --directory . --output-file report/trace.lcov_base || exit 1 +lcov $OPT --no-checksum --ignore-errors inconsistent,unsupported --zerocounters --directory . || exit +lcov $OPT --no-checksum --ignore-errors inconsistent,unsupported --capture --initial --directory . --output-file report/trace.lcov_base || exit 1 "$2" "$1"/* -lcov $OPT --no-checksum --capture --directory . --output-file report/trace.lcov_info || exit 1 -lcov $OPT --no-checksum -a report/trace.lcov_base -a report/trace.lcov_info --output-file report/trace.lcov_tmp || exit 1 -lcov $OPT --no-checksum -r report/trace.lcov_tmp /usr/include/\* --output-file report/trace.lcov_info_final || exit 1 -genhtml --ignore-errors source --output-directory report report/trace.lcov_info_final +lcov $OPT --no-checksum --ignore-errors inconsistent,unsupported --capture --directory . --output-file report/trace.lcov_info || exit 1 +lcov $OPT --no-checksum --ignore-errors inconsistent,unsupported -a report/trace.lcov_base -a report/trace.lcov_info --output-file report/trace.lcov_tmp || exit 1 +lcov $OPT --no-checksum --ignore-errors inconsistent,unsupported -r report/trace.lcov_tmp /usr/include/\* --output-file report/trace.lcov_info_final || exit 1 +genhtml --ignore-errors source,format --output-directory report report/trace.lcov_info_final echo echo Report: `pwd`/report/index.html