Fix up run-coverage and coverage-map/status-quo tests
This commit is contained in:
parent
726a7b9439
commit
0ca6c38cc2
9 changed files with 45 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
|||
// compile-flags: --edition=2018
|
||||
#![feature(no_coverage)]
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
macro_rules! bail {
|
||||
($msg:literal $(,)?) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// compile-flags: --edition=2018
|
||||
#![feature(no_coverage)]
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
macro_rules! bail {
|
||||
($msg:literal $(,)?) => {
|
||||
|
@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn main() {
|
||||
executor::block_on(test()).unwrap();
|
||||
}
|
||||
|
@ -51,18 +51,18 @@ mod executor {
|
|||
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
|
||||
};
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
pub fn block_on<F: Future>(mut future: F) -> F::Output {
|
||||
let mut future = unsafe { Pin::new_unchecked(&mut future) };
|
||||
use std::hint::unreachable_unchecked;
|
||||
static VTABLE: RawWakerVTable = RawWakerVTable::new(
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // clone
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // wake
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| (),
|
||||
);
|
||||
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
// Enables `no_coverage` on the entire crate
|
||||
#![feature(no_coverage)]
|
||||
// Enables `coverage(off)` on the entire crate
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn do_not_add_coverage_1() {
|
||||
println!("called but not covered");
|
||||
}
|
||||
|
||||
fn do_not_add_coverage_2() {
|
||||
#![no_coverage]
|
||||
#![coverage(off)]
|
||||
println!("called but not covered");
|
||||
}
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
#[allow(dead_code)]
|
||||
fn do_not_add_coverage_not_called() {
|
||||
println!("not called and not covered");
|
||||
|
@ -33,7 +33,7 @@ fn add_coverage_not_called() {
|
|||
// FIXME: These test-cases illustrate confusing results of nested functions.
|
||||
// See https://github.com/rust-lang/rust/issues/93319
|
||||
mod nested_fns {
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
pub fn outer_not_covered(is_true: bool) {
|
||||
fn inner(is_true: bool) {
|
||||
if is_true {
|
||||
|
@ -50,7 +50,7 @@ mod nested_fns {
|
|||
println!("called and covered");
|
||||
inner_not_covered(is_true);
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn inner_not_covered(is_true: bool) {
|
||||
if is_true {
|
||||
println!("called but not covered");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
LL| |// compile-flags: --edition=2018
|
||||
LL| |#![feature(no_coverage)]
|
||||
LL| |#![feature(coverage_attribute)]
|
||||
LL| |
|
||||
LL| |macro_rules! bail {
|
||||
LL| | ($msg:literal $(,)?) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// compile-flags: --edition=2018
|
||||
#![feature(no_coverage)]
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
macro_rules! bail {
|
||||
($msg:literal $(,)?) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
LL| |// compile-flags: --edition=2018
|
||||
LL| |#![feature(no_coverage)]
|
||||
LL| |#![feature(coverage_attribute)]
|
||||
LL| |
|
||||
LL| |macro_rules! bail {
|
||||
LL| | ($msg:literal $(,)?) => {
|
||||
|
@ -40,7 +40,7 @@
|
|||
LL| 1| Ok(())
|
||||
LL| 1|}
|
||||
LL| |
|
||||
LL| |#[no_coverage]
|
||||
LL| |#[coverage(off)]
|
||||
LL| |fn main() {
|
||||
LL| | executor::block_on(test()).unwrap();
|
||||
LL| |}
|
||||
|
@ -52,18 +52,18 @@
|
|||
LL| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
|
||||
LL| | };
|
||||
LL| |
|
||||
LL| | #[no_coverage]
|
||||
LL| | #[coverage(off)]
|
||||
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
|
||||
LL| | let mut future = unsafe { Pin::new_unchecked(&mut future) };
|
||||
LL| | use std::hint::unreachable_unchecked;
|
||||
LL| | static VTABLE: RawWakerVTable = RawWakerVTable::new(
|
||||
LL| | #[no_coverage]
|
||||
LL| | #[coverage(off)]
|
||||
LL| | |_| unsafe { unreachable_unchecked() }, // clone
|
||||
LL| | #[no_coverage]
|
||||
LL| | #[coverage(off)]
|
||||
LL| | |_| unsafe { unreachable_unchecked() }, // wake
|
||||
LL| | #[no_coverage]
|
||||
LL| | #[coverage(off)]
|
||||
LL| | |_| unsafe { unreachable_unchecked() }, // wake_by_ref
|
||||
LL| | #[no_coverage]
|
||||
LL| | #[coverage(off)]
|
||||
LL| | |_| (),
|
||||
LL| | );
|
||||
LL| | let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// compile-flags: --edition=2018
|
||||
#![feature(no_coverage)]
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
macro_rules! bail {
|
||||
($msg:literal $(,)?) => {
|
||||
|
@ -39,7 +39,7 @@ pub async fn test() -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn main() {
|
||||
executor::block_on(test()).unwrap();
|
||||
}
|
||||
|
@ -51,18 +51,18 @@ mod executor {
|
|||
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
|
||||
};
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
pub fn block_on<F: Future>(mut future: F) -> F::Output {
|
||||
let mut future = unsafe { Pin::new_unchecked(&mut future) };
|
||||
use std::hint::unreachable_unchecked;
|
||||
static VTABLE: RawWakerVTable = RawWakerVTable::new(
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // clone
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // wake
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
|_| (),
|
||||
);
|
||||
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
LL| |// Enables `no_coverage` on the entire crate
|
||||
LL| |#![feature(no_coverage)]
|
||||
LL| |// Enables `coverage(off)` on the entire crate
|
||||
LL| |#![feature(coverage_attribute)]
|
||||
LL| |
|
||||
LL| |#[no_coverage]
|
||||
LL| |#[coverage(off)]
|
||||
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| | #![coverage(off)]
|
||||
LL| | println!("called but not covered");
|
||||
LL| |}
|
||||
LL| |
|
||||
LL| |#[no_coverage]
|
||||
LL| |#[coverage(off)]
|
||||
LL| |#[allow(dead_code)]
|
||||
LL| |fn do_not_add_coverage_not_called() {
|
||||
LL| | println!("not called and not covered");
|
||||
|
@ -33,7 +33,7 @@
|
|||
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| | #[coverage(off)]
|
||||
LL| | pub fn outer_not_covered(is_true: bool) {
|
||||
LL| 1| fn inner(is_true: bool) {
|
||||
LL| 1| if is_true {
|
||||
|
@ -50,7 +50,7 @@
|
|||
LL| 1| println!("called and covered");
|
||||
LL| 1| inner_not_covered(is_true);
|
||||
LL| 1|
|
||||
LL| 1| #[no_coverage]
|
||||
LL| 1| #[coverage(off)]
|
||||
LL| 1| fn inner_not_covered(is_true: bool) {
|
||||
LL| 1| if is_true {
|
||||
LL| 1| println!("called but not covered");
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
// Enables `no_coverage` on the entire crate
|
||||
#![feature(no_coverage)]
|
||||
// Enables `coverage(off)` on the entire crate
|
||||
#![feature(coverage_attribute)]
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn do_not_add_coverage_1() {
|
||||
println!("called but not covered");
|
||||
}
|
||||
|
||||
fn do_not_add_coverage_2() {
|
||||
#![no_coverage]
|
||||
#![coverage(off)]
|
||||
println!("called but not covered");
|
||||
}
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
#[allow(dead_code)]
|
||||
fn do_not_add_coverage_not_called() {
|
||||
println!("not called and not covered");
|
||||
|
@ -33,7 +33,7 @@ fn add_coverage_not_called() {
|
|||
// FIXME: These test-cases illustrate confusing results of nested functions.
|
||||
// See https://github.com/rust-lang/rust/issues/93319
|
||||
mod nested_fns {
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
pub fn outer_not_covered(is_true: bool) {
|
||||
fn inner(is_true: bool) {
|
||||
if is_true {
|
||||
|
@ -50,7 +50,7 @@ mod nested_fns {
|
|||
println!("called and covered");
|
||||
inner_not_covered(is_true);
|
||||
|
||||
#[no_coverage]
|
||||
#[coverage(off)]
|
||||
fn inner_not_covered(is_true: bool) {
|
||||
if is_true {
|
||||
println!("called but not covered");
|
||||
|
|
Loading…
Add table
Reference in a new issue