make script more flexible on the cmd line

This commit is contained in:
Hans Dembinski 2019-06-08 22:57:58 +02:00
parent 83a271fa38
commit 87d2f31d4a

View File

@ -24,11 +24,17 @@ $LCOV --base-directory `pwd` \
# remove uninteresting entries # remove uninteresting entries
$LCOV --extract coverage.info "*/boost/histogram/*" --output-file coverage.info $LCOV --extract coverage.info "*/boost/histogram/*" --output-file coverage.info
if [ -n $CI ] || [ -n $CODECOV_TOKEN ]; then if [ $CI ] || [ $1 ]; then
# upload if on CI # upload if on CI or when token is passed as argument
curl -s https://codecov.io/bash > tools/codecov if [ ! -e tools/codecov ]; then
chmod u+x tools/codecov curl -s https://codecov.io/bash > tools/codecov
tools/codecov -f coverage.info -X gcov chmod u+x tools/codecov
fi
if [ $1 ]; then
tools/codecov -f coverage.info -X gcov -t $1
else
tools/codecov -f coverage.info -X gcov
fi
else else
# otherwise generate html report # otherwise generate html report
$LCOV_DIR/bin/genhtml coverage.info -o coverage-report $LCOV_DIR/bin/genhtml coverage.info -o coverage-report