Skip to content

Commit 111ec7c

Browse files
committed
Bump ui_test to 0.22
1 parent edcb534 commit 111ec7c

File tree

507 files changed

+1482
-1474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

507 files changed

+1482
-1474
lines changed

Cargo.lock

Lines changed: 24 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ libloading = "0.8"
4343

4444
[dev-dependencies]
4545
colored = "2"
46-
ui_test = "0.21.2"
46+
ui_test = "0.22"
4747
rustc_version = "0.4"
4848
regex = "1.5.5"
4949
lazy_static = "1.4.0"

tests/compiletest.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::ffi::OsString;
44
use std::num::NonZeroUsize;
55
use std::path::{Path, PathBuf};
66
use std::{env, process::Command};
7+
use ui_test::spanned::Spanned;
78
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
89
use ui_test::{status_emitter, CommandBuilder, Format, RustfixMode};
910

@@ -66,8 +67,6 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
6667
}
6768
}
6869
program.args.push("-Zui-testing".into());
69-
program.args.push("--target".into());
70-
program.args.push(target.into());
7170

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

8786
let mut config = Config {
8887
target: Some(target.to_owned()),
89-
stderr_filters: STDERR.clone(),
90-
stdout_filters: STDOUT.clone(),
91-
mode,
9288
program,
9389
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("ui"),
94-
edition: Some("2021".into()), // keep in sync with `./miri run`
9590
threads: std::env::var("MIRI_TEST_THREADS")
9691
.ok()
9792
.map(|threads| NonZeroUsize::new(threads.parse().unwrap()).unwrap()),
9893
..Config::rustc(path)
9994
};
95+
// keep in sync with `./miri run`
96+
config.comment_defaults.base().edition = Some(Spanned::dummy("2021".into())).into();
97+
config.comment_defaults.base().mode = Some(Spanned::dummy(mode)).into();
98+
config.comment_defaults.base().normalize_stdout =
99+
STDOUT.iter().cloned().map(|(m, v)| (m, v.into())).collect();
100+
config.comment_defaults.base().normalize_stderr =
101+
STDERR.iter().cloned().map(|(m, v)| (m, v.into())).collect();
100102

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

