test-coverage.sh 466 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. action=$1
  3. if [ $action == "init" ]; then
  4. echo 'init coverage'
  5. lcov -d sdk_build -z
  6. lcov -d sdk_build -b . --no-external --initial -c -o initCoverage.info
  7. fi
  8. echo 'run test'
  9. cd sdk_build
  10. ctest
  11. cd ..
  12. echo 'create info after test'
  13. lcov -d sdk_build -b . --no-external -c -o testCoverage.info
  14. echo 'generate html'
  15. genhtml -o coverageReport --prefix=`pwd` initCoverage.info testCoverage.info
  16. echo 'check report ' `pwd`/coverageReport/index.html