1+ use tester as test;
2+
13#[ macro_use]
24extern crate serde;
35
@@ -32,7 +34,7 @@ fn run_data_url(
3234
3335fn collect_data_url < F > ( add_test : & mut F )
3436where
35- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
37+ F : FnMut ( String , bool , test :: TestFn ) ,
3638{
3739 let known_failures = [ "data://test:test/,X" ] ;
3840
5355 add_test (
5456 format ! ( "data: URL {:?}" , input) ,
5557 should_panic,
56- rustc_test :: TestFn :: dyn_test_fn ( move || {
58+ test :: TestFn :: DynTestFn ( Box :: new ( move || {
5759 run_data_url ( input, expected_mime, expected_body, should_panic)
58- } ) ,
60+ } ) ) ,
5961 ) ;
6062 }
6163}
@@ -72,7 +74,7 @@ fn run_base64(input: String, expected: Option<Vec<u8>>) {
7274
7375fn collect_base64 < F > ( add_test : & mut F )
7476where
75- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
77+ F : FnMut ( String , bool , test :: TestFn ) ,
7678{
7779 let known_failures = [ ] ;
7880
8385 add_test (
8486 format ! ( "base64 {:?}" , input) ,
8587 should_panic,
86- rustc_test :: TestFn :: dyn_test_fn ( move || run_base64 ( input, expected) ) ,
88+ test :: TestFn :: DynTestFn ( Box :: new ( move || run_base64 ( input, expected) ) ) ,
8789 ) ;
8890 }
8991}
@@ -100,7 +102,7 @@ fn run_mime(input: String, expected: Option<String>) {
100102
101103fn collect_mime < F > ( add_test : & mut F )
102104where
103- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
105+ F : FnMut ( String , bool , test :: TestFn ) ,
104106{
105107 let known_failures = [ ] ;
106108
@@ -136,24 +138,30 @@ where
136138 format ! ( "MIME type {:?}" , input)
137139 } ,
138140 should_panic,
139- rustc_test :: TestFn :: dyn_test_fn ( move || run_mime ( input, expected) ) ,
141+ test :: TestFn :: DynTestFn ( Box :: new ( move || run_mime ( input, expected) ) ) ,
140142 ) ;
141143 }
142144}
143145
144146fn main ( ) {
145147 let mut tests = Vec :: new ( ) ;
146148 {
147- let mut add_one = |name : String , should_panic : bool , run : rustc_test:: TestFn | {
148- let mut desc = rustc_test:: TestDesc :: new ( rustc_test:: DynTestName ( name) ) ;
149- if should_panic {
150- desc. should_panic = rustc_test:: ShouldPanic :: Yes
151- }
152- tests. push ( rustc_test:: TestDescAndFn { desc, testfn : run } )
149+ let mut add_one = |name : String , should_panic : bool , run : test:: TestFn | {
150+ let desc = test:: TestDesc {
151+ name : test:: DynTestName ( name) ,
152+ ignore : false ,
153+ should_panic : match should_panic {
154+ true => test:: ShouldPanic :: Yes ,
155+ false => test:: ShouldPanic :: No ,
156+ } ,
157+ allow_fail : false ,
158+ test_type : test:: TestType :: Unknown ,
159+ } ;
160+ tests. push ( test:: TestDescAndFn { desc, testfn : run } )
153161 } ;
154162 collect_data_url ( & mut add_one) ;
155163 collect_base64 ( & mut add_one) ;
156164 collect_mime ( & mut add_one) ;
157165 }
158- rustc_test :: test_main ( & std:: env:: args ( ) . collect :: < Vec < _ > > ( ) , tests)
166+ test :: test_main ( & std:: env:: args ( ) . collect :: < Vec < _ > > ( ) , tests, None )
159167}
0 commit comments