Skip to content

Commit

Permalink
Auto merge of #14082 - henry40408:issue-14039-timings, r=weihanglo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jun 16, 2024
2 parents 5d357f0 + b592aa9 commit 8c52c9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 0 additions & 2 deletions tests/testsuite/member_discovery.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Tests for workspace member discovery.
#![allow(deprecated)]

use cargo::core::{Shell, Workspace};
use cargo::util::context::GlobalContext;

Expand Down
20 changes: 9 additions & 11 deletions tests/testsuite/timings.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! Tests for --timings.
#![allow(deprecated)]

use cargo_test_support::project;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

#[cargo_test]
fn timings_works() {
Expand All @@ -29,18 +28,17 @@ fn timings_works() {
.build();

p.cargo("build --all-targets --timings")
.with_stderr_unordered(
"\
[UPDATING] [..]
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] dep v0.1.0 [..]
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[COMPILING] dep v0.1.0
[COMPILING] foo v0.1.0 [..]
[FINISHED] [..]
Timing report saved to [..]/foo/target/cargo-timings/cargo-timing-[..].html
",
)
[COMPILING] foo v0.1.0 ([ROOT]/foo)
Timing report saved to [ROOT]/foo/target/cargo-timings/cargo-timing-[..].html
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();

p.cargo("clean").run();
Expand Down

0 comments on commit 8c52c9c

Please sign in to comment.