Skip to content

Commit d28fb80

Browse files
committed
Bump ui_test
1 parent 4bc0e25 commit d28fb80

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ windows-sys = { version = "0.52", features = [
4848
] }
4949

5050
[dev-dependencies]
51+
ui_test = "0.27.1"
5152
colored = "2"
52-
ui_test = "0.26.5"
5353
rustc_version = "0.4"
5454
regex = "1.5.5"
5555
tempfile = "3"

tests/ui.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ui_test::custom_flags::edition::Edition;
1313
use ui_test::dependencies::DependencyBuilder;
1414
use ui_test::per_test_config::TestConfig;
1515
use ui_test::spanned::Spanned;
16-
use ui_test::{CommandBuilder, Config, Format, Match, OutputConflictHandling, status_emitter};
16+
use ui_test::{CommandBuilder, Config, Format, Match, ignore_output_conflict, status_emitter};
1717

1818
#[derive(Copy, Clone, Debug)]
1919
enum Mode {
@@ -81,7 +81,9 @@ fn build_native_lib() -> PathBuf {
8181
native_lib_path
8282
}
8383

84-
struct WithDependencies {}
84+
struct WithDependencies {
85+
bless: bool,
86+
}
8587

8688
/// Does *not* set any args or env vars, since it is shared between the test runner and
8789
/// run_dep_mode.
@@ -125,7 +127,7 @@ fn miri_config(
125127
// keep in sync with `./miri run`
126128
config.comment_defaults.base().add_custom("edition", Edition("2021".into()));
127129

128-
if let Some(WithDependencies {}) = with_dependencies {
130+
if let Some(WithDependencies { bless }) = with_dependencies {
129131
config.comment_defaults.base().set_custom("dependencies", DependencyBuilder {
130132
program: CommandBuilder {
131133
// Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
@@ -140,6 +142,7 @@ fn miri_config(
140142
},
141143
crate_manifest_path: Path::new("test_dependencies").join("Cargo.toml"),
142144
build_std: None,
145+
bless_lockfile: bless,
143146
});
144147
}
145148
config
@@ -156,15 +159,15 @@ fn run_tests(
156159
let mut args = ui_test::Args::test()?;
157160
args.bless |= env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
158161

159-
let with_dependencies = with_dependencies.then_some(WithDependencies {});
162+
let with_dependencies = with_dependencies.then_some(WithDependencies { bless: args.bless });
160163

161164
let mut config = miri_config(target, path, mode, with_dependencies);
162165
config.with_args(&args);
163166
config.bless_command = Some("./miri test --bless".into());
164167

165168
if env::var_os("MIRI_SKIP_UI_CHECKS").is_some() {
166169
assert!(!args.bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
167-
config.output_conflict_handling = OutputConflictHandling::Ignore;
170+
config.output_conflict_handling = ignore_output_conflict;
168171
}
169172

170173
// Add a test env var to do environment communication tests.
@@ -338,7 +341,8 @@ fn main() -> Result<()> {
338341
}
339342

340343
fn run_dep_mode(target: String, args: impl Iterator<Item = OsString>) -> Result<()> {
341-
let mut config = miri_config(&target, "", Mode::RunDep, Some(WithDependencies {}));
344+
let mut config =
345+
miri_config(&target, "", Mode::RunDep, Some(WithDependencies { bless: false }));
342346
config.comment_defaults.base().custom.remove("edition"); // `./miri` adds an `--edition` in `args`, so don't set it twice
343347
config.fill_host_and_target()?;
344348
config.program.args = args.collect();

0 commit comments

Comments
 (0)