11//! Tests for multiple `--target` flags to subcommands
22
3- #![ allow( deprecated) ]
4-
5- use cargo_test_support:: { basic_manifest, cross_compile, project, rustc_host} ;
3+ use cargo_test_support:: prelude:: * ;
4+ use cargo_test_support:: { basic_manifest, cross_compile, project, rustc_host, str} ;
65
76#[ cargo_test]
87fn simple_build ( ) {
@@ -71,8 +70,15 @@ fn simple_test() {
7170 . arg ( & t1)
7271 . arg ( "--target" )
7372 . arg ( & t2)
74- . with_stderr_contains ( & format ! ( "[RUNNING] [..]{}[..]" , t1) )
75- . with_stderr_contains ( & format ! ( "[RUNNING] [..]{}[..]" , t2) )
73+ . with_stderr_data (
74+ str![ [ r#"
75+ [RUNNING] unittests src/lib.rs (target/[ALT_TARGET]/debug/deps/foo-[HASH])
76+ [RUNNING] unittests src/lib.rs (target/[HOST_TARGET]/debug/deps/foo-[HASH])
77+ ...
78+
79+ "# ] ]
80+ . unordered ( ) ,
81+ )
7682 . run ( ) ;
7783}
7884
@@ -84,7 +90,10 @@ fn simple_run() {
8490 . build ( ) ;
8591
8692 p. cargo ( "run --target a --target b" )
87- . with_stderr ( "[ERROR] only one `--target` argument is supported" )
93+ . with_stderr_data ( str![ [ r#"
94+ [ERROR] only one `--target` argument is supported
95+
96+ "# ] ] )
8897 . with_status ( 101 )
8998 . run ( ) ;
9099}
@@ -130,12 +139,12 @@ fn simple_doc_open() {
130139 . arg ( & t1)
131140 . arg ( "--target" )
132141 . arg ( & t2)
133- . with_stderr (
134- " \
135- [DOCUMENTING] foo v1.0.0 ([..])
136- [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
137- [ERROR] only one `--target` argument is supported" ,
138- )
142+ . with_stderr_data ( str! [ [ r#"
143+ [DOCUMENTING] foo v1.0.0 ([ROOT]/foo)
144+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
145+ [ERROR] only one `-- target` argument is supported
146+
147+ "# ] ] )
139148 . with_status ( 101 )
140149 . run ( ) ;
141150}
0 commit comments