rust/src/test/run-pass/test-ignore-cfg.rs
2012-08-01 19:16:06 -07:00

31 lines
625 B
Rust

// 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 secreturn test module
let tests = __test::tests();
let shouldignore = option::get(
vec::find(tests, |t| t.name == ~"shouldignore" ));
assert shouldignore.ignore == true;
let shouldnotignore = option::get(
vec::find(tests, |t| t.name == ~"shouldnotignore" ));
assert shouldnotignore.ignore == false;
}