Skip to content

Commit

Permalink
Update generated reports to nightly-2024-01-25
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 25, 2024
1 parent 3802942 commit a7b4a14
Show file tree
Hide file tree
Showing 134 changed files with 721 additions and 721 deletions.
7 changes: 4 additions & 3 deletions src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ type UncoveredLines = BTreeMap<String, Vec<u64>>;

#[non_exhaustive]
#[derive(Clone, Copy)]
#[cfg_attr(test, derive(Debug))]
pub enum CoverageKind {
Functions,
Lines,
Expand Down Expand Up @@ -565,8 +566,8 @@ mod tests {
fn test_get_coverage_percent(kind: CoverageKind) {
let expected = match kind {
CoverageKind::Functions => 100_f64,
CoverageKind::Lines => 68.181_818_181_818_19,
CoverageKind::Regions => 66.666_666_666_666_67,
CoverageKind::Lines => 63.157_894_736_842_1,
CoverageKind::Regions => 60.,
};

// There are 5 different percentages, make sure we pick the correct one.
Expand All @@ -580,7 +581,7 @@ mod tests {
let actual = json.get_coverage_percent(kind).unwrap();

let error_margin = f64::EPSILON;
assert!((actual - expected).abs() < error_margin, "{actual}");
assert!((actual - expected).abs() < error_margin, "kind={kind:?},actual={actual}");
}

#[test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"coverage":{"src/lib.rs":{"1":"1/1","2":"1/1","3":"0/1","5":"1/1","7":"1/1","9":"1/1","10":"1/1","11":"1/1","12":"1/1","15":"1/1"}}}
{"coverage":{"src/lib.rs":{"1":"1/1","2":"1/1","3":"0/1","5":"1/1","7":"1/1","10":"1/1","11":"1/1","12":"1/1","15":"1/1"}}}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
6| | }
7| 1|}
8| |
9| 1|#[test]
9| |#[test]
10| 1|fn test() {
11| 1| #[cfg(a)]
12| 1| assert!(!func(1));
Expand Down
40 changes: 20 additions & 20 deletions tests/fixtures/coverage-reports/cargo_config/cargo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
"percent": 0.0
},
"functions": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100.0
},
"instantiations": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100.0
},
"lines": {
"count": 10,
"covered": 9,
"percent": 90.0
"count": 9,
"covered": 8,
"percent": 88.88888888888889
},
"regions": {
"count": 7,
"covered": 6,
"count": 6,
"covered": 5,
"notcovered": 1,
"percent": 85.71428571428571
"percent": 83.33333333333334
}
}
}
Expand All @@ -43,25 +43,25 @@
"percent": 0
},
"functions": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100
},
"instantiations": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100
},
"lines": {
"count": 10,
"covered": 9,
"percent": 90
"count": 9,
"covered": 8,
"percent": 88.88888888888889
},
"regions": {
"count": 7,
"covered": 6,
"count": 6,
"covered": 5,
"notcovered": 1,
"percent": 85.71428571428571
"percent": 83.33333333333334
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SF:src/lib.rs
FNF:3
FNH:3
FNF:2
FNH:2
BRF:0
BRH:0
LF:10
LH:9
LF:9
LH:8
end_of_record
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover Branches Missed Branches Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
src/lib.rs 7 1 85.71% 3 0 100.00% 10 1 90.00% 0 0 -
src/lib.rs 6 1 83.33% 2 0 100.00% 9 1 88.89% 0 0 -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL 7 1 85.71% 3 0 100.00% 10 1 90.00% 0 0 -
TOTAL 6 1 83.33% 2 0 100.00% 9 1 88.89% 0 0 -
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
6| | }
7| 1|}
8| |
9| 1|#[test]
9| |#[test]
10| 1|fn test() {
11| 1| #[cfg(a)]
12| 1| assert!(!func(1));
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"coverage":{"src/lib.rs":{"1":"1/1","2":"1/1","3":"0/1","5":"1/1","7":"1/1","9":"1/1","10":"1/1","11":"1/1","12":"1/1","15":"1/1"}}}
{"coverage":{"src/lib.rs":{"1":"1/1","2":"1/1","3":"0/1","5":"1/1","7":"1/1","10":"1/1","11":"1/1","12":"1/1","15":"1/1"}}}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
6| | }
7| 1|}
8| |
9| 1|#[test]
9| |#[test]
10| 1|fn test() {
11| 1| #[cfg(a)]
12| 1| assert!(!func(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
"percent": 0.0
},
"functions": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100.0
},
"instantiations": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100.0
},
"lines": {
"count": 10,
"covered": 9,
"percent": 90.0
"count": 9,
"covered": 8,
"percent": 88.88888888888889
},
"regions": {
"count": 7,
"covered": 6,
"count": 6,
"covered": 5,
"notcovered": 1,
"percent": 85.71428571428571
"percent": 83.33333333333334
}
}
}
Expand All @@ -43,25 +43,25 @@
"percent": 0
},
"functions": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100
},
"instantiations": {
"count": 3,
"covered": 3,
"count": 2,
"covered": 2,
"percent": 100
},
"lines": {
"count": 10,
"covered": 9,
"percent": 90
"count": 9,
"covered": 8,
"percent": 88.88888888888889
},
"regions": {
"count": 7,
"covered": 6,
"count": 6,
"covered": 5,
"notcovered": 1,
"percent": 85.71428571428571
"percent": 83.33333333333334
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SF:src/lib.rs
FNF:3
FNH:3
FNF:2
FNH:2
BRF:0
BRH:0
LF:10
LH:9
LF:9
LH:8
end_of_record
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover Branches Missed Branches Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
src/lib.rs 7 1 85.71% 3 0 100.00% 10 1 90.00% 0 0 -
src/lib.rs 6 1 83.33% 2 0 100.00% 9 1 88.89% 0 0 -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL 7 1 85.71% 3 0 100.00% 10 1 90.00% 0 0 -
TOTAL 6 1 83.33% 2 0 100.00% 9 1 88.89% 0 0 -
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
6| | }
7| 1|}
8| |
9| 1|#[test]
9| |#[test]
10| 1|fn test() {
11| 1| #[cfg(a)]
12| 1| assert!(!func(1));
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"coverage":{"src/lib.rs":{"5":"1/1","6":"1/1","7":"1/1","8":"0/1","9":"1/1","10":"0/1","11":"0/1","13":"1/1","15":"1/1"}}}
{"coverage":{"src/lib.rs":{"5":"1/1","6":"1/1","7":"1/1","8":"0/1","9":"1/1","10":"0/1","11":"0/1","13":"1/1"}}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
12| | }
13| 2|}
14| |
15| 1|#[test]
15| |#[test]
16| |fn test() {
17| | func(0);
18| |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
"percent": 0.0
},
"functions": {
"count": 2,
"covered": 2,
"count": 1,
"covered": 1,
"percent": 100.0
},
"instantiations": {
"count": 2,
"covered": 2,
"count": 1,
"covered": 1,
"percent": 100.0
},
"lines": {
"count": 9,
"covered": 6,
"percent": 66.66666666666666
},
"regions": {
"count": 8,
"covered": 5,
"notcovered": 3,
"percent": 62.5
},
"regions": {
"count": 7,
"covered": 4,
"notcovered": 3,
"percent": 57.14285714285714
}
}
}
Expand All @@ -43,25 +43,25 @@
"percent": 0
},
"functions": {
"count": 2,
"covered": 2,
"count": 1,
"covered": 1,
"percent": 100
},
"instantiations": {
"count": 2,
"covered": 2,
"count": 1,
"covered": 1,
"percent": 100
},
"lines": {
"count": 9,
"covered": 6,
"percent": 66.66666666666666
},
"regions": {
"count": 8,
"covered": 5,
"notcovered": 3,
"percent": 62.5
},
"regions": {
"count": 7,
"covered": 4,
"notcovered": 3,
"percent": 57.14285714285714
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SF:src/lib.rs
FNF:2
FNH:2
FNF:1
FNH:1
BRF:0
BRH:0
LF:9
LH:6
LF:8
LH:5
end_of_record
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Filename Regions Missed Regions Cover Functions Missed Functions Executed Lines Missed Lines Cover Branches Missed Branches Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
src/lib.rs 8 3 62.50% 2 0 100.00% 9 3 66.67% 0 0 -
src/lib.rs 7 3 57.14% 1 0 100.00% 8 3 62.50% 0 0 -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL 8 3 62.50% 2 0 100.00% 9 3 66.67% 0 0 -
TOTAL 7 3 57.14% 1 0 100.00% 8 3 62.50% 0 0 -
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
12| | }
13| 2|}
14| |
15| 1|#[test]
15| |#[test]
16| |fn test() {
17| | func(0);
18| |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"coverage":{"src/lib.rs":{"3":"1/1","4":"1/1","5":"1/1","7":"1/1","9":"1/1","11":"1/1","12":"1/1","13":"1/1","14":"1/1","15":"1/1"}}}
{"coverage":{"src/lib.rs":{"3":"1/1","4":"1/1","5":"1/1","7":"1/1","9":"1/1","12":"1/1","13":"1/1","14":"1/1","15":"1/1"}}}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
8| | }
9| 2|}
10| |
11| 1|#[test]
11| |#[test]
12| 1|fn test() {
13| 1| assert!(!func(1_f32));
14| 1| assert!(func(-1_i32));
Expand Down
Loading

0 comments on commit a7b4a14

Please sign in to comment.