about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-14 19:24:19 +0000
committerbors <bors@rust-lang.org>2024-08-14 19:24:19 +0000
commit13a52890dde8cfeb95069d77c223ac37c0cf3a46 (patch)
tree0f05aaf7620f18c0b348d9a47bcbe276ca470aec /src/tools
parent355a307a874077eff12bd99c6fd3eb6bfda79993 (diff)
parentb85bedcb24e31636e47c724e0a1cbedf09d03158 (diff)
downloadrust-13a52890dde8cfeb95069d77c223ac37c0cf3a46.tar.gz
rust-13a52890dde8cfeb95069d77c223ac37c0cf3a46.zip
Auto merge of #128407 - Oneirical:feline-dotestication, r=jieyouxu
Migrate `min-global-align` and `no-alloc-shim` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try:

try-job: aarch64-apple
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-gnu
try-job: aarch64-gnu
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/run-make-support/src/assertion_helpers.rs14
-rw-r--r--src/tools/run-make-support/src/lib.rs2
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt2
3 files changed, 15 insertions, 3 deletions
diff --git a/src/tools/run-make-support/src/assertion_helpers.rs b/src/tools/run-make-support/src/assertion_helpers.rs
index 6d256fc594d..b4da65aff4a 100644
--- a/src/tools/run-make-support/src/assertion_helpers.rs
+++ b/src/tools/run-make-support/src/assertion_helpers.rs
@@ -77,6 +77,20 @@ pub fn assert_not_contains_regex<H: AsRef<str>, N: AsRef<str>>(haystack: H, need
     }
 }
 
+/// Assert that `haystack` contains `needle` a `count` number of times.
+#[track_caller]
+pub fn assert_count_is<H: AsRef<str>, N: AsRef<str>>(count: usize, haystack: H, needle: N) {
+    let haystack = haystack.as_ref();
+    let needle = needle.as_ref();
+    if count != haystack.matches(needle).count() {
+        eprintln!("=== HAYSTACK ===");
+        eprintln!("{}", haystack);
+        eprintln!("=== NEEDLE ===");
+        eprintln!("{}", needle);
+        panic!("needle did not appear {count} times in haystack");
+    }
+}
+
 /// Assert that all files in `dir1` exist and have the same content in `dir2`
 pub fn assert_dirs_are_equal(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
     let dir2 = dir2.as_ref();
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs
index 4d0c1b0930c..4bef4f05007 100644
--- a/src/tools/run-make-support/src/lib.rs
+++ b/src/tools/run-make-support/src/lib.rs
@@ -87,7 +87,7 @@ pub use path_helpers::{
 pub use scoped_run::{run_in_tmpdir, test_while_readonly};
 
 pub use assertion_helpers::{
-    assert_contains, assert_contains_regex, assert_dirs_are_equal, assert_equals,
+    assert_contains, assert_contains_regex, assert_count_is, assert_dirs_are_equal, assert_equals,
     assert_not_contains, assert_not_contains_regex,
 };
 
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 25fa8c5e1af..bc446555773 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -13,9 +13,7 @@ run-make/libtest-json/Makefile
 run-make/libtest-junit/Makefile
 run-make/libtest-thread-limit/Makefile
 run-make/macos-deployment-target/Makefile
-run-make/min-global-align/Makefile
 run-make/native-link-modifier-bundle/Makefile
-run-make/no-alloc-shim/Makefile
 run-make/reproducible-build/Makefile
 run-make/rlib-format-packed-bundled-libs/Makefile
 run-make/split-debuginfo/Makefile