added option to open html in google chrome ( on macOS only )

This commit is contained in:
Filip Bucek 2019-11-05 16:44:59 +01:00
parent fcf48c4442
commit 8246ab110d

View File

@ -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 == 1 ]; then fail finished with error; exit 1; else pass "finished all";fi' EXIT trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; 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##*/}"
@ -17,7 +17,7 @@ COVERAGE_FILTER="*Qt*.framework* *Xcode.app* *.moc *moc_*.cpp */test/* *qrc_* ui
main() { main() {
setup setup
testcc testcc "$@"
} }
function setup() { function setup() {
@ -98,7 +98,9 @@ function testcc() {
info "Reseting coverage counts" info "Reseting coverage counts"
"${LCOV}" -d "${COVERAGE_DIR}" -z "${LCOV}" -d "${COVERAGE_DIR}" -z
if [ "$1" == "open" ]; then
open "${HTML_RESULTS_DIR}/index.html" & open "${HTML_RESULTS_DIR}/index.html" &
fi
} }
# ################ # ################