Remove bench-tps, upload-perf, and bench-streamer from code coverage report
This commit is contained in:
parent
cb0560df92
commit
c24d95c885
|
@ -35,29 +35,31 @@ _ scripts/fetch-grcov.sh
|
||||||
echo "--- grcov"
|
echo "--- grcov"
|
||||||
./grcov target/cov/debug/deps/ > target/cov/lcov-full.info
|
./grcov target/cov/debug/deps/ > target/cov/lcov-full.info
|
||||||
|
|
||||||
echo "--- filter-non-local-files-from-lcov"
|
echo "--- filter-files-from-lcov"
|
||||||
# TODO: The grcov `-s` option could be used to replace this function once grcov
|
|
||||||
# doesn't panic on files with the same name in different directories of a
|
# List of directories to remove from the coverage report
|
||||||
# repository
|
ignored_directories="^(bench-tps|upload-perf|bench-streamer)"
|
||||||
filter-non-local-files-from-lcov() {
|
|
||||||
|
filter-files-from-lcov() {
|
||||||
declare skip=false
|
declare skip=false
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
if [[ $line =~ ^SF:/ ]]; then
|
if [[ $line =~ ^SF:/ ]]; then
|
||||||
skip=true # Skip all absolute paths as these are references into ~/.cargo
|
skip=true # Skip all absolute paths as these are references into ~/.cargo
|
||||||
elif [[ $line =~ ^SF:(.*) ]]; then
|
elif [[ $line =~ ^SF:(.*) ]]; then
|
||||||
# Skip relative paths that don't exist
|
|
||||||
declare file="${BASH_REMATCH[1]}"
|
declare file="${BASH_REMATCH[1]}"
|
||||||
if [[ -r $file ]]; then
|
if [[ $file =~ $ignored_directories ]]; then
|
||||||
|
skip=true # Skip paths into ignored locations
|
||||||
|
elif [[ -r $file ]]; then
|
||||||
skip=false
|
skip=false
|
||||||
else
|
else
|
||||||
skip=true
|
skip=true # Skip relative paths that don't exist
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
[[ $skip = true ]] || echo "$line"
|
[[ $skip = true ]] || echo "$line"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
filter-non-local-files-from-lcov < target/cov/lcov-full.info > target/cov/lcov.info
|
filter-files-from-lcov < target/cov/lcov-full.info > target/cov/lcov.info
|
||||||
|
|
||||||
echo "--- html report"
|
echo "--- html report"
|
||||||
# ProTip: genhtml comes from |brew install lcov| or |apt-get install lcov|
|
# ProTip: genhtml comes from |brew install lcov| or |apt-get install lcov|
|
||||||
|
|
Loading…
Reference in New Issue