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

Commit

Permalink
fix: parse line coverage only (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nef10 authored May 31, 2020
1 parent 91efcfc commit a3d5c9c
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit a3d5c9c

Please sign in to comment.