mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-05 11:57:43 +03:00
allow class lines to be optional in coverage xml
This commit is contained in:
parent
e8aa25e332
commit
aa144e68c6
1 changed files with 5 additions and 3 deletions
|
@ -60,7 +60,7 @@ struct Class {
|
||||||
name: String,
|
name: String,
|
||||||
#[serde(rename = "@filename")]
|
#[serde(rename = "@filename")]
|
||||||
filename: String,
|
filename: String,
|
||||||
lines: Lines,
|
lines: Option<Lines>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
|
@ -148,9 +148,11 @@ impl From<RawCoverage> for Coverage {
|
||||||
for package in coverage.packages.package {
|
for package in coverage.packages.package {
|
||||||
for class in package.classes.class {
|
for class in package.classes.class {
|
||||||
let mut lines = HashMap::new();
|
let mut lines = HashMap::new();
|
||||||
for line in class.lines.line {
|
if let Some(class_lines) = class.lines {
|
||||||
|
for line in class_lines.line {
|
||||||
lines.insert(line.number - 1, line.hits > 0);
|
lines.insert(line.number - 1, line.hits > 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for source in &coverage.sources.source {
|
for source in &coverage.sources.source {
|
||||||
// it is ambiguous to which source a coverage class might belong
|
// it is ambiguous to which source a coverage class might belong
|
||||||
// so check each in the path
|
// so check each in the path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue