@@ -293,50 +293,6 @@ fn mk_std(cx: &TestCtxt) -> ast::view_item {
293
293
}
294
294
}
295
295
296
- #[ cfg( stage0) ]
297
- fn mk_test_module ( cx : & TestCtxt ) -> @ast:: item {
298
-
299
- // Link to extra
300
- let view_items = ~[ mk_std ( cx) ] ;
301
-
302
- // A constant vector of test descriptors.
303
- let tests = mk_tests ( cx) ;
304
-
305
- // The synthesized main function which will call the console test runner
306
- // with our list of tests
307
- let ext_cx = cx. ext_cx ;
308
- let mainfn = ( quote_item ! (
309
- pub fn main( ) {
310
- #[ main] ;
311
- extra:: test:: test_main_static( :: std:: os:: args( ) , TESTS ) ;
312
- }
313
- ) ) . unwrap ( ) ;
314
-
315
- let testmod = ast:: _mod {
316
- view_items : view_items,
317
- items : ~[ mainfn, tests] ,
318
- } ;
319
- let item_ = ast:: item_mod ( testmod) ;
320
-
321
- // This attribute tells resolve to let us call unexported functions
322
- let resolve_unexported_attr =
323
- attr:: mk_attr ( attr:: mk_word_item ( @"!resolve_unexported") ) ;
324
-
325
- let item = ast:: item {
326
- ident : cx. sess . ident_of ( "__test" ) ,
327
- attrs : ~[ resolve_unexported_attr] ,
328
- id : ast:: DUMMY_NODE_ID ,
329
- node : item_,
330
- vis : ast:: public,
331
- span : dummy_sp ( ) ,
332
- } ;
333
-
334
- debug ! ( "Synthetic test module:\n %s\n " ,
335
- pprust:: item_to_str( @item. clone( ) , cx. sess. intr( ) ) ) ;
336
-
337
- return @item;
338
- }
339
- #[ cfg( not( stage0) ) ]
340
296
fn mk_test_module ( cx : & TestCtxt ) -> @ast:: item {
341
297
342
298
// Link to extra
@@ -407,21 +363,6 @@ fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
407
363
}
408
364
}
409
365
410
- #[ cfg( stage0) ]
411
- fn mk_tests ( cx : & TestCtxt ) -> @ast:: item {
412
-
413
- let ext_cx = cx. ext_cx ;
414
-
415
- // The vector of test_descs for this crate
416
- let test_descs = mk_test_descs ( cx) ;
417
-
418
- ( quote_item ! (
419
- pub static TESTS : & ' static [ self :: extra:: test:: TestDescAndFn ] =
420
- $test_descs
421
- ;
422
- ) ) . unwrap ( )
423
- }
424
- #[ cfg( not( stage0) ) ]
425
366
fn mk_tests ( cx : & TestCtxt ) -> @ast:: item {
426
367
// The vector of test_descs for this crate
427
368
let test_descs = mk_test_descs ( cx) ;
@@ -461,63 +402,6 @@ fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
461
402
}
462
403
}
463
404
464
- #[ cfg( stage0) ]
465
- fn mk_test_desc_and_fn_rec ( cx : & TestCtxt , test : & Test ) -> @ast:: Expr {
466
- let span = test. span ;
467
- let path = test. path . clone ( ) ;
468
-
469
- let ext_cx = cx. ext_cx ;
470
-
471
- debug ! ( "encoding %s" , ast_util:: path_name_i( path) ) ;
472
-
473
- let name_lit: ast:: lit =
474
- nospan ( ast:: lit_str ( ast_util:: path_name_i ( path) . to_managed ( ) ) ) ;
475
-
476
- let name_expr = @ast:: Expr {
477
- id : ast:: DUMMY_NODE_ID ,
478
- node : ast:: ExprLit ( @name_lit) ,
479
- span : span
480
- } ;
481
-
482
- let fn_path = path_node_global ( path) ;
483
-
484
- let fn_expr = @ast:: Expr {
485
- id : ast:: DUMMY_NODE_ID ,
486
- node : ast:: ExprPath ( fn_path) ,
487
- span : span,
488
- } ;
489
-
490
- let t_expr = if test. bench {
491
- quote_expr ! ( self :: extra:: test:: StaticBenchFn ( $fn_expr) )
492
- } else {
493
- quote_expr ! ( self :: extra:: test:: StaticTestFn ( $fn_expr) )
494
- } ;
495
-
496
- let ignore_expr = if test. ignore {
497
- quote_expr ! ( true )
498
- } else {
499
- quote_expr ! ( false )
500
- } ;
501
-
502
- let fail_expr = if test. should_fail {
503
- quote_expr ! ( true )
504
- } else {
505
- quote_expr ! ( false )
506
- } ;
507
-
508
- let e = quote_expr ! (
509
- self :: extra:: test:: TestDescAndFn {
510
- desc: self :: extra:: test:: TestDesc {
511
- name: self :: extra:: test:: StaticTestName ( $name_expr) ,
512
- ignore: $ignore_expr,
513
- should_fail: $fail_expr
514
- } ,
515
- testfn: $t_expr,
516
- }
517
- ) ;
518
- e
519
- }
520
- #[ cfg( not( stage0) ) ]
521
405
fn mk_test_desc_and_fn_rec ( cx : & TestCtxt , test : & Test ) -> @ast:: Expr {
522
406
let span = test. span ;
523
407
let path = test. path . clone ( ) ;
0 commit comments