diff options
Diffstat (limited to 'tools/infrastructure/collect_coverage.sh')
-rwxr-xr-x | tools/infrastructure/collect_coverage.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/infrastructure/collect_coverage.sh b/tools/infrastructure/collect_coverage.sh new file mode 100755 index 0000000000..47559e6c47 --- /dev/null +++ b/tools/infrastructure/collect_coverage.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +BUILD_DIR=$1 +COVERAGE_DIR=$BUILD_DIR/coverage +REPORTS_DIR=$BUILD_DIR/coverage_reports + +if [ "$BUILD_DIR" = "" ] +then + echo "You should specify your build directory as first argument " + echo "Example:" + echo "\t\$ collect_coverage.sh [PATH TO BUILD DIR]" + exit +fi + + +rm -rf $COVERAGE_DIR +rm -rf $REPORTS_DIR - + +mkdir $COVERAGE_DIR +lcov --quiet --capture --directory . --output-file $COVERAGE_DIR/full_report.info +lcov --quiet --remove $COVERAGE_DIR/full_report.info '/usr/*' '*/test/*' '*/src/3rd*' '*/build/src/*' --output-file $COVERAGE_DIR/coverage.info + +mkdir $REPORTS_DIR +genhtml --quiet $COVERAGE_DIR/coverage.info --output-directory $REPORTS_DIR +html2text -width 150 $REPORTS_DIR/index.html +tar -zcf coverage_report.tar.gz $REPORTS_DIR +echo More information avaliable in $REPORTS_DIR/index.html |