Skip to content

Commit 8b1d18a

Browse files
committed
Auto merge of #14241 - eth3lbert:snapbox-build-std, r=epage
test: migrate build-std/main to snapbox ### What does this PR try to resolve? Part of #14039. Migrate following to snapbox: - `tests/build-std/main.rs`
2 parents 0e2ef80 + 04cccfa commit 8b1d18a

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

tests/build-std/main.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
//! Otherwise the tests are skipped.
2020
2121
#![allow(clippy::disallowed_methods)]
22-
#![allow(deprecated)]
2322

23+
use cargo_test_support::prelude::*;
2424
use cargo_test_support::*;
2525
use std::env;
2626
use std::path::Path;
@@ -113,10 +113,11 @@ fn basic() {
113113
.target_host()
114114
// Importantly, this should not say [UPDATING]
115115
// There have been multiple bugs where every build triggers and update.
116-
.with_stderr(
117-
"[COMPILING] foo v0.0.1 [..]\n\
118-
[FINISHED] `dev` profile [..]",
119-
)
116+
.with_stderr_data(str![[r#"
117+
[COMPILING] foo v0.0.1 ([ROOT]/foo)
118+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
119+
120+
"#]])
120121
.run();
121122
p.cargo("run").build_std().target_host().run();
122123
p.cargo("test").build_std().target_host().run();
@@ -261,15 +262,18 @@ fn remap_path_scope() {
261262
.build_std()
262263
.target_host()
263264
.with_status(101)
264-
.with_stderr_contains(
265-
"\
266-
[FINISHED] `release` profile [optimized + debuginfo] [..]
267-
[RUNNING] [..]
268-
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]",
265+
.with_stderr_data(
266+
str![[r#"
267+
[FINISHED] `release` profile [optimized + debuginfo] target(s) in [ELAPSED]s
268+
[RUNNING] `target/[HOST_TARGET]/release/foo`
269+
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]:
270+
remap to /rustc/<hash>
271+
at /rustc/[..]/library/std/src/[..]
272+
at ./src/main.rs:3:[..]
273+
at /rustc/[..]/library/core/src/[..]
274+
...
275+
"#]]
276+
.unordered(),
269277
)
270-
.with_stderr_contains("remap to /rustc/<hash>")
271-
.with_stderr_contains("[..]at /rustc/[..]/library/std/src/[..]")
272-
.with_stderr_contains("[..]at src/main.rs:3[..]")
273-
.with_stderr_contains("[..]at /rustc/[..]/library/core/src/[..]")
274278
.run();
275279
}

0 commit comments

Comments
 (0)