compiletest: add specific //@ ignore-auxiliary
for test support files
This is for files that *participate* in actual tests but should not be built by `compiletest` (i.e. these files are involved through `mod xxx;` or `include!()` or `#[path = "xxx"]`, etc.). A specialized directive like `//@ ignore-auxiliary` makes it way easier to audit disabled tests via `//@ ignore-test`.
This commit is contained in:
parent
79a272c640
commit
d20f848478
3 changed files with 11 additions and 0 deletions
|
@ -44,6 +44,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
|
|||
"ignore-arm-unknown-linux-gnueabihf",
|
||||
"ignore-arm-unknown-linux-musleabi",
|
||||
"ignore-arm-unknown-linux-musleabihf",
|
||||
"ignore-auxiliary",
|
||||
"ignore-avr",
|
||||
"ignore-beta",
|
||||
"ignore-cdb",
|
||||
|
|
|
@ -100,6 +100,10 @@ fn parse_cfg_name_directive<'a>(
|
|||
name: "test",
|
||||
message: "always"
|
||||
}
|
||||
condition! {
|
||||
name: "auxiliary",
|
||||
message: "used by another main test file"
|
||||
}
|
||||
condition! {
|
||||
name: &config.target,
|
||||
allowed_names: &target_cfgs.all_targets,
|
||||
|
|
|
@ -940,3 +940,9 @@ fn test_supported_crate_types() {
|
|||
"//@ needs-crate-type: bin, cdylib, dylib, lib, proc-macro, rlib, staticlib"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ignore_auxiliary() {
|
||||
let config = cfg().build();
|
||||
assert!(check_ignore(&config, "//@ ignore-auxiliary"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue