@@ -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 {
@@ -81,7 +81,9 @@ fn build_native_lib() -> PathBuf {
81
81
native_lib_path
82
82
}
83
83
84
- struct WithDependencies { }
84
+ struct WithDependencies {
85
+ bless : bool ,
86
+ }
85
87
86
88
/// Does *not* set any args or env vars, since it is shared between the test runner and
87
89
/// run_dep_mode.
@@ -125,7 +127,7 @@ fn miri_config(
125
127
// keep in sync with `./miri run`
126
128
config. comment_defaults . base ( ) . add_custom ( "edition" , Edition ( "2021" . into ( ) ) ) ;
127
129
128
- if let Some ( WithDependencies { } ) = with_dependencies {
130
+ if let Some ( WithDependencies { bless } ) = with_dependencies {
129
131
config. comment_defaults . base ( ) . set_custom ( "dependencies" , DependencyBuilder {
130
132
program : CommandBuilder {
131
133
// 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(
140
142
} ,
141
143
crate_manifest_path : Path :: new ( "test_dependencies" ) . join ( "Cargo.toml" ) ,
142
144
build_std : None ,
145
+ bless_lockfile : bless,
143
146
} ) ;
144
147
}
145
148
config
@@ -156,15 +159,15 @@ fn run_tests(
156
159
let mut args = ui_test:: Args :: test ( ) ?;
157
160
args. bless |= env:: var_os ( "RUSTC_BLESS" ) . is_some_and ( |v| v != "0" ) ;
158
161
159
- let with_dependencies = with_dependencies. then_some ( WithDependencies { } ) ;
162
+ let with_dependencies = with_dependencies. then_some ( WithDependencies { bless : args . bless } ) ;
160
163
161
164
let mut config = miri_config ( target, path, mode, with_dependencies) ;
162
165
config. with_args ( & args) ;
163
166
config. bless_command = Some ( "./miri test --bless" . into ( ) ) ;
164
167
165
168
if env:: var_os ( "MIRI_SKIP_UI_CHECKS" ) . is_some ( ) {
166
169
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 ;
168
171
}
169
172
170
173
// Add a test env var to do environment communication tests.
@@ -338,7 +341,8 @@ fn main() -> Result<()> {
338
341
}
339
342
340
343
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 } ) ) ;
342
346
config. comment_defaults . base ( ) . custom . remove ( "edition" ) ; // `./miri` adds an `--edition` in `args`, so don't set it twice
343
347
config. fill_host_and_target ( ) ?;
344
348
config. program . args = args. collect ( ) ;
0 commit comments