编译时添加选项: gcc -fprofile-arcs -ftest-coverage -o test test.c
运行得到覆盖率结果:./test
产生分析报告:gcov test.c
=>
File 'test.c'
Lines executed:??% (行覆盖率) of ?? (总行数)
转载于:https://blog.51cto.com/crkzh/1102519
编译时添加选项: gcc -fprofile-arcs -ftest-coverage -o test test.c
运行得到覆盖率结果:./test
产生分析报告:gcov test.c
=>
File 'test.c'
Lines executed:??% (行覆盖率) of ?? (总行数)
转载于:https://blog.51cto.com/crkzh/1102519