fix unit test build failed
This commit is contained in:
28
generate_code_cov.sh
Executable file
28
generate_code_cov.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user