@@ -13,7 +13,7 @@ use ui_test::custom_flags::edition::Edition;
13
13
use ui_test:: dependencies:: DependencyBuilder ;
14
14
use ui_test:: per_test_config:: TestConfig ;
15
15
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} ;
17
17
18
18
#[ derive( Copy , Clone , Debug ) ]
19
19
enum Mode {
@@ -82,7 +82,9 @@ fn build_native_lib() -> PathBuf {
82
82
native_lib_path
83
83
}
84
84
85
- struct WithDependencies { }
85
+ struct WithDependencies {
86
+ bless : bool ,
87
+ }
86
88
87
89
/// Does *not* set any args or env vars, since it is shared between the test runner and
88
90
/// run_dep_mode.
@@ -126,7 +128,7 @@ fn miri_config(
126
128
// keep in sync with `./miri run`
127
129
config. comment_defaults . base ( ) . add_custom ( "edition" , Edition ( "2021" . into ( ) ) ) ;
128
130
129
- if let Some ( WithDependencies { } ) = with_dependencies {
131
+ if let Some ( WithDependencies { bless } ) = with_dependencies {
130
132
config. comment_defaults . base ( ) . set_custom ( "dependencies" , DependencyBuilder {
131
133
program : CommandBuilder {
132
134
// Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
@@ -141,6 +143,7 @@ fn miri_config(
141
143
} ,
142
144
crate_manifest_path : Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ,
143
145
build_std : None ,
146
+ bless_lockfile : bless,
144
147
} ) ;
145
148
}
146
149
config
@@ -157,15 +160,15 @@ fn run_tests(
157
160
let mut args = ui_test:: Args :: test ( ) ?;
158
161
args. bless |= env:: var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) ;
159
162
160
- let with_dependencies = with_dependencies. then_some ( WithDependencies { } ) ;
163
+ let with_dependencies = with_dependencies. then_some ( WithDependencies { bless : args . bless } ) ;
161
164
162
165
let mut config = miri_config ( target, path, mode, with_dependencies) ;
163
166
config. with_args ( & args) ;
164
167
config. bless_command = Some ( "./miri test --bless" . into ( ) ) ;
165
168
166
169
if env:: var_os ( "MIRI_SKIP_UI_CHECKS" ) . is_some ( ) {
167
170
assert ! ( !args. bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time" ) ;
168
- config. output_conflict_handling = OutputConflictHandling :: Ignore ;
171
+ config. output_conflict_handling = ignore_output_conflict ;
169
172
}
170
173
171
174
// Add a test env var to do environment communication tests.
@@ -337,7 +340,8 @@ fn main() -> Result<()> {
337
340
}
338
341
339
342
fn run_dep_mode ( target : String , args : impl Iterator < Item = OsString > ) -> Result < ( ) > {
340
- let mut config = miri_config ( & target, "" , Mode :: RunDep , Some ( WithDependencies { } ) ) ;
343
+ let mut config =
344
+ miri_config ( & target, "" , Mode :: RunDep , Some ( WithDependencies { bless : false } ) ) ;
341
345
config. comment_defaults . base ( ) . custom . remove ( "edition" ) ; // `./miri` adds an `--edition` in `args`, so don't set it twice
342
346
config. fill_host_and_target ( ) ?;
343
347
config. program . args = args. collect ( ) ;
0 commit comments