The program I want to profile with gcovr (or gcov/lcov) is located on a shared filesystem, along with the build directory from compiling the program, and I have multiple workers with which I intend to test my program, in parallel. To solve the race condition problem (the workers will all run my program, therefore all generating gcda files, named the same, in the same location on the shared filesystem), I redirect the gcda files to a separate target directory on each worker (as described here), and I have been running the following command:
gcovr -v -r /absolute/path/to/root --html --html-details -o test-details.html --object-directory=/absolute/path/to/object/dir /absolute/path/to/gcda/dir
where the last path is the search_paths
, described here. I expected this to look in /absolute/path/to/root
for the program source, /absolute/path/to/object/dir
for the .o files, and /absolute/path/to/gcda/dir
for the gcda files. However, I ran it with -v
and I'm seeing that gcovr is running gcov commands in the form of this, from the root dir:
gcov /absolute/path/to/gcda/dir/file.gcda --branch-counts --branch-probabilities --preserve-paths --object-directory /absolute/path/to/gcda/dir
Again, I expected it to run in the form of this (look at the --object-directory path):
gcov /absolute/path/to/gcda/dir/file.gcda --branch-counts --branch-probabilities --preserve-paths --object-directory /absolute/path/to/object/dir
It behaves properly when run like the latter command, but gcovr is running the former. I'm only using gcovr instead of gcov because I have a large project (I know gcovr is built off of lcov). Does anyone know why it is behaving like this? (Is this the way it is supposed to run?) How can I make it so it behaves the way I want? Thanks in advance!