@@ -650,12 +650,11 @@ fn install_default_features() {
650
650
p. cargo ( "uninstall foo" ) . run ( ) ;
651
651
652
652
p. cargo ( "install --path . --no-default-features" )
653
- . with_status ( 101 )
654
653
. with_stderr (
655
654
"\
656
655
[INSTALLING] foo v0.0.1 ([..])
657
656
[FINISHED] release [optimized] target(s) in [..]
658
- [ERROR] no binaries are available for install using the selected features
657
+ [WARNING] none of the package's binaries are available for install using the selected features
659
658
" ,
660
659
)
661
660
. run ( ) ;
@@ -755,34 +754,96 @@ fn install_multiple_required_features() {
755
754
name = "foo_2"
756
755
path = "src/foo_2.rs"
757
756
required-features = ["a"]
757
+
758
+ [[example]]
759
+ name = "foo_3"
760
+ path = "src/foo_3.rs"
761
+ required-features = ["b", "c"]
762
+
763
+ [[example]]
764
+ name = "foo_4"
765
+ path = "src/foo_4.rs"
766
+ required-features = ["a"]
758
767
"# ,
759
768
)
760
769
. file ( "src/foo_1.rs" , "fn main() {}" )
761
770
. file ( "src/foo_2.rs" , "fn main() {}" )
771
+ . file ( "src/foo_3.rs" , "fn main() {}" )
772
+ . file ( "src/foo_4.rs" , "fn main() {}" )
762
773
. build ( ) ;
763
774
764
775
p. cargo ( "install --path ." ) . run ( ) ;
765
776
assert_has_not_installed_exe ( cargo_home ( ) , "foo_1" ) ;
766
777
assert_has_installed_exe ( cargo_home ( ) , "foo_2" ) ;
778
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_3" ) ;
779
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_4" ) ;
780
+ p. cargo ( "uninstall foo" ) . run ( ) ;
781
+
782
+ p. cargo ( "install --path . --bins --examples" ) . run ( ) ;
783
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_1" ) ;
784
+ assert_has_installed_exe ( cargo_home ( ) , "foo_2" ) ;
785
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_3" ) ;
786
+ assert_has_installed_exe ( cargo_home ( ) , "foo_4" ) ;
767
787
p. cargo ( "uninstall foo" ) . run ( ) ;
768
788
769
789
p. cargo ( "install --path . --features c" ) . run ( ) ;
770
790
assert_has_installed_exe ( cargo_home ( ) , "foo_1" ) ;
771
791
assert_has_installed_exe ( cargo_home ( ) , "foo_2" ) ;
792
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_3" ) ;
793
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_4" ) ;
794
+ p. cargo ( "uninstall foo" ) . run ( ) ;
795
+
796
+ p. cargo ( "install --path . --features c --bins --examples" )
797
+ . run ( ) ;
798
+ assert_has_installed_exe ( cargo_home ( ) , "foo_1" ) ;
799
+ assert_has_installed_exe ( cargo_home ( ) , "foo_2" ) ;
800
+ assert_has_installed_exe ( cargo_home ( ) , "foo_3" ) ;
801
+ assert_has_installed_exe ( cargo_home ( ) , "foo_4" ) ;
772
802
p. cargo ( "uninstall foo" ) . run ( ) ;
773
803
774
804
p. cargo ( "install --path . --no-default-features" )
775
- . with_status ( 101 )
776
805
. with_stderr (
777
806
"\
778
807
[INSTALLING] foo v0.0.1 ([..])
779
808
[FINISHED] release [optimized] target(s) in [..]
780
- [ERROR] no binaries are available for install using the selected features
809
+ [WARNING] none of the package's binaries are available for install using the selected features
810
+ " ,
811
+ )
812
+ . run ( ) ;
813
+ p. cargo ( "install --path . --no-default-features --bins" )
814
+ . with_stderr (
815
+ "\
816
+ [INSTALLING] foo v0.0.1 ([..])
817
+ [WARNING] Target filter `bins` specified, but no targets matched. This is a no-op
818
+ [FINISHED] release [optimized] target(s) in [..]
819
+ [WARNING] none of the package's binaries are available for install using the selected features
820
+ " ,
821
+ )
822
+ . run ( ) ;
823
+ p. cargo ( "install --path . --no-default-features --examples" )
824
+ . with_stderr (
825
+ "\
826
+ [INSTALLING] foo v0.0.1 ([..])
827
+ [WARNING] Target filter `examples` specified, but no targets matched. This is a no-op
828
+ [FINISHED] release [optimized] target(s) in [..]
829
+ [WARNING] none of the package's binaries are available for install using the selected features
830
+ " ,
831
+ )
832
+ . run ( ) ;
833
+ p. cargo ( "install --path . --no-default-features --bins --examples" )
834
+ . with_stderr (
835
+ "\
836
+ [INSTALLING] foo v0.0.1 ([..])
837
+ [WARNING] Target filters `bins`, `examples` specified, but no targets matched. This is a no-op
838
+ [FINISHED] release [optimized] target(s) in [..]
839
+ [WARNING] none of the package's binaries are available for install using the selected features
781
840
" ,
782
841
)
783
842
. run ( ) ;
784
843
assert_has_not_installed_exe ( cargo_home ( ) , "foo_1" ) ;
785
844
assert_has_not_installed_exe ( cargo_home ( ) , "foo_2" ) ;
845
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_3" ) ;
846
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo_4" ) ;
786
847
}
787
848
788
849
#[ cargo_test]
@@ -1029,12 +1090,11 @@ Consider enabling them by passing, e.g., `--features=\"bar/a\"`
1029
1090
1030
1091
// install
1031
1092
p. cargo ( "install --path ." )
1032
- . with_status ( 101 )
1033
1093
. with_stderr (
1034
1094
"\
1035
1095
[INSTALLING] foo v0.0.1 ([..])
1036
1096
[FINISHED] release [optimized] target(s) in [..]
1037
- [ERROR] no binaries are available for install using the selected features
1097
+ [WARNING] none of the package's binaries are available for install using the selected features
1038
1098
" ,
1039
1099
)
1040
1100
. run ( ) ;
0 commit comments