-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coverage_attribute has been stabilized
- Loading branch information
Showing
16 changed files
with
265 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/fixtures/coverage-reports/coverage_helper/coverage_helper.codecov.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}}} | ||
{"coverage":{"src/lib.rs":{"3":"1/1","4":"1/1","5":"1/1","6":"0/1","7":"1/1","8":"0/1","9":"0/1","11":"1/1"}}} |
44 changes: 21 additions & 23 deletions
44
tests/fixtures/coverage-reports/coverage_helper/coverage_helper.hide-instantiations.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
1| |#![cfg_attr(coverage_nightly, feature(coverage_attribute))] | ||
1| |use coverage_helper::test; | ||
2| | | ||
3| |use coverage_helper::test; | ||
4| | | ||
5| 2|fn func(x: i32) { | ||
6| 2| match x { | ||
7| 1| 0 => {} | ||
8| 0| 1 => {} | ||
9| 1| 2 => {} | ||
10| 0| 3 => {} | ||
11| 0| _ => {} | ||
12| | } | ||
13| 2|} | ||
14| | | ||
15| |#[test] | ||
16| |fn test() { | ||
17| | func(0); | ||
18| | | ||
19| | if false { | ||
20| | func(1); | ||
21| | } else { | ||
22| | func(2); | ||
23| | } | ||
24| |} | ||
3| 2|fn func(x: i32) { | ||
4| 2| match x { | ||
5| 1| 0 => {} | ||
6| 0| 1 => {} | ||
7| 1| 2 => {} | ||
8| 0| 3 => {} | ||
9| 0| _ => {} | ||
10| | } | ||
11| 2|} | ||
12| | | ||
13| |#[test] | ||
14| |fn test() { | ||
15| | func(0); | ||
16| | | ||
17| | if false { | ||
18| | func(1); | ||
19| | } else { | ||
20| | func(2); | ||
21| | } | ||
22| |} |
44 changes: 21 additions & 23 deletions
44
tests/fixtures/coverage-reports/coverage_helper/coverage_helper.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
1| |#![cfg_attr(coverage_nightly, feature(coverage_attribute))] | ||
1| |use coverage_helper::test; | ||
2| | | ||
3| |use coverage_helper::test; | ||
4| | | ||
5| 2|fn func(x: i32) { | ||
6| 2| match x { | ||
7| 1| 0 => {} | ||
8| 0| 1 => {} | ||
9| 1| 2 => {} | ||
10| 0| 3 => {} | ||
11| 0| _ => {} | ||
12| | } | ||
13| 2|} | ||
14| | | ||
15| |#[test] | ||
16| |fn test() { | ||
17| | func(0); | ||
18| | | ||
19| | if false { | ||
20| | func(1); | ||
21| | } else { | ||
22| | func(2); | ||
23| | } | ||
24| |} | ||
3| 2|fn func(x: i32) { | ||
4| 2| match x { | ||
5| 1| 0 => {} | ||
6| 0| 1 => {} | ||
7| 1| 2 => {} | ||
8| 0| 3 => {} | ||
9| 0| _ => {} | ||
10| | } | ||
11| 2|} | ||
12| | | ||
13| |#[test] | ||
14| |fn test() { | ||
15| | func(0); | ||
16| | | ||
17| | if false { | ||
18| | func(1); | ||
19| | } else { | ||
20| | func(2); | ||
21| | } | ||
22| |} |
2 changes: 1 addition & 1 deletion
2
tests/fixtures/coverage-reports/no_coverage/no_cfg_coverage.codecov.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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","6":"0/1","7":"0/1","8":"0/1","9":"0/1","11":"1/1","15":"1/1","16":"1/1","17":"1/1","18":"1/2","19":"0/1","20":"1/2","21":"1/1","26":"1/1","27":"1/2","28":"0/1","29":"0/1","30":"1/2","31":"1/1","39":"1/1","40":"1/2","41":"0/1","42":"1/2","43":"1/1"}}} | ||
{"coverage":{"src/lib.rs":{"1":"1/1","2":"1/1","3":"1/1","4":"0/1","5":"0/1","6":"0/1","7":"0/1","9":"1/1","24":"1/1","25":"1/2","26":"0/1","27":"0/1","28":"1/2","29":"1/1"}}} |
85 changes: 41 additions & 44 deletions
85
tests/fixtures/coverage-reports/no_coverage/no_cfg_coverage.hide-instantiations.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
1| |#![cfg_attr(coverage, feature(coverage_attribute))] | ||
2| | | ||
3| 1|fn func(x: i32) { | ||
4| 1| match x { | ||
5| 1| 0 => {} | ||
6| 0| 1 => {} | ||
7| 0| 2 => {} | ||
8| 0| 3 => {} | ||
9| 0| _ => {} | ||
10| | } | ||
11| 1|} | ||
12| | | ||
13| |#[cfg_attr(coverage, coverage(off))] | ||
14| |#[test] | ||
15| 1|fn fn_level() { | ||
16| 1| func(0); | ||
17| 1| | ||
18| 1| if false { | ||
19| 0| func(1); | ||
20| 1| } | ||
21| 1|} | ||
22| | | ||
23| |// #[coverage(off)] has no effect on expressions. | ||
24| |// now error by rustc: error[E0788]: attribute should be applied to a function definition or closure | ||
25| |#[test] | ||
26| 1|fn expr_level() { | ||
27| 1| if false { | ||
28| 0| // #[cfg_attr(coverage, coverage(off))] | ||
29| 0| func(2); | ||
30| 1| } | ||
31| 1|} | ||
32| | | ||
33| |// #[coverage(off)] has no effect on modules. | ||
34| |#[cfg_attr(coverage, coverage(off))] | ||
35| |mod mod_level { | ||
36| | use super::func; | ||
37| | | ||
38| | #[test] | ||
39| 1| fn mod_level() { | ||
40| 1| if false { | ||
41| 0| func(3); | ||
42| 1| } | ||
43| 1| } | ||
44| |} | ||
1| 1|fn func(x: i32) { | ||
2| 1| match x { | ||
3| 1| 0 => {} | ||
4| 0| 1 => {} | ||
5| 0| 2 => {} | ||
6| 0| 3 => {} | ||
7| 0| _ => {} | ||
8| | } | ||
9| 1|} | ||
10| | | ||
11| |#[coverage(off)] | ||
12| |#[test] | ||
13| |fn fn_level() { | ||
14| | func(0); | ||
15| | | ||
16| | if false { | ||
17| | func(1); | ||
18| | } | ||
19| |} | ||
20| | | ||
21| |// #[coverage(off)] has no effect on expressions. | ||
22| |// now error by rustc: error[E0788]: attribute should be applied to a function definition or closure | ||
23| |#[test] | ||
24| 1|fn expr_level() { | ||
25| 1| if false { | ||
26| 0| // #[coverage(off)] | ||
27| 0| func(2); | ||
28| 1| } | ||
29| 1|} | ||
30| | | ||
31| |#[coverage(off)] | ||
32| |mod mod_level { | ||
33| | use super::func; | ||
34| | | ||
35| | #[test] | ||
36| | fn mod_level() { | ||
37| | if false { | ||
38| | func(3); | ||
39| | } | ||
40| | } | ||
41| |} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
tests/fixtures/coverage-reports/no_coverage/no_cfg_coverage.lcov.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
SF:src/lib.rs | ||
FNF:4 | ||
FNH:4 | ||
FNF:2 | ||
FNH:2 | ||
BRF:0 | ||
BRH:0 | ||
LF:26 | ||
LH:18 | ||
LF:14 | ||
LH:8 | ||
end_of_record |
4 changes: 2 additions & 2 deletions
4
tests/fixtures/coverage-reports/no_coverage/no_cfg_coverage.summary.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 19 7 63.16% 4 0 100.00% 26 8 69.23% 0 0 - | ||
src/lib.rs 11 5 54.55% 2 0 100.00% 14 6 57.14% 0 0 - | ||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
TOTAL 19 7 63.16% 4 0 100.00% 26 8 69.23% 0 0 - | ||
TOTAL 11 5 54.55% 2 0 100.00% 14 6 57.14% 0 0 - |
Oops, something went wrong.