Skip to content

Commit 95ba6d7

Browse files
committed
rewrite test-harness to rmake
1 parent 57894c1 commit 95ba6d7

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ run-make/target-cpu-native/Makefile
181181
run-make/target-specs/Makefile
182182
run-make/target-without-atomic-cas/Makefile
183183
run-make/test-benches/Makefile
184-
run-make/test-harness/Makefile
185184
run-make/thumb-none-cortex-m/Makefile
186185
run-make/thumb-none-qemu/Makefile
187186
run-make/track-path-dep-info/Makefile

tests/run-make/test-harness/Makefile

-9
This file was deleted.

tests/run-make/test-harness/rmake.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// The way test suites run can be modified using configuration flags,
2+
// ignoring certain tests while running others. This test contains two
3+
// functions, one which must run and the other which must not. The standard
4+
// output is checked to verify that the ignore configuration is doing its job,
5+
// and that output is successfully minimized with the --quiet flag.
6+
// See https://github.com/rust-lang/rust/commit/f7ebe23ae185991b0fee05b32fbb3e29b89a41bf
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
11+
use run_make_support::{run, run_with_args, rustc};
12+
13+
fn main() {
14+
rustc().arg("--test").input("test-ignore-cfg.rs").cfg("ignorecfg").run();
15+
// check that #[cfg_attr(..., ignore)] does the right thing.
16+
run("test-ignore-cfg")
17+
.assert_stdout_contains("shouldnotignore ... ok")
18+
.assert_stdout_contains("shouldignore ... ignored");
19+
run_with_args("test-ignore-cfg", &["--quiet"]).assert_stdout_contains("i.");
20+
run_with_args("test-ignore-cfg", &["--quiet"]).assert_stdout_not_contains("should");
21+
}

0 commit comments

Comments
 (0)