Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit 5f158e9a authored by Mikaël Salson's avatar Mikaël Salson
Browse files

algo/Makefile: Remove base directory with lcov

lcov needs to know the whole path to a file in order to display it
and to count the coverage on each file.

However when launching with Gitlab-CI, each job is launched in a separate directory
which leads to different paths for the same source files.
Therefore we first remove the trailing path when generating the
lcov files. But we add it again before generating the HTML output
as it requires to access the files.
parent 7c4abd57
......@@ -14,6 +14,7 @@ ifeq ($(LDFLAGS),)
LDFLAGS := $(COVERAGE_OPTION)
endif
COV_OUTFILE?=lcov.out
BASE_PATH=$(dir $(abspath .))
export CXXFLAGS
export LDFLAGS
......@@ -219,14 +220,14 @@ functional_coverage: cleancoverage
gencov:
which lcov > /dev/null || exit 0
lcov --rc lcov_branch_coverage=1 -d . -c -o $(COV_OUTFILE)
lcov --rc lcov_branch_coverage=1 --rc geninfo_adjust_src_path="$(BASE_PATH)" -d . -c -o $(COV_OUTFILE)
lcov --rc lcov_branch_coverage=1 --remove $(COV_OUTFILE) '/usr/*' '*algo/tests/*' '*algo/lib/*' '*algo/tools/*' -o $(COV_OUTFILE).filtered
### Reports with lcov
lcov_reports:
mkdir -p reports
which lcov > /dev/null && (lcov --rc lcov_branch_coverage=1 $(addprefix -a ,$(wildcard lcov*.filtered)) -o lcov_filtered_total.out && genhtml --branch-coverage --legend --output-directory reports/ lcov_filtered_total.out ) || echo "gcovr is needed to generate a full report"
which lcov > /dev/null && (lcov --rc lcov_branch_coverage=1 $(addprefix -a ,$(wildcard lcov*.filtered)) | sed 's_^SF:algo_SF:'"$(BASE_PATH)"'/algo_' > lcov_filtered_total.out && genhtml --branch-coverage --legend --output-directory reports/ lcov_filtered_total.out ) || echo "gcovr is needed to generate a full report"
### cppcheck
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment