Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Fix sed to not capture line and function coverage #1

Merged
merged 1 commit into from
May 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ FILTERED_COVERAGE_PATH='./lcov_filtered.info'
if [ ! -z "$3" ]; then
echo "Excluding $3 from coverage..."
lcov --remove ${LCOV_PATH} $3 -o ${FILTERED_COVERAGE_PATH}
CODE_COVERAGE=$(lcov --list ${FILTERED_COVERAGE_PATH} | sed -n "s/.*Total:|\(.*\)%.*/\1/p")
CODE_COVERAGE=$(lcov --list ${FILTERED_COVERAGE_PATH} | sed -n "s/.*Total:|\([^%]*\)%.*/\1/p")
else
CODE_COVERAGE=$(lcov --list ${LCOV_PATH} | sed -n "s/.*Total:|\(.*\)%.*/\1/p")
CODE_COVERAGE=$(lcov --list ${LCOV_PATH} | sed -n "s/.*Total:|\([^%]*\)%.*/\1/p")
fi

echo "Minumum Coverage Required: ${MINIMUM_COVERAGE}%"
echo "Current Code Coverage: ${CODE_COVERAGE}%"
if (( $(echo "$CODE_COVERAGE < $2" | bc) )); then exit 1; fi
if (( $(echo "$CODE_COVERAGE < $2" | bc) )); then exit 1; fi