From 8246ab110dcc1168856c45b5ca69190b9ba22a61 Mon Sep 17 00:00:00 2001 From: Filip Bucek Date: Tue, 5 Nov 2019 16:44:59 +0100 Subject: [PATCH] added option to open html in google chrome ( on macOS only ) --- scripts/codecoverage.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/codecoverage.sh b/scripts/codecoverage.sh index 27e8fda..5c49b4b 100755 --- a/scripts/codecoverage.sh +++ b/scripts/codecoverage.sh @@ -3,7 +3,7 @@ # @see https://intoli.com/blog/exit-on-errors-in-bash-scripts/ 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 )" DIRNAME="${SRCDIR##*/}" @@ -17,7 +17,7 @@ COVERAGE_FILTER="*Qt*.framework* *Xcode.app* *.moc *moc_*.cpp */test/* *qrc_* ui main() { setup - testcc + testcc "$@" } function setup() { @@ -97,8 +97,10 @@ function testcc() { info "Reseting coverage counts" "${LCOV}" -d "${COVERAGE_DIR}" -z - - open "${HTML_RESULTS_DIR}/index.html" & + + if [ "$1" == "open" ]; then + open "${HTML_RESULTS_DIR}/index.html" & + fi } # ################