Skip to main content



      Home
Home » Archived » Hudson » Cobertura plugin not understanding my XML
Cobertura plugin not understanding my XML [message #1722066] Tue, 02 February 2016 09:59 Go to next message
Eclipse UserFriend
I am trying to add code coverage step for a new language. I have created a cobertura XML file with lots of content and the Hudson plugin finds it and displays some info, but not much (showing only methods as covered (40%), all other statistics are listed as N/A or 0/0) . It displays file listings, but no lines are colored even though many lines are having hits in the XML file. I suspect that I am producing slightly incompatible XML file. It is surprisingly hard to find information about the exact syntax and semantics of the Cobertura XML file fields as expected by the Hudson plugin. Maybe you could direct me to the correct pages, or maybe you can see something obviously wrong in this excerpt from my XML:

<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="0.288095" branch-rate="0.254671" lines-covered="9005" lines-valid="31257" branches-covered="2181" branches-valid="8564" ccn="0.0" version="1.9" timestamp="1454335628">
	<sources>
		<source>D:/HBT/workspace/MyProductTrunkBuildWin/Production/BuildProducts/Windows/x64/Release/MyProductResources/MyProductCore/StdLib</source>
	</sources>
	<packages>
		<package name="MyProductCore" line-rate="0.288095" branch-rate="0.254671" complexity="0.0">
			<classes>
				<class name="graph/graphs.proc" filename="graph/graphs.proc" line-rate="0.119565" branch-rate="0.0642202" complexity="0.0">
					<methods>
						<method name="graph::FindConnectedComponents" signature="()" line-rate="0.958333" branch-rate="1">
							<lines>
								<line number="582" hits="1" />
								<line number="583" hits="1" />
								<line number="586" hits="1" />
								<line number="588" hits="1" />
								<line number="591" hits="1" />
								<line number="592" hits="1" />
								<line number="593" hits="1" />
								<line number="595" hits="21" branch = "true" condition-coverage="100% (2/2)"/>
								<line number="597" hits="20" branch = "true" condition-coverage="100% (2/2)"/>
								<line number="598" hits="18" />
								<line number="599" hits="0" />
								<line number="601" hits="2" />
								<line number="602" hits="2" />
								<line number="604" hits="11" branch = "true" condition-coverage="100% (2/2)"/>
								<line number="606" hits="9" />
								<line number="607" hits="9" />
								<line number="609" hits="9" />
								<line number="610" hits="9" />
								<line number="611" hits="2" />
								<line number="612" hits="9" />
								<line number="614" hits="1" />
								<line number="615" hits="1" />
								<line number="617" hits="1" />
								<line number="618" hits="1" />
							</lines>
						</method>
						<method name="graph::Degrees" signature="()" line-rate="0" branch-rate="0">
							<lines>
								<line number="350" hits="0" />
								<line number="351" hits="0" />
								<line number="352" hits="0" />
							</lines>
						</method>
						<!-- snipped 37,000 lines -->
					</methods>
				</class>
			</classes>
		</package>
	</packages>
</coverage>


Re: Cobertura plugin not understanding my XML [message #1722444 is a reply to message #1722066] Thu, 04 February 2016 16:04 Go to previous message
Eclipse UserFriend
Meanwhile, we were able to solve the problem. For reference: the problem was that I overlooked the need to duplicate all <lines> nodes inside <method> also inside the <class> node. No idea why this duplication is needed.
Previous Topic:how to omit building steps
Next Topic:No artifacts are recorded. Is this a Maven project?
Goto Forum:
  


Current Time: Sun Jul 13 08:39:48 EDT 2025

Powered by FUDForum. Page generated in 0.08028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top