1
- use std:: fs:: File ;
1
+ use std:: fs:: { self , File } ;
2
2
use std:: io:: prelude:: * ;
3
3
4
4
use cargo;
@@ -3665,6 +3665,7 @@ fn test_dep_with_dev() {
3665
3665
#[ cargo_test]
3666
3666
fn cargo_test_doctest_xcompile_ignores ( ) {
3667
3667
if !is_nightly ( ) {
3668
+ // -Zdoctest-xcompile is unstable
3668
3669
return ;
3669
3670
}
3670
3671
let p = project ( )
@@ -3686,45 +3687,41 @@ fn cargo_test_doctest_xcompile_ignores() {
3686
3687
#[ cfg( not( target_arch = "x86_64" ) ) ]
3687
3688
p. cargo ( "test" )
3688
3689
. with_stdout_contains (
3689
- "\
3690
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
3691
- ",
3690
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" ,
3692
3691
)
3693
3692
. run ( ) ;
3694
3693
#[ cfg( target_arch = "x86_64" ) ]
3695
3694
p. cargo ( "test" )
3696
3695
. with_status ( 101 )
3697
3696
. with_stdout_contains (
3698
- "\
3699
- test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out\
3700
- ",
3697
+ "test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out" ,
3701
3698
)
3702
3699
. run ( ) ;
3703
3700
3704
3701
#[ cfg( not( target_arch = "x86_64" ) ) ]
3705
3702
p. cargo ( "test -Zdoctest-xcompile" )
3706
3703
. masquerade_as_nightly_cargo ( )
3707
3704
. with_stdout_contains (
3708
- "\
3709
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
3710
- ",
3705
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" ,
3711
3706
)
3712
3707
. run ( ) ;
3713
3708
3714
3709
#[ cfg( target_arch = "x86_64" ) ]
3715
3710
p. cargo ( "test -Zdoctest-xcompile" )
3716
3711
. masquerade_as_nightly_cargo ( )
3717
3712
. with_stdout_contains (
3718
- "\
3719
- test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out\
3720
- ",
3713
+ "test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out" ,
3721
3714
)
3722
3715
. run ( ) ;
3723
3716
}
3724
3717
3725
3718
#[ cargo_test]
3726
3719
fn cargo_test_doctest_xcompile ( ) {
3720
+ if cross_compile:: disabled ( ) {
3721
+ return ;
3722
+ }
3727
3723
if !is_nightly ( ) {
3724
+ // -Zdoctest-xcompile is unstable
3728
3725
return ;
3729
3726
}
3730
3727
let p = project ( )
@@ -3745,29 +3742,26 @@ fn cargo_test_doctest_xcompile() {
3745
3742
3746
3743
p. cargo ( "build" ) . run ( ) ;
3747
3744
p. cargo ( & format ! ( "test --target {}" , cross_compile:: alternate( ) ) )
3748
- . with_stdout_contains (
3749
- "\
3750
- running 0 tests\
3751
- ",
3752
- )
3745
+ . with_stdout_contains ( "running 0 tests" )
3753
3746
. run ( ) ;
3754
3747
p. cargo ( & format ! (
3755
3748
"test --target {} -Zdoctest-xcompile" ,
3756
3749
cross_compile:: alternate( )
3757
3750
) )
3758
3751
. masquerade_as_nightly_cargo ( )
3759
3752
. with_stdout_contains (
3760
- "\
3761
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
3762
- ",
3753
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" ,
3763
3754
)
3764
3755
. run ( ) ;
3765
3756
}
3766
3757
3767
3758
#[ cargo_test]
3768
3759
fn cargo_test_doctest_xcompile_runner ( ) {
3769
- use std:: fs;
3760
+ if cross_compile:: disabled ( ) {
3761
+ return ;
3762
+ }
3770
3763
if !is_nightly ( ) {
3764
+ // -Zdoctest-xcompile is unstable
3771
3765
return ;
3772
3766
}
3773
3767
@@ -3824,33 +3818,27 @@ runner = "{}"
3824
3818
3825
3819
p. cargo ( "build" ) . run ( ) ;
3826
3820
p. cargo ( & format ! ( "test --target {}" , cross_compile:: alternate( ) ) )
3827
- . with_stdout_contains (
3828
- "\
3829
- running 0 tests\
3830
- ",
3831
- )
3821
+ . with_stdout_contains ( "running 0 tests" )
3832
3822
. run ( ) ;
3833
3823
p. cargo ( & format ! (
3834
3824
"test --target {} -Zdoctest-xcompile" ,
3835
3825
cross_compile:: alternate( )
3836
3826
) )
3837
3827
. masquerade_as_nightly_cargo ( )
3838
3828
. with_stdout_contains (
3839
- "\
3840
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
3841
- ",
3842
- )
3843
- . with_stderr_contains (
3844
- "\
3845
- this is a runner\
3846
- ",
3829
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" ,
3847
3830
)
3831
+ . with_stderr_contains ( "this is a runner" )
3848
3832
. run ( ) ;
3849
3833
}
3850
3834
3851
3835
#[ cargo_test]
3852
3836
fn cargo_test_doctest_xcompile_no_runner ( ) {
3837
+ if cross_compile:: disabled ( ) {
3838
+ return ;
3839
+ }
3853
3840
if !is_nightly ( ) {
3841
+ // -Zdoctest-xcompile is unstable
3854
3842
return ;
3855
3843
}
3856
3844
@@ -3872,21 +3860,15 @@ fn cargo_test_doctest_xcompile_no_runner() {
3872
3860
3873
3861
p. cargo ( "build" ) . run ( ) ;
3874
3862
p. cargo ( & format ! ( "test --target {}" , cross_compile:: alternate( ) ) )
3875
- . with_stdout_contains (
3876
- "\
3877
- running 0 tests\
3878
- ",
3879
- )
3863
+ . with_stdout_contains ( "running 0 tests" )
3880
3864
. run ( ) ;
3881
3865
p. cargo ( & format ! (
3882
3866
"test --target {} -Zdoctest-xcompile" ,
3883
3867
cross_compile:: alternate( )
3884
3868
) )
3885
3869
. masquerade_as_nightly_cargo ( )
3886
3870
. with_stdout_contains (
3887
- "\
3888
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
3889
- ",
3871
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" ,
3890
3872
)
3891
3873
. run ( ) ;
3892
3874
}
0 commit comments