123125
// Handle command-line arguments.
124-
let args = ui_test::Args::test()?;
125-
let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
126-
config.with_args(&args, default_bless);
127-
if let OutputConflictHandling::Error(msg) = &mut config.output_conflict_handling {
128-
*msg = "./miri test --bless".into();
129-
}
126+
let mut args = ui_test::Args::test()?;
127+
args.bless |= env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
128+
config.with_args(&args);
129+
config.bless_command = Some("./miri test --bless".into());
130130
if env::var_os("MIRI_SKIP_UI_CHECKS").is_some() {
131-
assert!(!default_bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
131+
assert!(!args.bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
132132
config.output_conflict_handling = OutputConflictHandling::Ignore;
133133
}
134134
eprintln!(" Compiler: {}", config.program.display());

tests/extern-so/fail/function_not_in_so.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: unsupported operation: can't call foreign function `foo` on $OS
2-
--> $DIR/function_not_in_so.rs:LL:CC
2+
--> tests/extern-so/fail/function_not_in_so.rs:LL:CC
33
|
44
LL | foo();
55
| ^^^^^ can't call foreign function `foo` on $OS
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
88
= note: BACKTRACE:
9-
= note: inside `main` at $DIR/function_not_in_so.rs:LL:CC
9+
= note: inside `main` at tests/extern-so/fail/function_not_in_so.rs:LL:CC
1010

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

tests/fail-dep/concurrency/libc_pthread_create_too_few_args.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: Undefined Behavior: callee has fewer arguments than expected
2-
--> $DIR/libc_pthread_create_too_few_args.rs:LL:CC
2+
--> tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs:LL:CC
33
|
44
LL | panic!()
55
| ^^^^^^^^ callee has fewer arguments than expected

tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: Undefined Behavior: callee has more arguments than expected
2-
--> $DIR/libc_pthread_create_too_many_args.rs:LL:CC
2+
--> tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs:LL:CC
33
|
44
LL | panic!()
55
| ^^^^^^^^ callee has more arguments than expected

tests/fail-dep/concurrency/libc_pthread_join_detached.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: Undefined Behavior: trying to join a detached thread
2-
--> $DIR/libc_pthread_join_detached.rs:LL:CC
2+
--> tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
33
|
44
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
10-
= note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC
10+
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
1111

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

tests/fail-dep/concurrency/libc_pthread_join_joined.stderr

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

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

tests/fail-dep/concurrency/libc_pthread_join_main.stderr

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

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

tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr

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

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

tests/fail-dep/concurrency/libc_pthread_join_self.stderr

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

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

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

2020
error: aborting due to 1 previous error
2121

tests/fail-dep/shims/env-set_var-data-race.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
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
2-
--> $DIR/env-set_var-data-race.rs:LL:CC
2+
--> tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC
33
|
44
LL | libc::getenv(b"TZ/0".as_ptr().cast());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
66
|
77
help: and (1) occurred earlier here
8-
--> $DIR/env-set_var-data-race.rs:LL:CC
8+
--> tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC
99
|
1010
LL | env::set_var("MY_RUST_VAR", "Ferris");
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1313
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1414
= note: BACKTRACE (of the first span):
15-
= note: inside closure at $DIR/env-set_var-data-race.rs:LL:CC
15+
= note: inside closure at tests/fail-dep/shims/env-set_var-data-race.rs:LL:CC
1616

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

tests/fail-dep/shims/fs/close_stdout.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: unsupported operation: cannot close stdout
2-
--> $DIR/close_stdout.rs:LL:CC
2+
--> tests/fail-dep/shims/fs/close_stdout.rs:LL:CC
33
|
44
LL | libc::close(1);
55
| ^^^^^^^^^^^^^^ cannot close stdout
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
88
= note: BACKTRACE:
9-
= note: inside `main` at $DIR/close_stdout.rs:LL:CC
9+
= note: inside `main` at tests/fail-dep/shims/fs/close_stdout.rs:LL:CC
1010

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

tests/fail-dep/shims/fs/isolated_stdin.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: unsupported operation: `read` from stdin not available when isolation is enabled
2-
--> $DIR/isolated_stdin.rs:LL:CC
2+
--> tests/fail-dep/shims/fs/isolated_stdin.rs:LL:CC
33
|
44
LL | libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `read` from stdin not available when isolation is enabled
66
|
77
= help: pass the flag `-Zmiri-disable-isolation` to disable isolation;
88
= 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
99
= note: BACKTRACE:
10-
= note: inside `main` at $DIR/isolated_stdin.rs:LL:CC
10+
= note: inside `main` at tests/fail-dep/shims/fs/isolated_stdin.rs:LL:CC
1111

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

tests/fail-dep/shims/fs/mkstemp_immutable_arg.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: Undefined Behavior: writing to ALLOC which is read-only
2-
--> $DIR/mkstemp_immutable_arg.rs:LL:CC
2+
--> tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
33
|
44
LL | let _fd = unsafe { libc::mkstemp(s) };
55
| ^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
10-
= note: inside `test_mkstemp_immutable_arg` at $DIR/mkstemp_immutable_arg.rs:LL:CC
10+
= note: inside `test_mkstemp_immutable_arg` at tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
1111
note: inside `main`
12-
--> $DIR/mkstemp_immutable_arg.rs:LL:CC
12+
--> tests/fail-dep/shims/fs/mkstemp_immutable_arg.rs:LL:CC
1313
|
1414
LL | test_mkstemp_immutable_arg();
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/fail-dep/shims/fs/read_from_stdout.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: unsupported operation: cannot read from stdout
2-
--> $DIR/read_from_stdout.rs:LL:CC
2+
--> tests/fail-dep/shims/fs/read_from_stdout.rs:LL:CC
33
|
44
LL | libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
88
= note: BACKTRACE:
9-
= note: inside `main` at $DIR/read_from_stdout.rs:LL:CC
9+
= note: inside `main` at tests/fail-dep/shims/fs/read_from_stdout.rs:LL:CC
1010

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

tests/fail-dep/shims/fs/unix_open_missing_required_mode.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
2-
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
2+
--> tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
33
|
44
LL | ...safe { libc::open(name_ptr, libc::O_CREAT) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
10-
= note: inside `test_file_open_missing_needed_mode` at $DIR/unix_open_missing_required_mode.rs:LL:CC
10+
= note: inside `test_file_open_missing_needed_mode` at tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
1111
note: inside `main`
12-
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
12+
--> tests/fail-dep/shims/fs/unix_open_missing_required_mode.rs:LL:CC
1313
|
1414
LL | test_file_open_missing_needed_mode();
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)