@@ -606,7 +606,7 @@ fn check_virtual_all_implied() {
606
606
}
607
607
608
608
#[ test]
609
- fn all_targets_with_and_without ( ) {
609
+ fn targets_selected_default ( ) {
610
610
let foo = project ( "foo" )
611
611
. file ( "Cargo.toml" , SIMPLE_MANIFEST )
612
612
. file ( "src/main.rs" , "fn main() {}" )
@@ -617,25 +617,37 @@ fn all_targets_with_and_without() {
617
617
. build ( ) ;
618
618
619
619
assert_that (
620
- foo. cargo ( "check" ) . arg ( "--all-targets" ) . arg ( "- v") ,
620
+ foo. cargo ( "check" ) . arg ( "-v" ) ,
621
621
execs ( )
622
622
. with_status ( 0 )
623
623
. with_stderr_contains ( "[..] --crate-name foo src[/]lib.rs [..]" )
624
624
. with_stderr_contains ( "[..] --crate-name foo src[/]main.rs [..]" )
625
- . with_stderr_contains ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
626
- . with_stderr_contains ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
627
- . with_stderr_contains ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
625
+ . with_stderr_does_not_contain ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
626
+ . with_stderr_does_not_contain ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
627
+ . with_stderr_does_not_contain ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
628
628
) ;
629
- assert_that ( foo. cargo ( "clean" ) , execs ( ) . with_status ( 0 ) ) ;
629
+ }
630
+
631
+ #[ test]
632
+ fn targets_selected_all ( ) {
633
+ let foo = project ( "foo" )
634
+ . file ( "Cargo.toml" , SIMPLE_MANIFEST )
635
+ . file ( "src/main.rs" , "fn main() {}" )
636
+ . file ( "src/lib.rs" , "pub fn smth() {}" )
637
+ . file ( "examples/example1.rs" , "fn main() {}" )
638
+ . file ( "tests/test2.rs" , "#[test] fn t() {}" )
639
+ . file ( "benches/bench3.rs" , "" )
640
+ . build ( ) ;
641
+
630
642
assert_that (
631
- foo. cargo ( "check" ) . arg ( "-v" ) ,
643
+ foo. cargo ( "check" ) . arg ( "--all-targets" ) . arg ( "- v") ,
632
644
execs ( )
633
645
. with_status ( 0 )
634
646
. with_stderr_contains ( "[..] --crate-name foo src[/]lib.rs [..]" )
635
647
. with_stderr_contains ( "[..] --crate-name foo src[/]main.rs [..]" )
636
- . with_stderr_does_not_contain ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
637
- . with_stderr_does_not_contain ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
638
- . with_stderr_does_not_contain ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
648
+ . with_stderr_contains ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
649
+ . with_stderr_contains ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
650
+ . with_stderr_contains ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
639
651
) ;
640
652
}
641
653
0 commit comments