1
1
//! Tests for multiple `--target` flags to subcommands
2
2
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} ;
6
5
7
6
#[ cargo_test]
8
7
fn simple_build ( ) {
@@ -71,8 +70,15 @@ fn simple_test() {
71
70
. arg ( & t1)
72
71
. arg ( "--target" )
73
72
. 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][EXE])
76
+ [RUNNING] unittests src/lib.rs (target/[HOST_TARGET]/debug/deps/foo-[HASH][EXE])
77
+ ...
78
+
79
+ "# ] ]
80
+ . unordered ( ) ,
81
+ )
76
82
. run ( ) ;
77
83
}
78
84
@@ -84,7 +90,10 @@ fn simple_run() {
84
90
. build ( ) ;
85
91
86
92
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
+ "# ] ] )
88
97
. with_status ( 101 )
89
98
. run ( ) ;
90
99
}
@@ -130,12 +139,12 @@ fn simple_doc_open() {
130
139
. arg ( & t1)
131
140
. arg ( "--target" )
132
141
. 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
+ "# ] ] )
139
148
. with_status ( 101 )
140
149
. run ( ) ;
141
150
}
0 commit comments