Skip to content

Commit

Permalink
Bump ui_test to 0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 25, 2024
1 parent edcb534 commit 111ec7c
Show file tree
Hide file tree
Showing 507 changed files with 1,482 additions and 1,474 deletions.
40 changes: 24 additions & 16 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 @@ -43,7 +43,7 @@ libloading = "0.8"

[dev-dependencies]
colored = "2"
ui_test = "0.21.2"
ui_test = "0.22"
rustc_version = "0.4"
regex = "1.5.5"
lazy_static = "1.4.0"
Expand Down
26 changes: 13 additions & 13 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::ffi::OsString;
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use std::{env, process::Command};
use ui_test::spanned::Spanned;
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
use ui_test::{status_emitter, CommandBuilder, Format, RustfixMode};

Expand Down Expand Up @@ -66,8 +67,6 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
}
}
program.args.push("-Zui-testing".into());
program.args.push("--target".into());
program.args.push(target.into());

// If we're on linux, and we're testing the extern-so functionality,
// then build the shared object file for testing external C function calls
Expand All @@ -86,17 +85,20 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->

let mut config = Config {
target: Some(target.to_owned()),
stderr_filters: STDERR.clone(),
stdout_filters: STDOUT.clone(),
mode,
program,
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("ui"),
edition: Some("2021".into()), // keep in sync with `./miri run`
threads: std::env::var("MIRI_TEST_THREADS")
.ok()
.map(|threads| NonZeroUsize::new(threads.parse().unwrap()).unwrap()),
..Config::rustc(path)
};
// keep in sync with `./miri run`
config.comment_defaults.base().edition = Some(Spanned::dummy("2021".into())).into();
config.comment_defaults.base().mode = Some(Spanned::dummy(mode)).into();
config.comment_defaults.base().normalize_stdout =
STDOUT.iter().cloned().map(|(m, v)| (m, v.into())).collect();
config.comment_defaults.base().normalize_stderr =
STDERR.iter().cloned().map(|(m, v)| (m, v.into())).collect();

