$ gcovr 
(WARNING) GCOV produced the following errors processing /proj/bin/app-config.gcno:
/proj/bin/app-config.gcda:cannot open data file, assuming not executed
Cannot open source file config.c

 

 

gcovr -r ../.. --html-details -o ../../../coverage.html ...

[링크 : https://github.com/gcovr/gcovr/issues/368]

 

GCOVR(1)                                                    User Commands                                                    GCOVR(1)

NAME
       gcovr - generate simple coverage reports

DESCRIPTION
       usage: gcovr [options] [search_paths...]

       A utility to run gcov and summarize the coverage in simple reports.

OPTIONS
       -h, --help
              Show this help message, then exit.

       --version
              Print the version number, then exit.

       -v, --verbose
              Print progress messages. Please include this output in bug reports.

       -r ROOT, --root ROOT
              The  root  directory  of your source files. Defaults to '.', the current directory. File names are reported relative to
              this root. The --root is the default --filter.

 

You can use __gcov_flush() method inside your code. You will need to invoke this from registered signal handler.

[링크 : https://stackoverflow.com/questions/13957649/gcov-not-showing-any-coverage-data]

 

Note the comment by Paweł Bylica -- __gcov_flush() has been removed in GCC 11, you should use __gcov_dump().

[링크 : https://stackoverflow.com/questions/19655479/undefined-reference-to-gcov-flush]

 

 

[링크 : https://educoder.tistory.com/entry/소프트웨어-공학gcov테스트-커버리지-측정]

  [링크 : https://gcovr.com/en/stable/guide.html]

[링크 : https://jchern.tistory.com/16]

[링크 : https://velog.io/@kongsub/GCOV-사용해보기-Lab1-Triangle]

'프로그램 사용 > gcov, gprof' 카테고리의 다른 글

gcov와 gcovr  (0) 2023.07.20
gprof gui  (0) 2023.07.10
gcc -p -pg  (0) 2016.02.25
gprof flat view 이해하기  (0) 2010.01.24
gcov, gprof  (0) 2010.01.23
Posted by 구차니