Closed epi052 closed 2 years ago
I also have this issue with an lcov file generated by grcov of a rust program.
The following extracted lcov lines contain multiple occurence of the comma ,
character:
FN:132,<std::sync::mutex::Mutex<std::collections::hash::map::HashMap<alloc::string::String, gecse_rust::dispatcher::GECSEAppDefinition>> as gecse_rust::workflow_controller::TryInsert<alloc::string::String, gecse_rust::dispatcher::GECSEAppDefinition>>::try_insert::<<gecse_rust::workflow_controller::WorkflowController>::register_workflow::{closure#0}>
FNDA:1,<std::sync::mutex::Mutex<std::collections::hash::map::HashMap<alloc::string::String, gecse_rust::dispatcher::GECSEAppDefinition>> as gecse_rust::workflow_controller::TryInsert<alloc::string::String, gecse_rust::dispatcher::GECSEAppDefinition>>::try_insert::<<gecse_rust::workflow_controller::WorkflowController>::register_workflow::{closure#0}>
EDIT: This PR fixes my issue and I can use the created cobertura xml file for the Gitlab Test Coverage Visualization :+1: . Thank you, @epi052. :bow:
I just ran into the exact same problem (grcov-generated lcov file with extra commas due to Rust generics), this patch fixed it for me.
It would be cleaner to use a released version, though - any chance you might look at this and merge it, @eriwen? Thanks.
when an entry such as
is encountered and processed using
line_parts[-1].strip().split(',')
, an exception is thrown:Added the maxsplit option to two split calls that solved the problem for my project.