Hello all,
This post belongs to the closed topic:
forum.segger.com/index.php/Thr…verage-report-on-Jenkins/
We currently have the same problem to get the Ozone code coverage output in shape for jenkins usage. In my opinion the topic was closed without solving the problem .
Does Anybody have a solution to convert such a code coverage txt outputfile like this...:
Display All
...in a cobertura xml.
For example.... this is how a proper Cobertura xml file looks like:
Display All
Greetings
Joe
This post belongs to the closed topic:
forum.segger.com/index.php/Thr…verage-report-on-Jenkins/
We currently have the same problem to get the Ozone code coverage output in shape for jenkins usage. In my opinion the topic was closed without solving the problem .
Does Anybody have a solution to convert such a code coverage txt outputfile like this...:
Brainfuck Source Code
- Ozone Code Profile Report
- Project: Start\SEGGER_CortexM_Trace_Reference_Board.jdebug
- Application: Start/Output/Debug NoOS NoSystemInit/SEGGER Cortex-M Trace Reference Board.elf
- Code Coverage Summary
- Module/Function | Source Lines | Instructions
- ------------------+-------------------------------------+-------------------------------------
- BSP.c | |
- BSP_Init | 9 / 9 100.0% | 93 / 93 100.0%
- BSP_SetLED | 3 / 4 75.0% | 25 / 27 92.6%
- BSP_ToggleLED | 5 / 6 83.3% | 56 / 58 96.6%
- TraceDemo.c | |
- _TestFunc0 | 5 / 6 83.3% | 18 / 19 94.7%
- _TestFunc0a | 3 / 3 100.0% | 11 / 11 100.0%
- _TestFunc0b | 3 / 3 100.0% | 9 / 9 100.0%
- _TestFunc1 | 4 / 5 80.0% | 19 / 20 95.0%
- _TestFunc2 | 5 / 5 100.0% | 18 / 18 100.0%
- main | 10 / 11 90.9% | 44 / 45 97.8%
- ------------------+-------------------------------------+-------------------------------------
- Total | 47 / 52 90.4% | 293 / 300 97.7%
For example.... this is how a proper Cobertura xml file looks like:
XML Source Code
- <?xml version="1.0"?>
- <!--DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-03.dtd"-->
- <coverage line-rate="0.9" branch-rate="0.75" version="1.9" timestamp="1187350905008">
- <sources>
- <source>C:/local/mvn-coverage-example/src/main/java</source>
- <source>--source</source>
- </sources>
- <packages>
- <package name="" line-rate="1.0" branch-rate="1.0" complexity="1.0">
- <classes>
- <class name="Main" filename="Main.java" line-rate="1.0" branch-rate="1.0" complexity="1.0">
- <methods>
- <method name="<init>" signature="()V" line-rate="1.0" branch-rate="1.0">
- <lines>
- <line number="10" hits="3" branch="false"/>
- </lines>
- </method>
- <method name="doSearch" signature="()V" line-rate="1.0" branch-rate="1.0">
- <lines>
- <line number="23" hits="3" branch="false"/>
- <line number="25" hits="3" branch="false"/>
- <line number="26" hits="3" branch="false"/>
- <line number="28" hits="3" branch="false"/>
- <line number="29" hits="3" branch="false"/>
- <line number="30" hits="3" branch="false"/>
- </lines>
- </method>
- <method name="main" signature="([Ljava/lang/String;)V" line-rate="1.0" branch-rate="1.0">
- <lines>
- <line number="16" hits="3" branch="false"/>
- <line number="17" hits="3" branch="false"/>
- <line number="18" hits="3" branch="false"/>
- <line number="19" hits="3" branch="false"/>
- </lines>
- </method>
- </methods>
- <lines>
- <line number="10" hits="3" branch="false"/>
- <line number="16" hits="3" branch="false"/>
- <line number="17" hits="3" branch="false"/>
- <line number="18" hits="3" branch="false"/>
- <line number="19" hits="3" branch="false"/>
- <line number="23" hits="3" branch="false"/>
- <line number="25" hits="3" branch="false"/>
- <line number="26" hits="3" branch="false"/>
- <line number="28" hits="3" branch="false"/>
- <line number="29" hits="3" branch="false"/>
- <line number="30" hits="3" branch="false"/>
- </lines>
- </class>
- </classes>
- </package>
- <package name="search" line-rate="0.8421052631578947" branch-rate="0.75" complexity="3.25">
- <classes>
- <class name="search.BinarySearch" filename="search/BinarySearch.java" line-rate="0.9166666666666666" branch-rate="0.8333333333333334" complexity="3.0">
- <methods>
- <method name="<init>" signature="()V" line-rate="1.0" branch-rate="1.0">
- <lines>
- <line number="12" hits="3" branch="false"/>
- </lines>
- </method>
- <method name="find" signature="([II)I" line-rate="0.9090909090909091" branch-rate="0.8333333333333334">
- <lines>
- <line number="16" hits="3" branch="false"/>
- <line number="18" hits="12" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="20" hits="9" branch="false"/>
- <line number="21" hits="9" branch="false"/>
- <line number="23" hits="9" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="24" hits="0" branch="false"/>
- <line number="25" hits="9" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="26" hits="6" branch="false"/>
- <line number="28" hits="3" branch="false"/>
- <line number="29" hits="9" branch="false"/>
- <line number="31" hits="3" branch="false"/>
- </lines>
- </method>
- </methods>
- <lines>
- <line number="12" hits="3" branch="false"/>
- <line number="16" hits="3" branch="false"/>
- <line number="18" hits="12" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="20" hits="9" branch="false"/>
- <line number="21" hits="9" branch="false"/>
- <line number="23" hits="9" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="24" hits="0" branch="false"/>
- <line number="25" hits="9" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="26" hits="6" branch="false"/>
- <line number="28" hits="3" branch="false"/>
- <line number="29" hits="9" branch="false"/>
- <line number="31" hits="3" branch="false"/>
- </lines>
- </class>
- <class name="search.ISortedArraySearch" filename="search/ISortedArraySearch.java" line-rate="1.0" branch-rate="1.0" complexity="1.0">
- <methods>
- </methods>
- <lines>
- </lines>
- </class>
- <class name="search.LinearSearch" filename="search/LinearSearch.java" line-rate="0.7142857142857143" branch-rate="0.6666666666666666" complexity="6.0">
- <methods>
- <method name="<init>" signature="()V" line-rate="1.0" branch-rate="1.0">
- <lines>
- <line number="9" hits="3" branch="false"/>
- </lines>
- </method>
- <method name="find" signature="([II)I" line-rate="0.6666666666666666" branch-rate="0.6666666666666666">
- <lines>
- <line number="13" hits="9" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="15" hits="9" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="16" hits="3" branch="false"/>
- <line number="17" hits="6" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="19" hits="0" branch="false"/>
- <line number="24" hits="0" branch="false"/>
- </lines>
- </method>
- </methods>
- <lines>
- <line number="9" hits="3" branch="false"/>
- <line number="13" hits="9" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="15" hits="9" branch="true" condition-coverage="100% (2/2)">
- <conditions>
- <condition number="0" type="jump" coverage="100%"/>
- </conditions>
- </line>
- <line number="16" hits="3" branch="false"/>
- <line number="17" hits="6" branch="true" condition-coverage="50% (1/2)">
- <conditions>
- <condition number="0" type="jump" coverage="50%"/>
- </conditions>
- </line>
- <line number="19" hits="0" branch="false"/>
- <line number="24" hits="0" branch="false"/>
- </lines>
- </class>
- </classes>
- </package>
- </packages>
- </coverage>
Joe