summaryrefslogtreecommitdiffstats
path: root/tests/run-coverage/no_cov_crate.coverage
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/run-coverage/no_cov_crate.coverage
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-coverage/no_cov_crate.coverage')
-rw-r--r--tests/run-coverage/no_cov_crate.coverage172
1 files changed, 86 insertions, 86 deletions
diff --git a/tests/run-coverage/no_cov_crate.coverage b/tests/run-coverage/no_cov_crate.coverage
index 83a920413..c34dbde88 100644
--- a/tests/run-coverage/no_cov_crate.coverage
+++ b/tests/run-coverage/no_cov_crate.coverage
@@ -1,87 +1,87 @@
- 1| |// Enables `no_coverage` on the entire crate
- 2| |#![feature(no_coverage)]
- 3| |
- 4| |#[no_coverage]
- 5| |fn do_not_add_coverage_1() {
- 6| | println!("called but not covered");
- 7| |}
- 8| |
- 9| |fn do_not_add_coverage_2() {
- 10| | #![no_coverage]
- 11| | println!("called but not covered");
- 12| |}
- 13| |
- 14| |#[no_coverage]
- 15| |fn do_not_add_coverage_not_called() {
- 16| | println!("not called and not covered");
- 17| |}
- 18| |
- 19| 1|fn add_coverage_1() {
- 20| 1| println!("called and covered");
- 21| 1|}
- 22| |
- 23| 1|fn add_coverage_2() {
- 24| 1| println!("called and covered");
- 25| 1|}
- 26| |
- 27| 0|fn add_coverage_not_called() {
- 28| 0| println!("not called but covered");
- 29| 0|}
- 30| |
- 31| |// FIXME: These test-cases illustrate confusing results of nested functions.
- 32| |// See https://github.com/rust-lang/rust/issues/93319
- 33| |mod nested_fns {
- 34| | #[no_coverage]
- 35| | pub fn outer_not_covered(is_true: bool) {
- 36| 1| fn inner(is_true: bool) {
- 37| 1| if is_true {
- 38| 1| println!("called and covered");
- 39| 1| } else {
- 40| 0| println!("absolutely not covered");
- 41| 0| }
- 42| 1| }
- 43| | println!("called but not covered");
- 44| | inner(is_true);
- 45| | }
- 46| |
- 47| 1| pub fn outer(is_true: bool) {
- 48| 1| println!("called and covered");
- 49| 1| inner_not_covered(is_true);
- 50| 1|
- 51| 1| #[no_coverage]
- 52| 1| fn inner_not_covered(is_true: bool) {
- 53| 1| if is_true {
- 54| 1| println!("called but not covered");
- 55| 1| } else {
- 56| 1| println!("absolutely not covered");
- 57| 1| }
- 58| 1| }
- 59| 1| }
- 60| |
- 61| 1| pub fn outer_both_covered(is_true: bool) {
- 62| 1| println!("called and covered");
- 63| 1| inner(is_true);
- 64| 1|
- 65| 1| fn inner(is_true: bool) {
- 66| 1| if is_true {
- 67| 1| println!("called and covered");
- 68| 1| } else {
- 69| 0| println!("absolutely not covered");
- 70| 0| }
- 71| 1| }
- 72| 1| }
- 73| |}
- 74| |
- 75| 1|fn main() {
- 76| 1| let is_true = std::env::args().len() == 1;
- 77| 1|
- 78| 1| do_not_add_coverage_1();
- 79| 1| do_not_add_coverage_2();
- 80| 1| add_coverage_1();
- 81| 1| add_coverage_2();
- 82| 1|
- 83| 1| nested_fns::outer_not_covered(is_true);
- 84| 1| nested_fns::outer(is_true);
- 85| 1| nested_fns::outer_both_covered(is_true);
- 86| 1|}
+ LL| |// Enables `no_coverage` on the entire crate
+ LL| |#![feature(no_coverage)]
+ LL| |
+ LL| |#[no_coverage]
+ LL| |fn do_not_add_coverage_1() {
+ LL| | println!("called but not covered");
+ LL| |}
+ LL| |
+ LL| |fn do_not_add_coverage_2() {
+ LL| | #![no_coverage]
+ LL| | println!("called but not covered");
+ LL| |}
+ LL| |
+ LL| |#[no_coverage]
+ LL| |fn do_not_add_coverage_not_called() {
+ LL| | println!("not called and not covered");
+ LL| |}
+ LL| |
+ LL| 1|fn add_coverage_1() {
+ LL| 1| println!("called and covered");
+ LL| 1|}
+ LL| |
+ LL| 1|fn add_coverage_2() {
+ LL| 1| println!("called and covered");
+ LL| 1|}
+ LL| |
+ LL| 0|fn add_coverage_not_called() {
+ LL| 0| println!("not called but covered");
+ LL| 0|}
+ LL| |
+ LL| |// FIXME: These test-cases illustrate confusing results of nested functions.
+ LL| |// See https://github.com/rust-lang/rust/issues/93319
+ LL| |mod nested_fns {
+ LL| | #[no_coverage]
+ LL| | pub fn outer_not_covered(is_true: bool) {
+ LL| 1| fn inner(is_true: bool) {
+ LL| 1| if is_true {
+ LL| 1| println!("called and covered");
+ LL| 1| } else {
+ LL| 0| println!("absolutely not covered");
+ LL| 0| }
+ LL| 1| }
+ LL| | println!("called but not covered");
+ LL| | inner(is_true);
+ LL| | }
+ LL| |
+ LL| 1| pub fn outer(is_true: bool) {
+ LL| 1| println!("called and covered");
+ LL| 1| inner_not_covered(is_true);
+ LL| 1|
+ LL| 1| #[no_coverage]
+ LL| 1| fn inner_not_covered(is_true: bool) {
+ LL| 1| if is_true {
+ LL| 1| println!("called but not covered");
+ LL| 1| } else {
+ LL| 1| println!("absolutely not covered");
+ LL| 1| }
+ LL| 1| }
+ LL| 1| }
+ LL| |
+ LL| 1| pub fn outer_both_covered(is_true: bool) {
+ LL| 1| println!("called and covered");
+ LL| 1| inner(is_true);
+ LL| 1|
+ LL| 1| fn inner(is_true: bool) {
+ LL| 1| if is_true {
+ LL| 1| println!("called and covered");
+ LL| 1| } else {
+ LL| 0| println!("absolutely not covered");
+ LL| 0| }
+ LL| 1| }
+ LL| 1| }
+ LL| |}
+ LL| |
+ LL| 1|fn main() {
+ LL| 1| let is_true = std::env::args().len() == 1;
+ LL| 1|
+ LL| 1| do_not_add_coverage_1();
+ LL| 1| do_not_add_coverage_2();
+ LL| 1| add_coverage_1();
+ LL| 1| add_coverage_2();
+ LL| 1|
+ LL| 1| nested_fns::outer_not_covered(is_true);
+ LL| 1| nested_fns::outer(is_true);
+ LL| 1| nested_fns::outer_both_covered(is_true);
+ LL| 1|}