Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

GCOV

GCOV is a tool you can use in conjunction with GCC to test code coverage in your programs.

...

Build

For building with coverage support you need to add some flags to gcc/g++ compiler and linker:

Code Block
languagebash
g++ -fprofile-arcs -ftest-coverage

#Or simply --coverage, which includes the previous flags
g++ --coverage

...

Code Block
languagebash
#Build ACS
cd ACS
MAKE_GCOV=1 make build

$Build#Build a single module
cd <some_module>/src
MAKE_GCOV=1 make clean all install

As a result, you will have a .gcno file for each compiled .o file in your object directory.

...

Execute

The execution is the same as always, you don't need to use a wrapper application or pass any special flag or environment variable. You can either run an executable manually or use an automated testing system such as TAT.

...