eriwen / lcov-to-cobertura-xml

Converts lcov output to Cobertura-compatible XML for CI
https://eriwen.github.io/lcov-to-cobertura-xml/
Apache License 2.0
187 stars 73 forks source link

Discrepancy with genhtml #26

Open letmaik opened 7 years ago

letmaik commented 7 years ago

When I generate an HTML report with genhtml I get 5623/7013 lines covered in total, which is 80%.

Looking at the xml file produced by this library the root entry has lines-covered="10233" lines-valid="23111", which is 44%.

How can such a situation occur?

Natsuki-gh commented 5 years ago

I have found a discrepancy where the xml and genhtml have a difference about paths taken. With genhtml all lines in my function were executed however in the lcov-to-cobertura-xml not all lines were so marked. looking at the info file there are multiple SF records for the same file: SF:/code/example.c ... DA:100,1 DA:101,1 end_of_record SF:/code/example.c ... DA:100,0 DA:101,0 end_of_record The python script line clears file_lines every SF record. This then replaces file_dict['lines'] at line 120 on end_of_record. i.e. the information is from the last SF record and the information from the previous SF records is lost. I suspect the processing of end_of_record needs to integrate the new data with the existing.