rust/src/test/run-pass/test-ignore-cfg.rs

31 lines
620 B
Rust
Raw Normal View History

// compile-flags: --test --cfg ignorecfg
// xfail-fast
// xfail-pretty
use std;
import option;
import vec;
#[test]
#[ignore(cfg(ignorecfg))]
fn shouldignore() {
}
#[test]
#[ignore(cfg(noignorecfg))]
fn shouldnotignore() {
}
#[test]
fn checktests() {
// Pull the tests out of the secret test module
let tests = __test::tests();
let shouldignore = option::get(
2012-06-30 16:19:07 -07:00
vec::find(tests, |t| t.name == "shouldignore" ));
assert shouldignore.ignore == true;
let shouldnotignore = option::get(
2012-06-30 16:19:07 -07:00
vec::find(tests, |t| t.name == "shouldnotignore" ));
assert shouldnotignore.ignore == false;
}