Skip to content

Commit c328473

Browse files
committed
move a test into a run make, to check external affect rather than
implementation details. (Mainly to avoid accessing the secret internal test module symbol name.)
1 parent 3826026 commit c328473

File tree

3 files changed

+26
-36
lines changed

3 files changed

+26
-36
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-include ../tools.mk
2+
3+
all:
4+
# check that #[ignore(cfg(...))] does the right thing.
5+
$(RUSTC) --test test-ignore-cfg.rs --cfg ignorecfg
6+
$(call RUN,test-ignore-cfg) | grep 'shouldnotignore ... ok'
7+
$(call RUN,test-ignore-cfg) | grep 'shouldignore ... ignored'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[test]
12+
#[ignore(cfg(ignorecfg))]
13+
fn shouldignore() {
14+
}
15+
16+
#[test]
17+
#[ignore(cfg(noignorecfg))]
18+
fn shouldnotignore() {
19+
}

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

-36
This file was deleted.

0 commit comments

Comments
 (0)