shravan
(Shravan)
April 7, 2022, 11:49am
1
Is there any way to convert below IAR coverage text report into sonarQube generic format(sonar-generic-coverage.xsd)
https://docs.sonarqube.org/latest/analysis/generic-test/
Code Coverage Result
Program “Prime” coverage: 76.19%
±-----------------------------------------+
Module “calc” coverage: 80.00%
Function “is_prime” coverage: 80.00%
Steppoint(s) not covered:
File D:\Documents\IAR Workspace\calc.c
±-----------------------------------------+
Module “io” coverage: 66.67%
Function “io_ask” coverage: 50.00%
Steppoint(s) not covered:
File D:\Documents\IAR Workspace\io.c
Line 12 : Col 9 - 16 addr(0x08003886-0x08003889)
Function “io_report” coverage: 100.00%
±-----------------------------------------+
Module “main” coverage: 80.00%
Function “main” coverage: 80.00%
Steppoint(s) not covered:
File D:\Documents\IAR Workspace\main.c
=============================================
marco.b
(Marco B)
April 7, 2022, 3:54pm
2
Hello @shravan ,
We don’t provide such a feature at the moment. However, I can imagine this should be possible with some work. It might be easier if the coverage report is provided in a machine-friendly format, such as XML. You can get some inspiration from other converters. See for example [Coverage & Test Data] Generate Reports for Apex, C/C++, Objective-C, Go, JS/TS and Python
I hope this helps
shravan
(Shravan)
April 8, 2022, 10:50am
3
Thanks for your quick response.
The coverage report is also available in xml format but not as specified by sonarQube server.
below is xml report for your reference.
<?xml version="1.0" encoding="UTF-8"?>
Prime
85.71
D:\Documents\IAR Workspace\main.c
main
80.00
io_report(prime_candidate, "IS a prime.");
Code range fully covered
0x080038F8-0x080038FF
15
13-54
while((prime_candidate = io_ask()) > 0)
Code range fully covered
0x08003900-0x08003909
12
5-43
if (is_prime(prime_candidate))
Code range fully covered
0x0800390A-0x08003913
14
9-38
io_report(prime_candidate, "IS NOT a prime.");
Code range fully covered
0x08003914-0x0800391D
17
13-58
return 0;
Code range partially covered
0x0800391E-0x0800392B
19
5-13
marco.b
(Marco B)
April 8, 2022, 3:16pm
4
Hello @shravan ,
If you believe this can be useful to other users, I would recommend filling your request under Suggest new features - Sonar Community .
Thanks