if with_dependencies {
config.dependencies_crate_manifest_path =
Expand All @@ -121,14 +123,12 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
let mut config = test_config(target, path, mode, with_dependencies);

// Handle command-line arguments.
let args = ui_test::Args::test()?;
let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
config.with_args(&args, default_bless);
if let OutputConflictHandling::Error(msg) = &mut config.output_conflict_handling {
*msg = "./miri test --bless".into();
}
let mut args = ui_test::Args::test()?;
args.bless |= env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
config.with_args(&args);
config.bless_command = Some("./miri test --bless".into());
if env::var_os("MIRI_SKIP_UI_CHECKS").is_some() {
assert!(!default_bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
assert!(!args.bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
config.output_conflict_handling = OutputConflictHandling::Ignore;
}
eprintln!(" Compiler: {}", config.program.display());
Expand Down
4 changes: 2 additions & 2 deletions tests/extern-so/fail/function_not_in_so.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error: unsupported operation: can't call foreign function `foo` on $OS
--> $DIR/function_not_in_so.rs:LL:CC
--> tests/extern-so/fail/function_not_in_so.rs:LL:CC
|
LL | foo();
| ^^^^^ can't call foreign function `foo` on $OS
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
= note: BACKTRACE:
= note: inside `main` at $DIR/function_not_in_so.rs:LL:CC
= note: inside `main` at tests/extern-so/fail/function_not_in_so.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Undefined Behavior: callee has fewer arguments than expected
--> $DIR/libc_pthread_create_too_few_args.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs:LL:CC
|
LL | panic!()
| ^^^^^^^^ callee has fewer arguments than expected
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Undefined Behavior: callee has more arguments than expected
--> $DIR/libc_pthread_create_too_many_args.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs:LL:CC
|
LL | panic!()
| ^^^^^^^^ callee has more arguments than expected
Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/concurrency/libc_pthread_join_detached.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: Undefined Behavior: trying to join a detached thread
--> $DIR/libc_pthread_join_detached.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
|
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/concurrency/libc_pthread_join_joined.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: Undefined Behavior: trying to join an already joined thread
--> $DIR/libc_pthread_join_joined.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC
|
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `main` at $DIR/libc_pthread_join_joined.rs:LL:CC
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/concurrency/libc_pthread_join_main.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: Undefined Behavior: trying to join a detached thread
--> $DIR/libc_pthread_join_main.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC
|
LL | assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside closure at $DIR/libc_pthread_join_main.rs:LL:CC
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: Undefined Behavior: trying to join an already joined thread
--> $DIR/libc_pthread_join_multiple.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC
|
LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside closure at $DIR/libc_pthread_join_multiple.rs:LL:CC
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/concurrency/libc_pthread_join_self.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: Undefined Behavior: trying to join itself
--> $DIR/libc_pthread_join_self.rs:LL:CC
--> tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC
|
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join itself
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside closure at $DIR/libc_pthread_join_self.rs:LL:CC
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
6 changes: 3 additions & 3 deletions tests/fail-dep/concurrency/unwind_top_of_stack.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
WARNING: the flag `-Zmiri-disable-abi-check` is deprecated and planned to be removed.
If you have a use-case for it, please file an issue.
thread '<unnamed>' panicked at $DIR/unwind_top_of_stack.rs:LL:CC:
thread '<unnamed>' panicked at tests/fail-dep/concurrency/unwind_top_of_stack.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: Undefined Behavior: unwinding past the topmost frame of the stack
--> $DIR/unwind_top_of_stack.rs:LL:CC
--> tests/fail-dep/concurrency/unwind_top_of_stack.rs:LL:CC
|
LL | / extern "C-unwind" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
LL | |
Expand All @@ -15,7 +15,7 @@ LL | | }
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `thread_start` at $DIR/unwind_top_of_stack.rs:LL:CC
= note: inside `thread_start` at tests/fail-dep/concurrency/unwind_top_of_stack.rs:LL:CC

error: aborting due to 1 previous error

6 changes: 3 additions & 3 deletions tests/fail-dep/shims/env-set_var-data-race.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/env-set_var-data-race.rs:LL:CC
--> tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC
|
LL | libc::getenv(b"TZ/0".as_ptr().cast());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (1) occurred earlier here
--> $DIR/env-set_var-data-race.rs:LL:CC
--> tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC
|
LL | env::set_var("MY_RUST_VAR", "Ferris");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE (of the first span):
= note: inside closure at $DIR/env-set_var-data-race.rs:LL:CC
= note: inside closure at tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/shims/fs/close_stdout.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error: unsupported operation: cannot close stdout
--> $DIR/close_stdout.rs:LL:CC
--> tests/fail-dep/shims/fs/close_stdout.rs:LL:CC
|
LL | libc::close(1);
| ^^^^^^^^^^^^^^ cannot close stdout
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
= note: BACKTRACE:
= note: inside `main` at $DIR/close_stdout.rs:LL:CC
= note: inside `main` at tests/fail-dep/shims/fs/close_stdout.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/shims/fs/isolated_stdin.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: unsupported operation: `read` from stdin not available when isolation is enabled
--> $DIR/isolated_stdin.rs:LL:CC
--> tests/fail-dep/shims/fs/isolated_stdin.rs:LL:CC
|
LL | libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `read` from stdin not available when isolation is enabled
|
= help: pass the flag `-Zmiri-disable-isolation` to disable isolation;
= help: or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning
= note: BACKTRACE:
= note: inside `main` at $DIR/isolated_stdin.rs:LL:CC
= note: inside `main` at tests/fail-dep/shims/fs/isolated_stdin.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
6 changes: 3 additions & 3 deletions tests/fail-dep/shims/fs/mkstemp_immutable_arg.stderr
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error: Undefined Behavior: writing to ALLOC which is read-only
--> $DIR/mkstemp_immutable_arg.rs:LL:CC
--> tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
|
LL | let _fd = unsafe { libc::mkstemp(s) };
| ^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `test_mkstemp_immutable_arg` at $DIR/mkstemp_immutable_arg.rs:LL:CC
= note: inside `test_mkstemp_immutable_arg` at tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
note: inside `main`
--> $DIR/mkstemp_immutable_arg.rs:LL:CC
--> tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
|
LL | test_mkstemp_immutable_arg();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/fail-dep/shims/fs/read_from_stdout.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error: unsupported operation: cannot read from stdout
--> $DIR/read_from_stdout.rs:LL:CC
--> tests/fail-dep/shims/fs/read_from_stdout.rs:LL:CC
|
LL | libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
= note: BACKTRACE:
= note: inside `main` at $DIR/read_from_stdout.rs:LL:CC
= note: inside `main` at tests/fail-dep/shims/fs/read_from_stdout.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
error: Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
--> tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
|
LL | ...safe { libc::open(name_ptr, libc::O_CREAT) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `test_file_open_missing_needed_mode` at $DIR/unix_open_missing_required_mode.rs:LL:CC
= note: inside `test_file_open_missing_needed_mode` at tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
note: inside `main`
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
--> tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
|
LL | test_file_open_missing_needed_mode();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 111ec7c

Please sign in to comment.