Browse Source

Tools: split coverage script for easier update

c415-sdk
Pierre Kancir 4 years ago committed by Peter Barker
parent
commit
3f204d976e
  1. 19
      Tools/scripts/run-coverage.sh
  2. 23
      Tools/scripts/update-coverage.sh

19
Tools/scripts/run-coverage.sh

@ -39,21 +39,8 @@ rm -rf build
#TODO add any other execution path/s we can to maximise the actually #TODO add any other execution path/s we can to maximise the actually
# used code, can we run other tests or things? Replay, perhaps? # used code, can we run other tests or things? Replay, perhaps?
REPORT_DIR="reports/lcov-report" SCRIPT=$(readlink -f "$0")
rm -rf "$REPORT_DIR" SCRIPTPATH=$(dirname "$SCRIPT")
mkdir -p "$REPORT_DIR"
INFO_FILE="$REPORT_DIR/lcov.info" $SCRIPTPATH/update-coverage.sh
LCOV_LOG="GCOV_lcov.log"
GENHTML_LOG="GCOV_genhtml.log"
lcov --no-external --capture --directory $PWD -o "$INFO_FILE" 2>&1 | tee $LCOV_LOG
# remove files we do not intentionally test:
lcov --remove "$INFO_FILE" ".waf*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
lcov --remove "$INFO_FILE" "$PWD/modules/gtest/*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
lcov --remove "$INFO_FILE" "$PWD/build/linux/libraries/*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
genhtml "$INFO_FILE" -o "$REPORT_DIR" 2>&1 | tee $GENHTML_LOG
echo "Coverage successful. Open $REPORT_DIR/index.html"

23
Tools/scripts/update-coverage.sh

@ -0,0 +1,23 @@
#!/bin/sh
set -e
set -x
REPORT_DIR="reports/lcov-report"
rm -rf "$REPORT_DIR"
mkdir -p "$REPORT_DIR"
INFO_FILE="$REPORT_DIR/lcov.info"
LCOV_LOG="GCOV_lcov.log"
GENHTML_LOG="GCOV_genhtml.log"
lcov --no-external --capture --directory $PWD -o "$INFO_FILE" 2>&1 | tee $LCOV_LOG
# remove files we do not intentionally test:
lcov --remove "$INFO_FILE" ".waf*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
lcov --remove "$INFO_FILE" "$PWD/modules/gtest/*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
lcov --remove "$INFO_FILE" "$PWD/build/linux/libraries/*" -o "$INFO_FILE" 2>&1 | tee -a $LCOV_LOG
genhtml "$INFO_FILE" -o "$REPORT_DIR" 2>&1 | tee $GENHTML_LOG
echo "Coverage successful. Open $REPORT_DIR/index.html"
Loading…
Cancel
Save