diff options
author | Alexander <AKutsan@luxoft.com> | 2016-04-16 16:02:40 +0300 |
---|---|---|
committer | Alexander <AKutsan@luxoft.com> | 2016-04-21 15:08:51 +0300 |
commit | 88bdbd48fb9200aee15c37d3ed8dc8397825b1c7 (patch) | |
tree | 8fdc6d101cbe0746e346e80a86f394bde64a3513 /tools/Utils | |
parent | 8a3bc784250db1a4de988c9c23ff08355db55833 (diff) | |
download | sdl_core-88bdbd48fb9200aee15c37d3ed8dc8397825b1c7.tar.gz |
Create script for code coverage automatisation
Diffstat (limited to 'tools/Utils')
-rwxr-xr-x | tools/Utils/collect_coverage.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/Utils/collect_coverage.sh b/tools/Utils/collect_coverage.sh new file mode 100755 index 0000000000..b2fefda6d6 --- /dev/null +++ b/tools/Utils/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 --capture --directory . --output-file $COVERAGE_DIR/full_report.info +lcov --remove $COVERAGE_DIR/full_report.info '/usr/*' '*/test/*' */src/3rd* '*/build/src/*' --output-file $COVERAGE_DIR/coverage.info + +mkdir $REPORTS_DIR +genhtml $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 |