fix unit test build failed

This commit is contained in:
zhangzifa
2019-01-10 16:42:18 +08:00
committed by Jackson Tian
parent 919f98cbdd
commit 21edc7f283
4 changed files with 53 additions and 11 deletions

28
generate_code_cov.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
cd `dirname $0`
UT_BUILD_DIR=ut_build
echo '--------- generate initial info ---------------- '
lcov -d $UT_BUILD_DIR -z
lcov -d $UT_BUILD_DIR -b . --no-external --initial -c -o initCoverage.info
echo '--------- run test ---------------- '
cd $UT_BUILD_DIR
ctest --verbose
cd ..
echo '--------- generate post info ---------------- '
lcov -d $UT_BUILD_DIR -b . --no-external -c -o testCoverage.info
echo '--------- generate html report ---------------- '
genhtml -o coverageReport --prefix=`pwd` initCoverage.info testCoverage.info
echo 'check report: ' `pwd`/coverageReport/index.html
echo ' ------remove tmp file ------'
rm initCoverage.info
rm testCoverage.info