|
actually it doesn't work with stable project either. I tried different ways to invoque gcovr: If I use the "-r" option which define the root project (it will set the source section in the generated cobertura report and files path are relative), cobertura fails during the build, the report is created but sources aren't available + gcovr -x -r /var/lib/hudson/jobs/testgcov/workspace -o coverage.xml without the -r (the sources path section isn't defined and files path are full path), there is no error during the build but sources aren't available coverage.xml is generated at the root directory of my build (here hudson/jobs/testgcov/workspace/coverage.xml) I use version 0.8.1 of the plugin alright, I think I've found the problem, the way gcovr fill the field filename of nodes "class" is a little buggy, causing filename begining by "/" <class branch-rate="0.5" complexity="0.0" filename="/main.cpp" line-rate="0.714285714286" name="main_cpp"> it seems that hudson plugin doesn't like this, I think it try to create folder with empty name. It might be resolved by changing in gcovr plugin, in function print_xml_report c.setAttribute("filename", dir+os.sep+fname) This has been solved. The XML data, generated by gcovr, must be modified to include the node <sources> (under the node <coverage>) with the appropriate sub-nodes <source>, as in: <coverage> where path1 and path2 are relative paths off of your repository root view. Furthermore, the node <class>, attribute "filename" in the generated XML (under the nodes <classes>) must be modified to just include the source code file name found in any of the relative paths, as in: <classes> |
|||||||||||||||||||||||||||||||||||||
At the time when you experienced this issue, was the project's build "unstable" (yellow ball icon)? If so, this is likely a duplicate of issue 4803.