jenkinscoberturagcovgcovr

gcovr with jenkins doesn't work


I am trying to produce code coverage report using gcovr from Jenkins but to no avail, it doesn't produce the result but if I run it from terminal, it works fine. here is the command i am executing thru jenkins to generate the same :

gcovr -r /path/to/sourcefiles --object-directory=/Users/testinganywhere1/pathtogcdafile -x -b -e /Developer 1> html/coverage.xml 2>/tmp/Error.txt

If i run the same through terminal it works grt!

thanks for the help!

PS: I am running jenkins on master machine and instructing it to execute the job on slave machine.


Solution

  • You must first go to the object directory before executing it

     cd /Users/testinganywhere1/pathtogcdafile;
     gcovr -r /path/to/sourcefiles --object-directory=/Users/testinganywhere1/pathtogcdafile -x -b -e /Developer 1> html/coverage.xml 2>/tmp/Error.txt