Skip to content

Commit 32c2ed7

Browse files
committed
Bump ui test crate
1 parent ce33ca0 commit 32c2ed7

File tree

3 files changed

+115
-50
lines changed

3 files changed

+115
-50
lines changed

src/tools/miri/Cargo.lock

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ dependencies = [
2626
"memchr",
2727
]
2828

29+
[[package]]
30+
name = "ansi_term"
31+
version = "0.12.1"
32+
source = "registry+https://github.com/rust-lang/crates.io-index"
33+
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
34+
dependencies = [
35+
"winapi",
36+
]
37+
2938
[[package]]
3039
name = "anyhow"
3140
version = "1.0.71"
@@ -159,6 +168,25 @@ dependencies = [
159168
"windows-sys 0.48.0",
160169
]
161170

171+
[[package]]
172+
name = "comma"
173+
version = "1.0.0"
174+
source = "registry+https://github.com/rust-lang/crates.io-index"
175+
checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
176+
177+
[[package]]
178+
name = "console"
179+
version = "0.15.7"
180+
source = "registry+https://github.com/rust-lang/crates.io-index"
181+
checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8"
182+
dependencies = [
183+
"encode_unicode",
184+
"lazy_static",
185+
"libc",
186+
"unicode-width",
187+
"windows-sys 0.45.0",
188+
]
189+
162190
[[package]]
163191
name = "crossbeam-channel"
164192
version = "0.5.8"
@@ -189,10 +217,16 @@ dependencies = [
189217
]
190218

191219
[[package]]
192-
name = "diff"
193-
version = "0.1.13"
220+
name = "distance"
221+
version = "0.4.0"
222+
source = "registry+https://github.com/rust-lang/crates.io-index"
223+
checksum = "6d9d8664cf849d7d0f3114a3a387d2f5e4303176d746d5a951aaddc66dfe9240"
224+
225+
[[package]]
226+
name = "encode_unicode"
227+
version = "0.3.6"
194228
source = "registry+https://github.com/rust-lang/crates.io-index"
195-
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
229+
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
196230

197231
[[package]]
198232
name = "env_logger"
@@ -282,6 +316,19 @@ version = "0.3.3"
282316
source = "registry+https://github.com/rust-lang/crates.io-index"
283317
checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
284318

319+
[[package]]
320+
name = "indicatif"
321+
version = "0.17.7"
322+
source = "registry+https://github.com/rust-lang/crates.io-index"
323+
checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25"
324+
dependencies = [
325+
"console",
326+
"instant",
327+
"number_prefix",
328+
"portable-atomic",
329+
"unicode-width",
330+
]
331+
285332
[[package]]
286333
name = "instant"
287334
version = "0.1.12"
@@ -463,6 +510,12 @@ dependencies = [
463510
"static_assertions",
464511
]
465512

513+
[[package]]
514+
name = "number_prefix"
515+
version = "0.4.0"
516+
source = "registry+https://github.com/rust-lang/crates.io-index"
517+
checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
518+
466519
[[package]]
467520
name = "object"
468521
version = "0.30.3"
@@ -484,6 +537,15 @@ version = "3.5.0"
484537
source = "registry+https://github.com/rust-lang/crates.io-index"
485538
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
486539

540+
[[package]]
541+
name = "pad"
542+
version = "0.1.6"
543+
source = "registry+https://github.com/rust-lang/crates.io-index"
544+
checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3"
545+
dependencies = [
546+
"unicode-width",
547+
]
548+
487549
[[package]]
488550
name = "parking_lot"
489551
version = "0.11.2"
@@ -524,12 +586,28 @@ version = "0.2.9"
524586
source = "registry+https://github.com/rust-lang/crates.io-index"
525587
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
526588

589+
[[package]]
590+
name = "portable-atomic"
591+
version = "1.4.3"
592+
source = "registry+https://github.com/rust-lang/crates.io-index"
593+
checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b"
594+
527595
[[package]]
528596
name = "ppv-lite86"
529597
version = "0.2.17"
530598
source = "registry+https://github.com/rust-lang/crates.io-index"
531599
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
532600

