@@ -293,14 +293,11 @@ fn run_test(
293
293
crate_name : & str ,
294
294
line : usize ,
295
295
options : Options ,
296
- should_panic : bool ,
296
+ mut lang_string : LangString ,
297
297
no_run : bool ,
298
- as_test_harness : bool ,
299
298
runtool : Option < String > ,
300
299
runtool_args : Vec < String > ,
301
300
target : TargetTriple ,
302
- compile_fail : bool ,
303
- mut error_codes : Vec < String > ,
304
301
opts : & TestOptions ,
305
302
edition : Edition ,
306
303
outdir : DirState ,
@@ -309,7 +306,7 @@ fn run_test(
309
306
report_unused_externs : impl Fn ( UnusedExterns ) ,
310
307
) -> Result < ( ) , TestFailure > {
311
308
let ( test, line_offset, supports_color) =
312
- make_test ( test, Some ( crate_name) , as_test_harness , opts, edition, Some ( test_id) ) ;
309
+ make_test ( test, Some ( crate_name) , lang_string . test_harness , opts, edition, Some ( test_id) ) ;
313
310
314
311
let output_file = outdir. path ( ) . join ( "rust_out" ) ;
315
312
@@ -329,10 +326,10 @@ fn run_test(
329
326
compiler. env ( "UNSTABLE_RUSTDOC_TEST_PATH" , path) ;
330
327
compiler. env ( "UNSTABLE_RUSTDOC_TEST_LINE" , format ! ( "{}" , line as isize - line_offset as isize ) ) ;
331
328
compiler. arg ( "-o" ) . arg ( & output_file) ;
332
- if as_test_harness {
329
+ if lang_string . test_harness {
333
330
compiler. arg ( "--test" ) ;
334
331
}
335
- if options. json_unused_externs && !compile_fail {
332
+ if options. json_unused_externs && !lang_string . compile_fail {
336
333
compiler. arg ( "--error-format=json" ) ;
337
334
compiler. arg ( "--json" ) . arg ( "unused-externs" ) ;
338
335
compiler. arg ( "-Z" ) . arg ( "unstable-options" ) ;
@@ -351,7 +348,7 @@ fn run_test(
351
348
for debugging_option_str in & options. debugging_opts_strs {
352
349
compiler. arg ( "-Z" ) . arg ( & debugging_option_str) ;
353
350
}
354
- if no_run && !compile_fail && options. persist_doctests . is_none ( ) {
351
+ if no_run && !lang_string . compile_fail && options. persist_doctests . is_none ( ) {
355
352
compiler. arg ( "--emit=metadata" ) ;
356
353
}
357
354
compiler. arg ( "--target" ) . arg ( match target {
@@ -418,20 +415,20 @@ fn run_test(
418
415
419
416
let out = out_lines. join ( "\n " ) ;
420
417
let _bomb = Bomb ( & out) ;
421
- match ( output. status . success ( ) , compile_fail) {
418
+ match ( output. status . success ( ) , lang_string . compile_fail ) {
422
419
( true , true ) => {
423
420
return Err ( TestFailure :: UnexpectedCompilePass ) ;
424
421
}
425
422
( true , false ) => { }
426
423
( false , true ) => {
427
- if !error_codes. is_empty ( ) {
424
+ if !lang_string . error_codes . is_empty ( ) {
428
425
// We used to check if the output contained "error[{}]: " but since we added the
429
426
// colored output, we can't anymore because of the color escape characters before
430
427
// the ":".
431
- error_codes. retain ( |err| !out. contains ( & format ! ( "error[{}]" , err) ) ) ;
428
+ lang_string . error_codes . retain ( |err| !out. contains ( & format ! ( "error[{}]" , err) ) ) ;
432
429
433
- if !error_codes. is_empty ( ) {
434
- return Err ( TestFailure :: MissingErrorCodes ( error_codes) ) ;
430
+ if !lang_string . error_codes . is_empty ( ) {
431
+ return Err ( TestFailure :: MissingErrorCodes ( lang_string . error_codes ) ) ;
435
432
}
436
433
}
437
434
}
@@ -470,9 +467,9 @@ fn run_test(
470
467
match result {
471
468
Err ( e) => return Err ( TestFailure :: ExecutionError ( e) ) ,
472
469
Ok ( out) => {
473
- if should_panic && out. status . success ( ) {
470
+ if lang_string . should_panic && out. status . success ( ) {
474
471
return Err ( TestFailure :: UnexpectedRunPass ) ;
475
- } else if !should_panic && !out. status . success ( ) {
472
+ } else if !lang_string . should_panic && !out. status . success ( ) {
476
473
return Err ( TestFailure :: ExecutionFailure ( out) ) ;
477
474
}
478
475
}
@@ -966,14 +963,11 @@ impl Tester for Collector {
966
963
& crate_name,
967
964
line,
968
965
options,
969
- config. should_panic ,
966
+ config,
970
967
no_run,
971
- config. test_harness ,
972
968
runtool,
973
969
runtool_args,
974
970
target,
975
- config. compile_fail ,
976
- config. error_codes ,
977
971
& opts,
978
972
edition,
979
973
outdir,
0 commit comments