1#!/bin/bash 2 3cd `dirname $0` 4 5UT_BUILD_DIR=ut_build 6 7echo '--------- generate initial info ---------------- ' 8lcov -d $UT_BUILD_DIR -z 9lcov -d $UT_BUILD_DIR -b . --no-external --initial -c -o initCoverage.info 10 11echo '--------- run test ---------------- ' 12cd $UT_BUILD_DIR 13ctest --verbose 14cd .. 15 16echo '--------- generate post info ---------------- ' 17lcov -d $UT_BUILD_DIR -b . --no-external -c -o testCoverage.info 18 19echo '--------- generate html report ---------------- ' 20genhtml -o coverageReport --prefix=`pwd` initCoverage.info testCoverage.info 21 22echo 'check report: ' `pwd`/coverageReport/index.html 23 24echo ' ------remove tmp file ------' 25 26rm initCoverage.info 27rm testCoverage.info 28 29