Skip to content

Commit 8c52c9c

Browse files
committed
Auto merge of #14082 - henry40408:issue-14039-timings, r=weihanglo
test: migrate timings_works to snapbox ### What does this PR try to resolve? Part of #14039. Migrate `tests/testsuite/timings.rs` to snapbox. ### How should we test and review this PR? N/A ### Additional information N/A
2 parents 5d357f0 + b592aa9 commit 8c52c9c

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

tests/testsuite/member_discovery.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Tests for workspace member discovery.
22
3-
#![allow(deprecated)]
4-
53
use cargo::core::{Shell, Workspace};
64
use cargo::util::context::GlobalContext;
75

tests/testsuite/timings.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! Tests for --timings.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::project;
64
use cargo_test_support::registry::Package;
5+
use cargo_test_support::str;
76

87
#[cargo_test]
98
fn timings_works() {
@@ -29,18 +28,17 @@ fn timings_works() {
2928
.build();
3029

3130
p.cargo("build --all-targets --timings")
32-
.with_stderr_unordered(
33-
"\
34-
[UPDATING] [..]
31+
.with_stderr_data(str![[r#"
32+
[UPDATING] `dummy-registry` index
3533
[LOCKING] 2 packages to latest compatible versions
3634
[DOWNLOADING] crates ...
37-
[DOWNLOADED] dep v0.1.0 [..]
35+
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
3836
[COMPILING] dep v0.1.0
39-
[COMPILING] foo v0.1.0 [..]
40-
[FINISHED] [..]
41-
Timing report saved to [..]/foo/target/cargo-timings/cargo-timing-[..].html
42-
",
43-
)
37+
[COMPILING] foo v0.1.0 ([ROOT]/foo)
38+
Timing report saved to [ROOT]/foo/target/cargo-timings/cargo-timing-[..].html
39+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
40+
41+
"#]])
4442
.run();
4543

4644
p.cargo("clean").run();

0 commit comments

Comments
 (0)