updating code-coverage.sh script

This commit is contained in:
Filip Bucek 2019-11-06 13:42:01 +01:00
parent afe3d755c9
commit 4f10653051

View File

@ -9,7 +9,6 @@ trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ "$LASTRES" -ne 0 ]]; then fail "Comm
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIRNAME="${SRCDIR##*/}"
SOURCE_DIR=$PWD
PRO_FILE=$(find . -d 1 -type f -name "*.pro")
BUILDPATH=$SOURCE_DIR"/build/testcc"
COVERAGE_DIR=$SOURCE_DIR"/build/testcc-info"
@ -17,17 +16,23 @@ HTML_RESULTS_DIR=$SOURCE_DIR"/build/testcc-html"
COVERAGE_FILTER="*Qt*.framework* *Xcode.app* *.moc *moc_*.cpp */test/* *qrc_* ui_* *qt.headers */build/* *main*.* *c++*"
main() {
info "Getting .pro file"
PRO_FILE=$(find . -d 1 -type f -name "*.pro")
# Ensuring server-sdk wont be filtered out for server-sdk
NAME=$( basename $PWD )
if [ "$NAME" != "server-sdk" ]; then
COVERAGE_FILTER+=" *server-sdk*"
fi
# Ensuring 'src' dir exists
if [ ! -d src ]; then
fail "'src' dir does not exists. ${BLUE}Expecting 'src' dir with c++ source code${NC}"
fail "'src' dir does not exists. ${BLUE}Expecting 'src' dir with c++ source code${NC}"
else
pass "src dir exits"
fi
# Ensuring PRO_FILE exists
if [ ! -f $PRO_FILE ]; then
fail ".pro file does not exists: " $PRO_FILE
else