@@ -420,75 +420,3 @@ pub fn sess_os_to_meta_os(os: abi::Os) -> metadata::loader::Os {
420
420
abi:: OsFreebsd => loader:: OsFreebsd
421
421
}
422
422
}
423
-
424
- #[ cfg( test) ]
425
- mod test {
426
- use driver:: session:: { bin_crate, building_library, lib_crate} ;
427
- use driver:: session:: { unknown_crate} ;
428
-
429
- use syntax:: ast;
430
- use syntax:: attr;
431
- use syntax:: codemap;
432
-
433
- fn make_crate_type_attr ( t : @str ) -> ast:: Attribute {
434
- attr:: mk_attr ( attr:: mk_name_value_item_str ( @"crate_type", t) )
435
- }
436
-
437
- fn make_crate ( with_bin : bool , with_lib : bool ) -> @ast:: Crate {
438
- let mut attrs = ~[ ] ;
439
- if with_bin {
440
- attrs. push ( make_crate_type_attr ( @"bin") ) ;
441
- }
442
- if with_lib {
443
- attrs. push ( make_crate_type_attr ( @"lib") ) ;
444
- }
445
- @ast:: Crate {
446
- module : ast:: _mod { view_items : ~[ ] , items : ~[ ] } ,
447
- attrs : attrs,
448
- config : ~[ ] ,
449
- span : codemap:: dummy_sp ( ) ,
450
- }
451
- }
452
-
453
- #[ test]
454
- fn bin_crate_type_attr_results_in_bin_output ( ) {
455
- let crate = make_crate ( true , false ) ;
456
- assert ! ( !building_library( unknown_crate, crate , false ) ) ;
457
- }
458
-
459
- #[ test]
460
- fn lib_crate_type_attr_results_in_lib_output ( ) {
461
- let crate = make_crate ( false , true ) ;
462
- assert ! ( building_library( unknown_crate, crate , false ) ) ;
463
- }
464
-
465
- #[ test]
466
- fn bin_option_overrides_lib_crate_type ( ) {
467
- let crate = make_crate ( false , true ) ;
468
- assert ! ( !building_library( bin_crate, crate , false ) ) ;
469
- }
470
-
471
- #[ test]
472
- fn lib_option_overrides_bin_crate_type ( ) {
473
- let crate = make_crate ( true , false ) ;
474
- assert ! ( building_library( lib_crate, crate , false ) ) ;
475
- }
476
-
477
- #[ test]
478
- fn bin_crate_type_is_default ( ) {
479
- let crate = make_crate ( false , false ) ;
480
- assert ! ( !building_library( unknown_crate, crate , false ) ) ;
481
- }
482
-
483
- #[ test]
484
- fn test_option_overrides_lib_crate_type ( ) {
485
- let crate = make_crate ( false , true ) ;
486
- assert ! ( !building_library( unknown_crate, crate , true ) ) ;
487
- }
488
-
489
- #[ test]
490
- fn test_option_does_not_override_requested_lib_type ( ) {
491
- let crate = make_crate ( false , false ) ;
492
- assert ! ( building_library( lib_crate, crate , true ) ) ;
493
- }
494
- }
0 commit comments