about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-04-05 23:22:17 +0200
committerRalf Jung <post@ralfj.de>2024-04-07 10:05:57 +0200
commit1242093da21cbe940f51e224f0e9dae9c4adcd1e (patch)
treea9835af9daddf4d4966abffcdc272c5139aca9eb
parentc0b564b767866a5485339efdc059353266471342 (diff)
downloadrust-1242093da21cbe940f51e224f0e9dae9c4adcd1e.tar.gz
rust-1242093da21cbe940f51e224f0e9dae9c4adcd1e.zip
also test parts of std
requires disabling some tests that do not work
-rw-r--r--library/std/benches/lib.rs2
-rw-r--r--library/std/tests/process_spawning.rs1
-rw-r--r--library/std/tests/switch-stdout.rs1
-rw-r--r--library/std/tests/thread.rs3
-rw-r--r--src/bootstrap/mk/Makefile.in10
5 files changed, 16 insertions, 1 deletions
diff --git a/library/std/benches/lib.rs b/library/std/benches/lib.rs
index 4d1cf7fab7b..1b21c230a0b 100644
--- a/library/std/benches/lib.rs
+++ b/library/std/benches/lib.rs
@@ -1,3 +1,5 @@
+// Disabling in Miri as these would take too long.
+#![cfg(not(miri))]
 #![feature(test)]
 
 extern crate test;
diff --git a/library/std/tests/process_spawning.rs b/library/std/tests/process_spawning.rs
index 59f67f9901f..c56c111c37d 100644
--- a/library/std/tests/process_spawning.rs
+++ b/library/std/tests/process_spawning.rs
@@ -8,6 +8,7 @@ use std::str;
 mod common;
 
 #[test]
+#[cfg_attr(miri, ignore)] // Process spawning not supported by Miri
 fn issue_15149() {
     // If we're the parent, copy our own binary to a new directory.
     let my_path = env::current_exe().unwrap();
diff --git a/library/std/tests/switch-stdout.rs b/library/std/tests/switch-stdout.rs
index 27f3e8a9b96..0afe18088fa 100644
--- a/library/std/tests/switch-stdout.rs
+++ b/library/std/tests/switch-stdout.rs
@@ -51,6 +51,7 @@ fn switch_stdout_to(file: OwnedHandle) -> OwnedHandle {
 }
 
 #[test]
+#[cfg_attr(miri, ignore)] // dup/SetStdHandle not supported by Miri
 fn switch_stdout() {
     let temp = common::tmpdir();
     let path = temp.join("switch-stdout-output");
diff --git a/library/std/tests/thread.rs b/library/std/tests/thread.rs
index 4ce81f2846e..79a981d0b0d 100644
--- a/library/std/tests/thread.rs
+++ b/library/std/tests/thread.rs
@@ -5,7 +5,8 @@ use std::time::Duration;
 
 #[test]
 #[cfg_attr(target_os = "emscripten", ignore)]
-fn sleep() {
+#[cfg_attr(miri, ignore)] // Miri does not like the thread leak
+fn sleep_very_long() {
     let finished = Arc::new(Mutex::new(false));
     let t_finished = finished.clone();
     thread::spawn(move || {
diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in
index e70391ff669..e8b8daa6389 100644
--- a/src/bootstrap/mk/Makefile.in
+++ b/src/bootstrap/mk/Makefile.in
@@ -57,11 +57,21 @@ check-aux:
 		library/core \
 		library/alloc \
 		--no-doc
+	# Some doctests have intentional memory leaks.
 	$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" \
 		$(BOOTSTRAP) miri --stage 2 \
 		library/core \
 		library/alloc \
 		--doc
+	# In `std` we cannot test everything, so we test the most target-dependent modules.
+	$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
+		$(BOOTSTRAP) miri --stage 2 library/std \
+		--no-doc -- \
+		--skip fs:: --skip net:: --skip process:: --skip sys::pal::
+	$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
+		$(BOOTSTRAP) miri --stage 2 library/std \
+		--doc -- \
+		--skip fs:: --skip net:: --skip process:: --skip sys::pal::
 dist:
 	$(Q)$(BOOTSTRAP) dist $(BOOTSTRAP_ARGS)
 distcheck: