/gcov

Primary LanguageHTML

a code coverage tool

inroduction

work flow:

  1. compile and run infoCatchTool.cpp
  • it's the target program we try to get its code coverage
  • This tool is cerated as a mutiple-keyword search tool which can search one or more keywords in a file and you can get lines from target file which includes the keyword(s) you search.
  • how to use it :
[root@localhost gcov]# cat targetFile
1 2 3
2 3 4
3 4 5
4 5 6
[root@localhost gcov]# ./infoCatchTool 3 targetFile
filename is : targetFile
1 2 3
2 3 4
3 4 5
  1. use google gcov and lcov tool to generate a code coverage report
  2. run htmlParser.py
  • this python program can parse the html report and list the usaful information in a file named lineInfo
  1. compile & run report.cpp
  • thie tool can parse file created by python program and generate the final report we want.

makefile

  1. use make to compile & run the programs and generate report automatically
  2. use make clean to remove unwanted intermediate files

TODO

add a tool which can combine report with gitdiff, so that when someone change the code, the report will refresh.

  • change report html file to show changed code coverage situation intuitively