Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all pass-dep tests natively, too #3948

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ windows-sys = { version = "0.52", features = [
] }

[dev-dependencies]
ui_test = "0.27.1"
colored = "2"
ui_test = "0.26.5"
rustc_version = "0.4"
regex = "1.5.5"
tempfile = "3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
--> tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
--> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/function_calls/return_pointer_on_unwind.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
--> tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/intrinsics/uninit_uninhabited_type.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
aborted execution: attempted to instantiate uninhabited type `!`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
Expand Down
1 change: 0 additions & 1 deletion tests/fail/intrinsics/zero_fn_ptr.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread caused non-unwinding panic. aborting.
error: abnormal termination: the program aborted execution
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/abort_unwind.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
PANIC!!!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/bad_unwind.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
--> tests/fail/panic/bad_unwind.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/double_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
second
stack backtrace:
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/panic_abort1.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/panic_abort2.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/panic_abort3.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/panic/panic_abort4.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: abnormal termination: the program aborted execution
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
|
Expand Down
1 change: 0 additions & 1 deletion tests/fail/terminate-terminator.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's defaul
thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
1 change: 0 additions & 1 deletion tests/fail/unwind-action-terminate.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
1 change: 0 additions & 1 deletion tests/panic/alloc_error_handler_hook.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC:
alloc error hook called
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
yes we are unwinding!
1 change: 0 additions & 1 deletion tests/panic/alloc_error_handler_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
memory allocation of 4 bytes failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
yes we are unwinding!
1 change: 0 additions & 1 deletion tests/panic/div-by-zero-2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
Expand Down
1 change: 0 additions & 1 deletion tests/panic/oob_subslice.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC:
range end index 5 out of range for slice of length 4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/overflowing-lsh-neg.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
attempt to shift left with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/overflowing-rsh-1.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
attempt to shift right with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/overflowing-rsh-2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
attempt to shift right with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/panic2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/panic2.rs:LL:CC:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/panic3.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/panic3.rs:LL:CC:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/panic4.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/panic4.rs:LL:CC:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/transmute_fat2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/unsupported_foreign_function.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/unsupported_foreign_function.rs:LL:CC:
unsupported Miri functionality: can't call foreign function `foo` on $OS
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
1 change: 0 additions & 1 deletion tests/panic/unsupported_syscall.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
thread 'main' panicked at tests/panic/unsupported_syscall.rs:LL:CC:
unsupported Miri functionality: can't execute syscall with ID 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
18 changes: 11 additions & 7 deletions tests/pass-dep/libc/libc-mem.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(strict_provenance, pointer_is_aligned_to)]

Check failure on line 1 in tests/pass-dep/libc/libc-mem.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, i686-pc-windows-msvc)

test generated output

you likely need to bless the tests with `add `//@only-miri:` to the test if it cannot be run on the host directly`

Check failure on line 1 in tests/pass-dep/libc/libc-mem.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest, i686-pc-windows-msvc)

test (revision: run) got exit code: 101

assertion failed: p_too_big.is_null()
use std::{mem, ptr, slice};

fn test_memcpy() {
Expand Down Expand Up @@ -79,13 +79,17 @@
}

fn test_malloc() {
// Test that small allocations sometimes *are* not very aligned.
let saw_unaligned = (0..64).any(|_| unsafe {
let p = libc::malloc(3);
libc::free(p);
(p as usize) % 4 != 0 // find any that this is *not* 4-aligned
});
assert!(saw_unaligned);
// Real systems may always align to at least a specific power of 2 (like 4 or 8).
#[cfg(miri)]
{
// Test that small allocations sometimes *are* not very aligned.
let saw_unaligned = (0..64).any(|_| unsafe {
let p = libc::malloc(3);
libc::free(p);
(p as usize) % 4 != 0 // find any that this is *not* 4-aligned
});
assert!(saw_unaligned);
}

unsafe {
let p1 = libc::malloc(20);
Expand Down
1 change: 1 addition & 0 deletions tests/pass-dep/num_cpus.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@compile-flags: -Zmiri-disable-isolation
//@only-miri: fake cpu number

fn main() {
assert_eq!(num_cpus::get(), 1);
Expand Down
1 change: 1 addition & 0 deletions tests/pass-dep/page_size_override.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@compile-flags: -Zmiri-force-page-size=8
//@only-miri: fake page size

fn main() {
let page_size = page_size::get();
Expand Down
1 change: 0 additions & 1 deletion tests/pass/panic/catch_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from std::panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
Caught panic message (&str): Hello from std::panic
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from std::panic: 1
Expand Down
1 change: 0 additions & 1 deletion tests/pass/panic/concurrent-panic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Thread 1 reported it has started
thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
panic in thread 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
Thread 2 blocking on thread 1
Thread 2 reported it has started
Unlocking mutex
Expand Down
1 change: 0 additions & 1 deletion tests/pass/panic/nested_panic_caught.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
once
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
twice
stack backtrace:
1 change: 0 additions & 1 deletion tests/pass/panic/thread_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
Hello!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
Hello, world!
Loading
Loading