I am using gcov for a c++ test executable that spawns a child process. The child process contains a shared object library.The test process, child process, and the shared object library are all compiled in separate directories. I am using the -fprofile-arcs -ftest-coverage flags for compilation and linking. When I compile, I get .gcno files for the child process and the shared library. But when I run the executable, I am only able to get coverage output for the parent process.
My question is, are there any special steps to getting coverage of this child process with its shared library?
The gcc help forum question here (regarding gcov with shared object libraries) explains that the shared library must be built in the same directory as the one you are running your executable.
Does this mean that in order to get test coverage, I must compile every component(parent test process, child process, and shared object library) in the same directory?