601+
[[package]]
602+
name = "prettydiff"
603+
version = "0.6.4"
604+
source = "registry+https://github.com/rust-lang/crates.io-index"
605+
checksum = "8ff1fec61082821f8236cf6c0c14e8172b62ce8a72a0eedc30d3b247bb68dc11"
606+
dependencies = [
607+
"ansi_term",
608+
"pad",
609+
]
610+
533611
[[package]]
534612
name = "proc-macro2"
535613
version = "1.0.66"
@@ -859,18 +937,22 @@ dependencies = [
859937

860938
[[package]]
861939
name = "ui_test"
862-
version = "0.11.7"
940+
version = "0.14.2"
863941
source = "registry+https://github.com/rust-lang/crates.io-index"
864-
checksum = "c21899b59f53717dfad29e4f46e5b21a200a1b6888ab86532a07cfc8b48dd78c"
942+
checksum = "33d15b71b50d95aeb687f68289543b9cabdbec7afc277176ce9dfcf192c7035d"
865943
dependencies = [
944+
"anyhow",
866945
"bstr",
867946
"cargo-platform",
868947
"cargo_metadata",
869948
"color-eyre",
870949
"colored",
950+
"comma",
871951
"crossbeam-channel",
872-
"diff",
952+
"distance",
953+
"indicatif",
873954
"lazy_static",
955+
"prettydiff",
874956
"regex",
875957
"rustc_version",
876958
"rustfix",
@@ -885,6 +967,12 @@ version = "1.0.8"
885967
source = "registry+https://github.com/rust-lang/crates.io-index"
886968
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
887969

970+
[[package]]
971+
name = "unicode-width"
972+
version = "0.1.11"
973+
source = "registry+https://github.com/rust-lang/crates.io-index"
974+
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
975+
888976
[[package]]
889977
name = "valuable"
890978
version = "0.1.0"

src/tools/miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libloading = "0.7"
3636

3737
[dev-dependencies]
3838
colored = "2"
39-
ui_test = "0.11.7"
39+
ui_test = "0.14"
4040
rustc_version = "0.4"
4141
# Features chosen to match those required by env_logger, to avoid rebuilds
4242
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }

src/tools/miri/tests/compiletest.rs

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
9797
output_conflict_handling,
9898
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("ui"),
9999
edition: Some("2021".into()),
100-
..Config::rustc(path.into())
100+
..Config::rustc(path)
101101
};
102102

103103
let use_std = env::var_os("MIRI_NO_STD").is_none();
@@ -123,49 +123,19 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
123123
let config = test_config(target, path, mode, with_dependencies);
124124

125125
// Handle command-line arguments.
126-
let mut after_dashdash = false;
127-
let mut quiet = false;
128-
let filters = std::env::args()
129-
.skip(1)
130-
.filter(|arg| {
131-
if after_dashdash {
132-
// Just propagate everything.
133-
return true;
134-
}
135-
match &**arg {
136-
"--quiet" => {
137-
quiet = true;
138-
false
139-
}
140-
"--" => {
141-
after_dashdash = true;
142-
false
143-
}
144-
s if s.starts_with('-') => {
145-
panic!("unknown compiletest flag `{s}`");
146-
}
147-
_ => true,
148-
}
149-
})
150-
.collect::<Vec<_>>();
126+
let args = ui_test::Args::test();
127+
let quiet = args.quiet;
151128
eprintln!(" Compiler: {}", config.program.display());
152129
ui_test::run_tests_generic(
153-
config,
130+
vec![config],
131+
std::thread::available_parallelism().unwrap(),
132+
args,
154133
// The files we're actually interested in (all `.rs` files).
155-
|path| {
156-
path.extension().is_some_and(|ext| ext == "rs")
157-
&& (filters.is_empty()
158-
|| filters.iter().any(|f| path.display().to_string().contains(f)))
159-
},
134+
ui_test::default_file_filter,
160135
// This could be used to overwrite the `Config` on a per-test basis.
161-
|_, _| None,
136+
|_, _| {},
162137
(
163-
if quiet {
164-
Box::<status_emitter::Quiet>::default()
165-
as Box<dyn status_emitter::StatusEmitter + Send>
166-
} else {
167-
Box::new(status_emitter::Text)
168-
},
138+
if quiet { status_emitter::Text::quiet() } else { status_emitter::Text::verbose() },
169139
status_emitter::Gha::</* GHA Actions groups*/ false> {
170140
name: format!("{mode:?} {path} ({target})"),
171141
},
@@ -269,11 +239,16 @@ fn main() -> Result<()> {
269239
ui(Mode::Pass, "tests/pass", &target, WithoutDependencies)?;
270240
ui(Mode::Pass, "tests/pass-dep", &target, WithDependencies)?;
271241
ui(Mode::Panic, "tests/panic", &target, WithDependencies)?;
272-
ui(Mode::Fail { require_patterns: true }, "tests/fail", &target, WithDependencies)?;
242+
ui(
243+
Mode::Fail { require_patterns: true, rustfix: false },
244+
"tests/fail",
245+
&target,
246+
WithDependencies,
247+
)?;
273248
if cfg!(target_os = "linux") {
274249
ui(Mode::Pass, "tests/extern-so/pass", &target, WithoutDependencies)?;
275250
ui(
276-
Mode::Fail { require_patterns: true },
251+
Mode::Fail { require_patterns: true, rustfix: false },
277252
"tests/extern-so/fail",
278253
&target,
279254
WithoutDependencies,
@@ -285,11 +260,13 @@ fn main() -> Result<()> {
285260

286261
fn run_dep_mode(target: String, mut args: impl Iterator<Item = OsString>) -> Result<()> {
287262
let path = args.next().expect("./miri run-dep must be followed by a file name");
288-
let mut config = test_config(&target, "", Mode::Yolo, /* with dependencies */ true);
263+
let mut config =
264+
test_config(&target, "", Mode::Yolo { rustfix: false }, /* with dependencies */ true);
289265
config.program.args.clear(); // We want to give the user full control over flags
290-
config.build_dependencies_and_link_them()?;
266+
let dep_args = config.build_dependencies()?;
291267

292268
let mut cmd = config.program.build(&config.out_dir);
269+
cmd.args(dep_args);
293270

294271
cmd.arg(path);
295272

0 commit comments

Comments
 (0)