mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 15:30:36 +02:00
updating scripts
This commit is contained in:
parent
e04bddeb13
commit
1468ddf54d
@ -3,37 +3,25 @@
|
|||||||
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ "$LASTRES" -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" == "true" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
||||||
|
|
||||||
#trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" -eq "1" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
|
||||||
|
|
||||||
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
DIRNAME="${SRCDIR##*/}"
|
DIRNAME="${SRCDIR##*/}"
|
||||||
SOURCE_DIR=$PWD
|
SOURCE_DIR=$PWD
|
||||||
PRO_FILE=$(find . -d 1 -type f -name "*.pro")
|
PRO_FILE=$(find . -d 1 -type f -name "*.pro")
|
||||||
|
|
||||||
BUILDPATH=$SOURCE_DIR"/../build/testcc"
|
BUILDPATH=$SOURCE_DIR"/build/testcc"
|
||||||
COVERAGE_DIR=$SOURCE_DIR"/../build/testcc-info"
|
COVERAGE_DIR=$SOURCE_DIR"/build/testcc-info"
|
||||||
HTML_RESULTS_DIR=$SOURCE_DIR"/../build/testcc-html"
|
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++* */server-sdk/*"
|
COVERAGE_FILTER="*Qt*.framework* *Xcode.app* *.moc *moc_*.cpp */test/* *qrc_* ui_* *qt.headers */build/* *main*.* *c++*"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
setup
|
|
||||||
testcc "$@"
|
testcc "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup() {
|
|
||||||
mkdir -p $BUILDPATH
|
|
||||||
|
|
||||||
GIT=`git -C "$SRCDIR" describe --tags --always`
|
|
||||||
GITSTATUS=`git status --porcelain`
|
|
||||||
GITMOD=""
|
|
||||||
if [ ! -z "$GITSTATUS" ]; then
|
|
||||||
GITMOD="-modified"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function testcc() {
|
function testcc() {
|
||||||
if [ ! -d src ]; then
|
if [ ! -d src ]; then
|
||||||
fail "src dir does not exists"
|
fail "src dir does not exists"
|
||||||
@ -103,7 +91,7 @@ function testcc() {
|
|||||||
${LCOV} -d ${BUILDPATH} -c -o ${COVERAGE_DIR}/coverage.info
|
${LCOV} -d ${BUILDPATH} -c -o ${COVERAGE_DIR}/coverage.info
|
||||||
|
|
||||||
info "Filtering code coverage info report"
|
info "Filtering code coverage info report"
|
||||||
${LCOV} -r ${COVERAGE_DIR}/coverage.info $COVERAGE_FILTER -o ${COVERAGE_DIR}/coverage-filtered.info
|
${LCOV} -r ${COVERAGE_DIR}/coverage.info $COVERAGE_FILTER $ENV_COVERAGE_FILTER -o ${COVERAGE_DIR}/coverage-filtered.info
|
||||||
|
|
||||||
info "Creating html output"
|
info "Creating html output"
|
||||||
mkdir -p ${HTML_RESULTS_DIR}
|
mkdir -p ${HTML_RESULTS_DIR}
|
||||||
@ -135,7 +123,7 @@ function pass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fail() {
|
function fail() {
|
||||||
FAIL=1; echo -e "[${RED}FAIL${NC}] $@"
|
FAIL="true"; echo -e "[${RED}FAIL${NC}] $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run main function
|
# Run main function
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" -eq "1" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ "$LASTRES" -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" == "true" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
||||||
|
|
||||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
DIRNAME="${CURRENT_DIR##*/}"
|
DIRNAME="${CURRENT_DIR##*/}"
|
||||||
@ -49,7 +49,7 @@ function pass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fail() {
|
function fail() {
|
||||||
FAIL=1; echo -e "[${RED}FAIL${NC}] $@"
|
FAIL="true"; echo -e "[${RED}FAIL${NC}] $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run main function
|
# Run main function
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
# @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" -eq "1" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ "$LASTRES" -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" == "true" ]; then fail finished with error; exit 1; else pass "finished";fi' EXIT
|
||||||
|
|
||||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
DIR_NAME="${CURRENT_DIR##*/}"
|
DIR_NAME="${CURRENT_DIR##*/}"
|
||||||
@ -61,7 +61,7 @@ function pass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fail() {
|
function fail() {
|
||||||
FAIL=1; echo -e "[${RED}FAIL${NC}] $@"
|
FAIL="true"; echo -e "[${RED}FAIL${NC}] $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user