generate_code_cov.sh 685 B

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