gcov
Code coverage analysis and profiling tool that discovers untested parts of a program. Also displays a copy of source code annotated with execution frequencies of code segments.
More info →Options (5)
-a, --all-blocksbooleanWrite individual execution counts for every basic block
gcov {{[-a|--all-blocks]}} {{path/to/file.cpp}}-b, --branch-probabilitiesbooleanWrite branch frequencies to the output file and print summary information to `stdout` as a percentage
gcov {{[-b|--branch-probabilities]}} {{path/to/file.cpp}}-c, --branch-countsbooleanWrite branch frequencies as the number of branches taken, rather than the percentage
gcov {{[-c|--branch-counts]}} {{path/to/file.cpp}}-n, --no-outputbooleanDo not create a `gcov` output file
gcov {{[-n|--no-output]}} {{path/to/file.cpp}}-f, --function-summariesbooleanWrite file level as well as function level summaries
gcov {{[-f|--function-summaries]}} {{path/to/file.cpp}}Examples (6)
Generate a coverage report named `file.cpp.gcov`
gcov path/to/file.cppWrite individual execution counts for every basic block
gcov [-a|--all-blocks] path/to/file.cppWrite branch frequencies to the output file and print summary information to `stdout` as a percentage
gcov [-b|--branch-probabilities] path/to/file.cppWrite branch frequencies as the number of branches taken, rather than the percentage
gcov [-c|--branch-counts] path/to/file.cppDo not create a `gcov` output file
gcov [-n|--no-output] path/to/file.cppWrite file level as well as function level summaries
gcov [-f|--function-summaries] path/to/file.cpp