Skip to content

Commit

Permalink
rewrite test-harness to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 27, 2024
1 parent 57894c1 commit ea53274
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ run-make/mingw-export-call-convention/Makefile
run-make/mismatching-target-triples/Makefile
run-make/missing-crate-dependency/Makefile
run-make/mixing-libs/Makefile
run-make/msvc-opt-minsize/Makefile
run-make/native-link-modifier-bundle/Makefile
run-make/native-link-modifier-whole-archive/Makefile
run-make/no-alloc-shim/Makefile
Expand Down Expand Up @@ -181,7 +180,6 @@ run-make/target-cpu-native/Makefile
run-make/target-specs/Makefile
run-make/target-without-atomic-cas/Makefile
run-make/test-benches/Makefile
run-make/test-harness/Makefile
run-make/thumb-none-cortex-m/Makefile
run-make/thumb-none-qemu/Makefile
run-make/track-path-dep-info/Makefile
Expand Down
4 changes: 3 additions & 1 deletion tests/run-make/include-all-symbols-linking/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
// See https://github.com/rust-lang/rust/pull/95604
// See https://github.com/rust-lang/rust/issues/47384

//FIXME(Oneirical): ignore flags: only linux and cross compile
//@ only-linux
// Reason: differences in object file formats on OSX and Windows
// causes errors in the llvm_objdump step

use run_make_support::{dynamic_lib_name, llvm_objdump, llvm_readobj, rustc};

Expand Down
9 changes: 0 additions & 9 deletions tests/run-make/test-harness/Makefile

This file was deleted.

21 changes: 21 additions & 0 deletions tests/run-make/test-harness/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// The way test suites run can be modified using configuration flags,
// ignoring certain tests while running others. This test contains two
// functions, one which must run and the other which must not. The standard
// output is checked to verify that the ignore configuration is doing its job,
// and that output is successfully minimized with the --quiet flag.
// See https://github.com/rust-lang/rust/commit/f7ebe23ae185991b0fee05b32fbb3e29b89a41bf

//@ ignore-cross-compile
// Reason: the compiled binary is executed

use run_make_support::{run, run_with_args, rustc};

fn main() {
rustc().arg("--test").input("test-ignore-cfg.rs").cfg("ignorecfg").run();
// check that #[cfg_attr(..., ignore)] does the right thing.
run("test-ignore-cfg")
.assert_stdout_contains("shouldnotignore ... ok")
.assert_stdout_contains("shouldignore ... ignored");
run_with_args("test-ignore-cfg", &["--quiet"]).assert_stdout_contains("i.");
run_with_args("test-ignore-cfg", &["--quiet"]).assert_stdout_not_contains("should");
}

0 comments on commit ea53274

Please sign in to comment.