Skip to content

Commit 1242093

Browse files
committed
also test parts of std
requires disabling some tests that do not work
1 parent c0b564b commit 1242093

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

library/std/benches/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Disabling in Miri as these would take too long.
2+
#![cfg(not(miri))]
13
#![feature(test)]
24

35
extern crate test;

library/std/tests/process_spawning.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::str;
88
mod common;
99

1010
#[test]
11+
#[cfg_attr(miri, ignore)] // Process spawning not supported by Miri
1112
fn issue_15149() {
1213
// If we're the parent, copy our own binary to a new directory.
1314
let my_path = env::current_exe().unwrap();

library/std/tests/switch-stdout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ fn switch_stdout_to(file: OwnedHandle) -> OwnedHandle {
5151
}
5252

5353
#[test]
54+
#[cfg_attr(miri, ignore)] // dup/SetStdHandle not supported by Miri
5455
fn switch_stdout() {
5556
let temp = common::tmpdir();
5657
let path = temp.join("switch-stdout-output");

library/std/tests/thread.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::time::Duration;
55

66
#[test]
77
#[cfg_attr(target_os = "emscripten", ignore)]
8-
fn sleep() {
8+
#[cfg_attr(miri, ignore)] // Miri does not like the thread leak
9+
fn sleep_very_long() {
910
let finished = Arc::new(Mutex::new(false));
1011
let t_finished = finished.clone();
1112
thread::spawn(move || {

src/bootstrap/mk/Makefile.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,21 @@ check-aux:
5757
library/core \
5858
library/alloc \
5959
--no-doc
60+
# Some doctests have intentional memory leaks.
6061
$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" \
6162
$(BOOTSTRAP) miri --stage 2 \
6263
library/core \
6364
library/alloc \
6465
--doc
66+
# In `std` we cannot test everything, so we test the most target-dependent modules.
67+
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
68+
$(BOOTSTRAP) miri --stage 2 library/std \
69+
--no-doc -- \
70+
--skip fs:: --skip net:: --skip process:: --skip sys::pal::
71+
$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \
72+
$(BOOTSTRAP) miri --stage 2 library/std \
73+
--doc -- \
74+
--skip fs:: --skip net:: --skip process:: --skip sys::pal::
6575
dist:
6676
$(Q)$(BOOTSTRAP) dist $(BOOTSTRAP_ARGS)
6777
distcheck:

0 commit comments

Comments
 (0)