@@ -42,7 +42,7 @@ use errors;
42
42
use errors:: emitter:: ColorConfig ;
43
43
44
44
use clean:: Attributes ;
45
- use html:: markdown;
45
+ use html:: markdown:: { self , LangString } ;
46
46
47
47
#[ derive( Clone , Default ) ]
48
48
pub struct TestOptions {
@@ -533,10 +533,8 @@ impl Collector {
533
533
format ! ( "{} - {} (line {})" , filename, self . names. join( "::" ) , line)
534
534
}
535
535
536
- pub fn add_test ( & mut self , test : String ,
537
- should_panic : bool , no_run : bool , should_ignore : bool ,
538
- as_test_harness : bool , compile_fail : bool , error_codes : Vec < String > ,
539
- line : usize , filename : FileName , allow_fail : bool ) {
536
+ pub fn add_test ( & mut self , test : String , config : LangString , line : usize ) {
537
+ let filename = self . get_filename ( ) ;
540
538
let name = self . generate_name ( line, & filename) ;
541
539
let cfgs = self . cfgs . clone ( ) ;
542
540
let libs = self . libs . clone ( ) ;
@@ -551,10 +549,10 @@ impl Collector {
551
549
self . tests . push ( testing:: TestDescAndFn {
552
550
desc : testing:: TestDesc {
553
551
name : testing:: DynTestName ( name. clone ( ) ) ,
554
- ignore : should_ignore ,
552
+ ignore : config . ignore ,
555
553
// compiler failures are test failures
556
554
should_panic : testing:: ShouldPanic :: No ,
557
- allow_fail,
555
+ allow_fail : config . allow_fail ,
558
556
} ,
559
557
testfn : testing:: DynTestFn ( box move || {
560
558
let panic = io:: set_panic ( None ) ;
@@ -572,11 +570,11 @@ impl Collector {
572
570
libs,
573
571
cg,
574
572
externs,
575
- should_panic,
576
- no_run,
577
- as_test_harness ,
578
- compile_fail,
579
- error_codes,
573
+ config . should_panic ,
574
+ config . no_run ,
575
+ config . test_harness ,
576
+ config . compile_fail ,
577
+ config . error_codes ,
580
578
& opts,
581
579
maybe_sysroot,
582
580
linker,
@@ -604,7 +602,7 @@ impl Collector {
604
602
self . position = position;
605
603
}
606
604
607
- pub fn get_filename ( & self ) -> FileName {
605
+ fn get_filename ( & self ) -> FileName {
608
606
if let Some ( ref codemap) = self . codemap {
609
607
let filename = codemap. span_to_filename ( self . position ) ;
610
608
if let FileName :: Real ( ref filename) = filename {
0 commit comments