1
1
//! Tests for Cargo's behavior under Rustup.
2
2
3
- #![ allow( deprecated) ]
4
-
5
3
use cargo_test_support:: paths:: { home, root, CargoPathExt } ;
6
- use cargo_test_support:: { cargo_process, process, project} ;
4
+ use cargo_test_support:: { cargo_process, process, project, str } ;
7
5
use std:: env;
8
6
use std:: env:: consts:: EXE_EXTENSION ;
9
7
use std:: ffi:: OsString ;
@@ -164,13 +162,12 @@ fn typical_rustup() {
164
162
. env ( "RUSTUP_TOOLCHAIN" , "test-toolchain" )
165
163
. env ( "RUSTUP_HOME" , & rustup_home)
166
164
. env ( "PATH" , & path)
167
- . with_stderr (
168
- "\
169
- [CHECKING] foo v0.0.1 [..]
165
+ . with_stderr_data ( str![ [ r#"
166
+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
170
167
real rustc running
171
- [FINISHED] [..]
172
- " ,
173
- )
168
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
169
+
170
+ "# ] ] )
174
171
. run ( ) ;
175
172
176
173
// Do a similar test, but with a toolchain link that does not have cargo
@@ -182,13 +179,12 @@ real rustc running
182
179
. env ( "RUSTUP_TOOLCHAIN" , "test-toolchain" )
183
180
. env ( "RUSTUP_HOME" , & rustup_home)
184
181
. env ( "PATH" , & path)
185
- . with_stderr (
186
- "\
187
- [CHECKING] foo v0.0.1 [..]
182
+ . with_stderr_data ( str![ [ r#"
183
+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
188
184
real rustc running
189
- [FINISHED] [..]
190
- " ,
191
- )
185
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
186
+
187
+ "# ] ] )
192
188
. run ( ) ;
193
189
}
194
190
@@ -252,13 +248,12 @@ fn custom_calls_other_cargo() {
252
248
// rustup proxies.
253
249
. env ( "RUSTUP_TOOLCHAIN" , "test-toolchain" )
254
250
. env ( "RUSTUP_HOME" , & rustup_home)
255
- . with_stderr (
256
- "\
251
+ . with_stderr_data ( str![ [ r#"
257
252
custom command running
258
- [CHECKING] foo [..]
253
+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
259
254
custom toolchain rustc running
260
- [FINISHED] [..]
261
- " ,
262
- )
255
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
256
+
257
+ "# ] ] )
263
258
. run ( ) ;
264
259
}
0 commit comments