Skip to content

Commit 0ca6c38

Browse files
committed
Fix up run-coverage and coverage-map/status-quo tests
1 parent 726a7b9 commit 0ca6c38

9 files changed

+45
-45
lines changed

Diff for: tests/coverage-map/status-quo/closure_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: --edition=2018
2-
#![feature(no_coverage)]
2+
#![feature(coverage_attribute)]
33

44
macro_rules! bail {
55
($msg:literal $(,)?) => {

Diff for: tests/coverage-map/status-quo/closure_macro_async.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: --edition=2018
2-
#![feature(no_coverage)]
2+
#![feature(coverage_attribute)]
33

44
macro_rules! bail {
55
($msg:literal $(,)?) => {
@@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
3939
Ok(())
4040
}
4141

42-
#[no_coverage]
42+
#[coverage(off)]
4343
fn main() {
4444
executor::block_on(test()).unwrap();
4545
}
@@ -51,18 +51,18 @@ mod executor {
5151
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
5252
};
5353

54-
#[no_coverage]
54+
#[coverage(off)]
5555
pub fn block_on<F: Future>(mut future: F) -> F::Output {
5656
let mut future = unsafe { Pin::new_unchecked(&mut future) };
5757
use std::hint::unreachable_unchecked;
5858
static VTABLE: RawWakerVTable = RawWakerVTable::new(
59-
#[no_coverage]
59+
#[coverage(off)]
6060
|_| unsafe { unreachable_unchecked() }, // clone
61-
#[no_coverage]
61+
#[coverage(off)]
6262
|_| unsafe { unreachable_unchecked() }, // wake
63-
#[no_coverage]
63+
#[coverage(off)]
6464
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
65-
#[no_coverage]
65+
#[coverage(off)]
6666
|_| (),
6767
);
6868
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };

Diff for: tests/coverage-map/status-quo/no_cov_crate.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// Enables `no_coverage` on the entire crate
2-
#![feature(no_coverage)]
1+
// Enables `coverage(off)` on the entire crate
2+
#![feature(coverage_attribute)]
33

4-
#[no_coverage]
4+
#[coverage(off)]
55
fn do_not_add_coverage_1() {
66
println!("called but not covered");
77
}
88

99
fn do_not_add_coverage_2() {
10-
#![no_coverage]
10+
#![coverage(off)]
1111
println!("called but not covered");
1212
}
1313

14-
#[no_coverage]
14+
#[coverage(off)]
1515
#[allow(dead_code)]
1616
fn do_not_add_coverage_not_called() {
1717
println!("not called and not covered");
@@ -33,7 +33,7 @@ fn add_coverage_not_called() {
3333
// FIXME: These test-cases illustrate confusing results of nested functions.
3434
// See https://github.com/rust-lang/rust/issues/93319
3535
mod nested_fns {
36-
#[no_coverage]
36+
#[coverage(off)]
3737
pub fn outer_not_covered(is_true: bool) {
3838
fn inner(is_true: bool) {
3939
if is_true {
@@ -50,7 +50,7 @@ mod nested_fns {
5050
println!("called and covered");
5151
inner_not_covered(is_true);
5252

53-
#[no_coverage]
53+
#[coverage(off)]
5454
fn inner_not_covered(is_true: bool) {
5555
if is_true {
5656
println!("called but not covered");

Diff for: tests/run-coverage/closure_macro.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LL| |// compile-flags: --edition=2018
2-
LL| |#![feature(no_coverage)]
2+
LL| |#![feature(coverage_attribute)]
33
LL| |
44
LL| |macro_rules! bail {
55
LL| | ($msg:literal $(,)?) => {

Diff for: tests/run-coverage/closure_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: --edition=2018
2-
#![feature(no_coverage)]
2+
#![feature(coverage_attribute)]
33

44
macro_rules! bail {
55
($msg:literal $(,)?) => {

Diff for: tests/run-coverage/closure_macro_async.coverage

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LL| |// compile-flags: --edition=2018
2-
LL| |#![feature(no_coverage)]
2+
LL| |#![feature(coverage_attribute)]
33
LL| |
44
LL| |macro_rules! bail {
55
LL| | ($msg:literal $(,)?) => {
@@ -40,7 +40,7 @@
4040
LL| 1| Ok(())
4141
LL| 1|}
4242
LL| |
43-
LL| |#[no_coverage]
43+
LL| |#[coverage(off)]
4444
LL| |fn main() {
4545
LL| | executor::block_on(test()).unwrap();
4646
LL| |}
@@ -52,18 +52,18 @@
5252
LL| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
5353
LL| | };
5454
LL| |
55-
LL| | #[no_coverage]
55+
LL| | #[coverage(off)]
5656
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
5757
LL| | let mut future = unsafe { Pin::new_unchecked(&mut future) };
5858
LL| | use std::hint::unreachable_unchecked;
5959
LL| | static VTABLE: RawWakerVTable = RawWakerVTable::new(
60-
LL| | #[no_coverage]
60+
LL| | #[coverage(off)]
6161
LL| | |_| unsafe { unreachable_unchecked() }, // clone
62-
LL| | #[no_coverage]
62+
LL| | #[coverage(off)]
6363
LL| | |_| unsafe { unreachable_unchecked() }, // wake
64-
LL| | #[no_coverage]
64+
LL| | #[coverage(off)]
6565
LL| | |_| unsafe { unreachable_unchecked() }, // wake_by_ref
66-
LL| | #[no_coverage]
66+
LL| | #[coverage(off)]
6767
LL| | |_| (),
6868
LL| | );
6969
LL| | let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };

Diff for: tests/run-coverage/closure_macro_async.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: --edition=2018
2-
#![feature(no_coverage)]
2+
#![feature(coverage_attribute)]
33

44
macro_rules! bail {
55
($msg:literal $(,)?) => {
@@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
3939
Ok(())
4040
}
4141

42-
#[no_coverage]
42+
#[coverage(off)]
4343
fn main() {
4444
executor::block_on(test()).unwrap();
4545
}
@@ -51,18 +51,18 @@ mod executor {
5151
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
5252
};
5353

54-
#[no_coverage]
54+
#[coverage(off)]
5555
pub fn block_on<F: Future>(mut future: F) -> F::Output {
5656
let mut future = unsafe { Pin::new_unchecked(&mut future) };
5757
use std::hint::unreachable_unchecked;
5858
static VTABLE: RawWakerVTable = RawWakerVTable::new(
59-
#[no_coverage]
59+
#[coverage(off)]
6060
|_| unsafe { unreachable_unchecked() }, // clone
61-
#[no_coverage]
61+
#[coverage(off)]
6262
|_| unsafe { unreachable_unchecked() }, // wake
63-
#[no_coverage]
63+
#[coverage(off)]
6464
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
65-
#[no_coverage]
65+
#[coverage(off)]
6666
|_| (),
6767
);
6868
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };

Diff for: tests/run-coverage/no_cov_crate.coverage

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
LL| |// Enables `no_coverage` on the entire crate
2-
LL| |#![feature(no_coverage)]
1+
LL| |// Enables `coverage(off)` on the entire crate
2+
LL| |#![feature(coverage_attribute)]
33
LL| |
4-
LL| |#[no_coverage]
4+
LL| |#[coverage(off)]
55
LL| |fn do_not_add_coverage_1() {
66
LL| | println!("called but not covered");
77
LL| |}
88
LL| |
99
LL| |fn do_not_add_coverage_2() {
10-
LL| | #![no_coverage]
10+
LL| | #![coverage(off)]
1111
LL| | println!("called but not covered");
1212
LL| |}
1313
LL| |
14-
LL| |#[no_coverage]
14+
LL| |#[coverage(off)]
1515
LL| |#[allow(dead_code)]
1616
LL| |fn do_not_add_coverage_not_called() {
1717
LL| | println!("not called and not covered");
@@ -33,7 +33,7 @@
3333
LL| |// FIXME: These test-cases illustrate confusing results of nested functions.
3434
LL| |// See https://github.com/rust-lang/rust/issues/93319
3535
LL| |mod nested_fns {
36-
LL| | #[no_coverage]
36+
LL| | #[coverage(off)]
3737
LL| | pub fn outer_not_covered(is_true: bool) {
3838
LL| 1| fn inner(is_true: bool) {
3939
LL| 1| if is_true {
@@ -50,7 +50,7 @@
5050
LL| 1| println!("called and covered");
5151
LL| 1| inner_not_covered(is_true);
5252
LL| 1|
53-
LL| 1| #[no_coverage]
53+
LL| 1| #[coverage(off)]
5454
LL| 1| fn inner_not_covered(is_true: bool) {
5555
LL| 1| if is_true {
5656
LL| 1| println!("called but not covered");

Diff for: tests/run-coverage/no_cov_crate.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// Enables `no_coverage` on the entire crate
2-
#![feature(no_coverage)]
1+
// Enables `coverage(off)` on the entire crate
2+
#![feature(coverage_attribute)]
33

4-
#[no_coverage]
4+
#[coverage(off)]
55
fn do_not_add_coverage_1() {
66
println!("called but not covered");
77
}
88

99
fn do_not_add_coverage_2() {
10-
#![no_coverage]
10+
#![coverage(off)]
1111
println!("called but not covered");
1212
}
1313

14-
#[no_coverage]
14+
#[coverage(off)]
1515
#[allow(dead_code)]
1616
fn do_not_add_coverage_not_called() {
1717
println!("not called and not covered");
@@ -33,7 +33,7 @@ fn add_coverage_not_called() {
3333
// FIXME: These test-cases illustrate confusing results of nested functions.
3434
// See https://github.com/rust-lang/rust/issues/93319
3535
mod nested_fns {
36-
#[no_coverage]
36+
#[coverage(off)]
3737
pub fn outer_not_covered(is_true: bool) {
3838
fn inner(is_true: bool) {
3939
if is_true {
@@ -50,7 +50,7 @@ mod nested_fns {
5050
println!("called and covered");
5151
inner_not_covered(is_true);
5252

53-
#[no_coverage]
53+
#[coverage(off)]
5454
fn inner_not_covered(is_true: bool) {
5555
if is_true {
5656
println!("called but not covered");

0 commit comments

Comments
 (0)