10
10
//! cargo test --test testsuite -- old_cargos --nocapture --ignored
11
11
//! ```
12
12
13
- #![ allow( deprecated) ]
14
-
15
13
use std:: fs;
16
14
17
15
use cargo:: CargoResult ;
18
16
use cargo_test_support:: prelude:: * ;
19
17
use cargo_test_support:: registry:: { self , Dependency , Package } ;
20
- use cargo_test_support:: { cargo_exe, execs, paths, process, project, rustc_host} ;
18
+ use cargo_test_support:: { cargo_exe, execs, paths, process, project, rustc_host, str } ;
21
19
use cargo_util:: { ProcessBuilder , ProcessError } ;
22
20
use semver:: Version ;
23
21
@@ -640,32 +638,32 @@ fn index_cache_rebuild() {
640
638
. with_process_builder ( tc_process ( "cargo" , "1.48.0" ) )
641
639
. arg ( "check" )
642
640
. cwd ( p. root ( ) )
643
- . with_stderr (
644
- "\
645
- [UPDATING] [..]
641
+ . with_stderr_data ( str![ [ r#"
642
+ [UPDATING] `[ROOT]/registry` index
646
643
[DOWNLOADING] crates ...
647
- [DOWNLOADED] bar v1.0.0 [..]
644
+ [DOWNLOADED] bar v1.0.0 (registry `[ROOT]/registry`)
648
645
[CHECKING] bar v1.0.0
649
- [CHECKING] foo v0.1.0 [..]
650
- [FINISHED] [..]
651
- " ,
652
- )
646
+ [CHECKING] foo v0.1.0 ([ROOT]/foo)
647
+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [ELAPSED]s
648
+
649
+ "# ] ] )
653
650
. run ( ) ;
654
651
655
652
fs:: remove_file ( p. root ( ) . join ( "Cargo.lock" ) ) . unwrap ( ) ;
656
653
657
654
// This should rebuild the cache and use 1.0.1.
658
655
p. cargo ( "check" )
659
- . with_stderr (
660
- "\
661
- [UPDATING] [..]
656
+ . with_stderr_data ( str![ [ r#"
657
+ [WARNING] no edition set: defaulting to the 2015 edition while the latest is [..]
658
+ [UPDATING] `dummy-registry` index
659
+ [LOCKING] 2 packages to latest compatible versions
662
660
[DOWNLOADING] crates ...
663
- [DOWNLOADED] bar v1.0.1 [..]
661
+ [DOWNLOADED] bar v1.0.1 (registry `dummy-registry`)
664
662
[CHECKING] bar v1.0.1
665
- [CHECKING] foo v0.1.0 [..]
666
- [FINISHED] [..]
667
- " ,
668
- )
663
+ [CHECKING] foo v0.1.0 ([ROOT]/foo)
664
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
665
+
666
+ "# ] ] )
669
667
. run ( ) ;
670
668
671
669
fs:: remove_file ( p. root ( ) . join ( "Cargo.lock" ) ) . unwrap ( ) ;
@@ -675,12 +673,11 @@ fn index_cache_rebuild() {
675
673
. with_process_builder ( tc_process ( "cargo" , "1.48.0" ) )
676
674
. arg ( "tree" )
677
675
. cwd ( p. root ( ) )
678
- . with_stdout (
679
- "\
680
- foo v0.1.0 [..]
676
+ . with_stdout_data ( str![ [ r#"
677
+ foo v0.1.0 ([ROOT]/foo)
681
678
└── bar v1.0.0
682
- " ,
683
- )
679
+
680
+ "# ] ] )
684
681
. run ( ) ;
685
682
}
686
683
@@ -714,33 +711,31 @@ fn avoids_split_debuginfo_collision() {
714
711
. arg ( "build" )
715
712
. env ( "CARGO_INCREMENTAL" , "1" )
716
713
. cwd ( p. root ( ) )
717
- . with_stderr (
718
- "\
719
- [COMPILING] foo v0.1.0 [..]
720
- [FINISHED] [..]
721
- " ,
722
- )
714
+ . with_stderr_data ( str![ [ r#"
715
+ [COMPILING] foo v0.1.0 ([ROOT]/foo)
716
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
717
+
718
+ "# ] ] )
723
719
. run ( ) ;
724
720
725
721
p. cargo ( "build" )
726
722
. env ( "CARGO_INCREMENTAL" , "1" )
727
- . with_stderr (
728
- " \
729
- [COMPILING] foo v0.1.0 [..]
730
- [FINISHED] [..]
731
- " ,
732
- )
723
+ . with_stderr_data ( str! [ [ r#"
724
+ [WARNING] no edition set: defaulting to the 2015 edition while the latest is [..]
725
+ [COMPILING] foo v0.1.0 ([ROOT]/foo)
726
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
727
+
728
+ "# ] ] )
733
729
. run ( ) ;
734
730
735
731
execs ( )
736
732
. with_process_builder ( tc_process ( "cargo" , "stable" ) )
737
733
. arg ( "build" )
738
734
. env ( "CARGO_INCREMENTAL" , "1" )
739
735
. cwd ( p. root ( ) )
740
- . with_stderr (
741
- "\
742
- [FINISHED] [..]
743
- " ,
744
- )
736
+ . with_stderr_data ( str![ [ r#"
737
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
738
+
739
+ "# ] ] )
745
740
. run ( ) ;
746
741
}
0 commit comments