about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-06-27 11:44:47 -0400
committerOneirical <manchot@videotron.ca>2024-07-02 11:37:59 -0400
commit45313a6ca038995bc3a0cc952fac94102d00f60c (patch)
tree0074603d24e48db8b66e7feedef906e2e268e592
parentb75dd71ef0472a5ef2c7c1ec9f0a12b125905d02 (diff)
downloadrust-45313a6ca038995bc3a0cc952fac94102d00f60c.tar.gz
rust-45313a6ca038995bc3a0cc952fac94102d00f60c.zip
rewrite test-harness to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt2
-rw-r--r--src/tools/tidy/src/ui_tests.rs2
-rw-r--r--tests/run-make/include-all-symbols-linking/rmake.rs4
-rw-r--r--tests/run-make/test-harness/Makefile9
-rw-r--r--tests/run-make/test-harness/rmake.rs25
-rw-r--r--tests/ui/msvc-opt-minsize.rs (renamed from tests/ui/windows/msvc-opt-minsize.rs)0
-rw-r--r--tests/ui/windows-subsystem/console.rs (renamed from tests/ui/windows/console.rs)0
-rw-r--r--tests/ui/windows-subsystem/windows-subsystem-invalid.rs (renamed from tests/ui/windows/windows-subsystem-invalid.rs)0
-rw-r--r--tests/ui/windows-subsystem/windows-subsystem-invalid.stderr (renamed from tests/ui/windows/windows-subsystem-invalid.stderr)0
-rw-r--r--tests/ui/windows-subsystem/windows.rs (renamed from tests/ui/windows/windows.rs)0
10 files changed, 29 insertions, 13 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 6ef68509f10..2da4e476e90 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -96,7 +96,6 @@ run-make/metadata-dep-info/Makefile
 run-make/min-global-align/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
@@ -163,7 +162,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
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index 95857502108..5e6992038e3 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -13,7 +13,7 @@ use std::path::{Path, PathBuf};
 // should all be 1000 or lower. Limits significantly smaller than 1000 are also
 // desirable, because large numbers of files are unwieldy in general. See issue
 // #73494.
-const ENTRY_LIMIT: u32 = 900;
+const ENTRY_LIMIT: u32 = 901;
 // FIXME: The following limits should be reduced eventually.
 
 const ISSUES_ENTRY_LIMIT: u32 = 1672;
diff --git a/tests/run-make/include-all-symbols-linking/rmake.rs b/tests/run-make/include-all-symbols-linking/rmake.rs
index a443fc0a5c4..77fd71ab20d 100644
--- a/tests/run-make/include-all-symbols-linking/rmake.rs
+++ b/tests/run-make/include-all-symbols-linking/rmake.rs
@@ -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};
 
diff --git a/tests/run-make/test-harness/Makefile b/tests/run-make/test-harness/Makefile
deleted file mode 100644
index ee8c9294f91..00000000000
--- a/tests/run-make/test-harness/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	# check that #[cfg_attr(..., ignore)] does the right thing.
-	$(RUSTC) --test test-ignore-cfg.rs --cfg ignorecfg
-	$(call RUN,test-ignore-cfg) | $(CGREP) 'shouldnotignore ... ok' 'shouldignore ... ignored'
-	$(call RUN,test-ignore-cfg --quiet) | $(CGREP) -e "^i\.$$"
-	$(call RUN,test-ignore-cfg --quiet) | $(CGREP) -v 'should'
diff --git a/tests/run-make/test-harness/rmake.rs b/tests/run-make/test-harness/rmake.rs
new file mode 100644
index 00000000000..30b3d00f4d1
--- /dev/null
+++ b/tests/run-make/test-harness/rmake.rs
@@ -0,0 +1,25 @@
+// 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");
+    assert_eq!(
+        // One of the lines is exactly "i."
+        run_with_args("test-ignore-cfg", &["--quiet"]).stdout_utf8().lines().find(|&x| x == "i."),
+        Some("i.")
+    );
+    run_with_args("test-ignore-cfg", &["--quiet"]).assert_stdout_not_contains("should");
+}
diff --git a/tests/ui/windows/msvc-opt-minsize.rs b/tests/ui/msvc-opt-minsize.rs
index c1be168a05d..c1be168a05d 100644
--- a/tests/ui/windows/msvc-opt-minsize.rs
+++ b/tests/ui/msvc-opt-minsize.rs
diff --git a/tests/ui/windows/console.rs b/tests/ui/windows-subsystem/console.rs
index 8f0ca2de370..8f0ca2de370 100644
--- a/tests/ui/windows/console.rs
+++ b/tests/ui/windows-subsystem/console.rs
diff --git a/tests/ui/windows/windows-subsystem-invalid.rs b/tests/ui/windows-subsystem/windows-subsystem-invalid.rs
index c6a6dd00a92..c6a6dd00a92 100644
--- a/tests/ui/windows/windows-subsystem-invalid.rs
+++ b/tests/ui/windows-subsystem/windows-subsystem-invalid.rs
diff --git a/tests/ui/windows/windows-subsystem-invalid.stderr b/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr
index 703f35c969c..703f35c969c 100644
--- a/tests/ui/windows/windows-subsystem-invalid.stderr
+++ b/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr
diff --git a/tests/ui/windows/windows.rs b/tests/ui/windows-subsystem/windows.rs
index 65db0fec7a8..65db0fec7a8 100644
--- a/tests/ui/windows/windows.rs
+++ b/tests/ui/windows-subsystem/windows.rs