Lcov absolute or relative path

How does lcov decide when to use absolute paths relative to relative paths?

I have a directory appcontaining subdirectories for each of my shared product libraries and subdirectories for multiple binaries. Something like that:

/home/user/app/libfoo/bar
/home/user/app/libfoo/baz
/home/user/app/libqux
/home/user/app/testsuite
/home/user/app/product

However, when going through lcovand, genhtmldirectories are listed as follows:

/home/user/app/libqux
/home/user/app/testsuite
/home/user/app/product
bar
baz

In other words, everything in one of my shared library directories uses a relative path, and everything else uses absolute paths. Why?

My invoction is out lcovand genhtmlquite simple:

cd ~/app
testsuite/run_tests
lcov --capture --directory . --output-file coverage.info --gcov-tool gcov-5 --no-external
genhtml coverage.info --output-directory coverage
+4
source share
1 answer

genhtml --prefix.

   -p prefix
   --prefix prefix
          Remove prefix from all directory names.

          Because lists containing long filenames are difficult  to  read,
          there  is a mechanism implemented that will automatically try to
          shorten all directory names on the overview page beginning  with
          a  common  prefix.  By  default, this is done using an algorithm
          that tries to find the prefix which, when applied, will minimize
          the resulting sum of characters of all directory names.

          Use this option to specify the prefix to be removed by yourself.

/home/user/app/libfoo , genhtml , , , /home/user/app.

--prefix /home/user/app .

+2

Source: https://habr.com/ru/post/1608815/


All Articles