Commit f8b6f2ff authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Proper way to use lcov packages

Only one .info file can be "packaged" at a time, so do it that way.
This should fix the spontaneous "total_coverage" build failures.
parent a5f84cf6
......@@ -1884,4 +1884,4 @@ total_coverage:
- ./ci_coverage_summary
artifacts:
paths:
- coverage_data
- coverage_summary
#!/bin/bash
cov_dir=coverage_data
cov_file=$cov_dir/coverage_${CI_BUILD_REF}_${CI_BUILD_NAME}.info
prefix=$cov_dir/coverage_${CI_BUILD_REF}_${CI_BUILD_NAME}
mkdir -p $cov_dir/
lcov --capture \
$(find src/ -name "*.gcn[ao]" | xargs -n 1 dirname | sort -u | grep -v ftimings | xargs -n 1 echo --directory) \
--output-file $cov_file
lcov -r $cov_file "/usr/*" -o $cov_file
lcov -r $cov_file "/afs/*" -o $cov_file
lcov -r $cov_file "src/ftimings" -o $cov_file
for dir in $(find -name "*.gcno" -print0 | xargs -0 -n 1 dirname | sort -u); do
dir=${dir#./};
lcov -c -b $PWD -d $dir --to-package $prefix.${dir//\//_}.package;
done
#!/bin/bash
for p in coverage_data/coverage_${CI_BUILD_REF}*.package ; do
cov_file=${p%.package}.info
lcov -c -b $PWD --from-package $p --output-file $cov_file
lcov -r $cov_file "/usr/*" -o $cov_file
lcov -r $cov_file "/afs/*" -o $cov_file
lcov -r $cov_file "src/ftimings" -o $cov_file
done
lcov $(for i in coverage_data/coverage_${CI_BUILD_REF}_*.info; do echo -a $i; done) -o coverage_data/coverage_${CI_BUILD_REF}.info
lcov --summary coverage_data/coverage_${CI_BUILD_REF}.info 2>&1 | \
awk '/lines|functions/ {
......@@ -11,4 +19,6 @@ lcov --summary coverage_data/coverage_${CI_BUILD_REF}.info 2>&1 | \
print "";
}' | \
sed 's/^/__COVERAGE__:/; s/, $//;'
genhtml coverage_data/coverage_${CI_BUILD_REF}.info -o coverage_data
mkdir coverage_summary
genhtml coverage_data/coverage_${CI_BUILD_REF}.info -o coverage_summary
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