Code coverage with ccache

Last edited on

ccache is a compiler cache which accelerates the recompilation of a program. To use CoverageScanner with ccache, it is necessary to set the PATH variable as follows:

export PATH=/opt/SquishCoco/wrapper/bin:/opt/ccache/bin:$PATH

Create then (as root user) the ccache wrappers for g++ and gcc:

$ mkdir -p /opt/ccache/bin
$ ln -s /usr/bin/ccache /opt/ccache/bin/g++
$ ln -s /usr/bin/ccache /opt/ccache/bin/gcc

Which this configuration, calling gcc will:

  1. call CoverageScanner’s gcc wrapper,
  2. which calls ccache’s gcc wrapper,
  3. which finally calls the real gcc binary.