Suppose I build my project with coverage on machine A. Copy executables of the project into machine B. Tests are run using these executables on machine B. Is there a way to collect coverage results for these runs?
Asked
Active
Viewed 388 times
1 Answers
0
I think you can achieve this by using -fprofile-generate flag while compiling and linking. So when you compile you will get .gcno files generated in your Machine A. Now you transfer your executables to Machine B and run the executable. This will create .gcda files in the path you have provided in -fprofile-generate flag in Machine B.
Now simply transfer your .gcda files back to Machine A(where your .gcno files are)and run gcov , it will give you the coverage report for the run on Machine B.
Hope this helps.

VVish
- 251
- 4
- 11