Rollup merge of #131400 - Zalathar:ignore-coverage, r=jieyouxu
Simplify the compiletest directives for ignoring coverage-test modes Follow-up to #131346. Given that these directives are now restricted to ignoring coverage-test modes only, we can drop the clunky `ignore-mode-*` naming convention, and just call them `ignore-coverage-map` and `ignore-coverage-run`. r? jieyouxu
This commit is contained in:
commit
bb7232ec1c
@ -42,6 +42,8 @@
|
|||||||
"ignore-cdb",
|
"ignore-cdb",
|
||||||
"ignore-compare-mode-next-solver",
|
"ignore-compare-mode-next-solver",
|
||||||
"ignore-compare-mode-polonius",
|
"ignore-compare-mode-polonius",
|
||||||
|
"ignore-coverage-map",
|
||||||
|
"ignore-coverage-run",
|
||||||
"ignore-cross-compile",
|
"ignore-cross-compile",
|
||||||
"ignore-debug",
|
"ignore-debug",
|
||||||
"ignore-eabi",
|
"ignore-eabi",
|
||||||
@ -64,8 +66,6 @@
|
|||||||
"ignore-loongarch64",
|
"ignore-loongarch64",
|
||||||
"ignore-macabi",
|
"ignore-macabi",
|
||||||
"ignore-macos",
|
"ignore-macos",
|
||||||
"ignore-mode-coverage-map",
|
|
||||||
"ignore-mode-coverage-run",
|
|
||||||
"ignore-msp430",
|
"ignore-msp430",
|
||||||
"ignore-msvc",
|
"ignore-msvc",
|
||||||
"ignore-musl",
|
"ignore-musl",
|
||||||
|
@ -217,13 +217,10 @@ macro_rules! condition {
|
|||||||
}
|
}
|
||||||
// Coverage tests run the same test file in multiple modes.
|
// Coverage tests run the same test file in multiple modes.
|
||||||
// If a particular test should not be run in one of the modes, ignore it
|
// If a particular test should not be run in one of the modes, ignore it
|
||||||
// with "ignore-mode-coverage-map" or "ignore-mode-coverage-run".
|
// with "ignore-coverage-map" or "ignore-coverage-run".
|
||||||
condition! {
|
condition! {
|
||||||
name: format!("mode-{}", config.mode.to_str()),
|
name: config.mode.to_str(),
|
||||||
allowed_names: ContainsPrefixed {
|
allowed_names: ["coverage-map", "coverage-run"],
|
||||||
prefix: "mode-",
|
|
||||||
inner: ["coverage-run", "coverage-map"],
|
|
||||||
},
|
|
||||||
message: "when the test mode is {name}",
|
message: "when the test mode is {name}",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,17 +572,15 @@ fn families() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ignore_mode() {
|
fn ignore_coverage() {
|
||||||
for mode in ["coverage-map", "coverage-run"] {
|
// Indicate profiler support so that "coverage-run" tests aren't skipped.
|
||||||
// Indicate profiler support so that "coverage-run" tests aren't skipped.
|
let config = cfg().mode("coverage-map").profiler_support(true).build();
|
||||||
let config: Config = cfg().mode(mode).profiler_support(true).build();
|
assert!(check_ignore(&config, "//@ ignore-coverage-map"));
|
||||||
let other = if mode == "coverage-run" { "coverage-map" } else { "coverage-run" };
|
assert!(!check_ignore(&config, "//@ ignore-coverage-run"));
|
||||||
|
|
||||||
assert_ne!(mode, other);
|
let config = cfg().mode("coverage-run").profiler_support(true).build();
|
||||||
|
assert!(!check_ignore(&config, "//@ ignore-coverage-map"));
|
||||||
assert!(check_ignore(&config, &format!("//@ ignore-mode-{mode}")));
|
assert!(check_ignore(&config, "//@ ignore-coverage-run"));
|
||||||
assert!(!check_ignore(&config, &format!("//@ ignore-mode-{other}")));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
LL| |//@ edition: 2021
|
LL| |//@ edition: 2021
|
||||||
LL| |//@ ignore-mode-coverage-map
|
LL| |//@ ignore-coverage-map
|
||||||
LL| |//@ ignore-windows
|
LL| |//@ ignore-windows
|
||||||
LL| |//@ llvm-cov-flags: --use-color
|
LL| |//@ llvm-cov-flags: --use-color
|
||||||
LL| |
|
LL| |
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ edition: 2021
|
//@ edition: 2021
|
||||||
//@ ignore-mode-coverage-map
|
//@ ignore-coverage-map
|
||||||
//@ ignore-windows
|
//@ ignore-windows
|
||||||
//@ llvm-cov-flags: --use-color
|
//@ llvm-cov-flags: --use-color
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
LL| |//@ ignore-mode-coverage-map
|
LL| |//@ ignore-coverage-map
|
||||||
LL| |
|
LL| |
|
||||||
LL| 1|fn main() {}
|
LL| 1|fn main() {}
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
//@ ignore-mode-coverage-map
|
//@ ignore-coverage-map
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
//@ ignore-mode-coverage-run
|
//@ ignore-coverage-run
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user