Skip to content

Commit e86cd1a

Browse files
committed
Auto merge of rust-lang#2317 - RalfJung:this-is-not-a-std-test-suite, r=RalfJung
move arc_drop test to miri-test-libstd That's where we have a bunch of slow and unlikely-to-regress tests already. Miri's test suite should primarily test Miri; we sometimes add libstd tests when they are cheap and/or exercise interesting code paths in Miri. rust-lang/miri#2248 already ensures that we allow code like `Arc` with more direct tests.
2 parents c674f26 + e71f8b0 commit e86cd1a

File tree

4 files changed

+19
-33
lines changed

4 files changed

+19
-33
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ Moreover, Miri recognizes some environment variables:
418418
sysroot to use. Only set this if you do not want to use the automatically
419419
created sysroot. (The `miri` driver sysroot is controlled via the `--sysroot`
420420
flag instead.)
421-
* `MIRI_TEST_TARGET` (recognized by the test suite) indicates which target
422-
architecture to test against. `miri` and `cargo miri` accept the `--target`
423-
flag for the same purpose.
421+
* `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script) indicates which target
422+
architecture to test against. `miri` and `cargo miri` accept the `--target` flag for the same
423+
purpose.
424424
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
425425
sysroot is built without libstd. This allows testing and running no_std programs.
426426
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
@@ -581,6 +581,7 @@ Definite bugs found:
581581
* [`integer-encoding` dereferencing a misaligned pointer](https://github.com/dermesser/integer-encoding-rs/pull/23)
582582
* [`rkyv` constructing a `Box<[u8]>` from an overaligned allocation](https://github.com/rkyv/rkyv/commit/a9417193a34757e12e24263178be8b2eebb72456)
583583
* [Data race in `thread::scope`](https://github.com/rust-lang/rust/issues/98498)
584+
* [`regex` incorrectly handling unaligned `Vec<u8>` buffers](https://www.reddit.com/r/rust/comments/vq3mmu/comment/ienc7t0?context=3)
584585

585586
Violations of [Stacked Borrows] found that are likely bugs (but Stacked Borrows is currently just an experiment):
586587

miri

+14-10
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,21 @@ test|test-debug|bless|bless-debug)
167167
$CARGO test $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml "$@"
168168
;;
169169
run|run-debug)
170-
# Scan for "--target" to set the "MIRI_TEST_TARGET" env var so
170+
# Scan for "--target" to overwrite the "MIRI_TEST_TARGET" env var so
171171
# that we set the MIRI_SYSROOT up the right way.
172-
if [ -z "$MIRI_TEST_TARGET" ]; then
173-
for ARG in "$@"; do
174-
if [ "$LAST_ARG" = "--target" ]; then
175-
# Found it!
176-
export MIRI_TEST_TARGET="$ARG"
177-
break
178-
fi
179-
LAST_ARG="$ARG"
180-
done
172+
FOUND_TARGET_OPT=0
173+
for ARG in "$@"; do
174+
if [ "$LAST_ARG" = "--target" ]; then
175+
# Found it!
176+
export MIRI_TEST_TARGET="$ARG"
177+
FOUND_TARGET_OPT=1
178+
break
179+
fi
180+
LAST_ARG="$ARG"
181+
done
182+
if [ "$FOUND_TARGET_OPT" = "0" ] && [ -n "$MIRI_TEST_TARGET" ]; then
183+
# Make sure Miri actually uses this target.
184+
MIRIFLAGS="$MIRIFLAGS --target $MIRI_TEST_TARGET"
181185
fi
182186
# First build and get a sysroot.
183187
$CARGO build $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml

tests/pass/0concurrency_arc_drop.rs

-19
This file was deleted.

tests/pass/0weak_memory_consistency.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn test_single_thread() {
217217
}
218218

219219
pub fn main() {
220-
for _ in 0..75 {
220+
for _ in 0..50 {
221221
test_single_thread();
222222
test_mixed_access();
223223
test_load_buffering_acq_rel();

0 commit comments

Comments
 (0)