Skip to content

Commit a7715cb

Browse files
committed
test: rmeta is not reused
1 parent 762fbf9 commit a7715cb

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/testsuite/freshness.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,3 +3184,55 @@ fn use_mtime_cache_in_cargo_home() {
31843184
"#]])
31853185
.run();
31863186
}
3187+
3188+
#[cargo_test]
3189+
fn rmeta_reuse() {
3190+
// Currently support only one direction `build` -> `check`/`doc`
3191+
let p = project()
3192+
.file(
3193+
"Cargo.toml",
3194+
r#"
3195+
[package]
3196+
name = "foo"
3197+
edition = "2015"
3198+
"#,
3199+
)
3200+
.file("src/lib.rs", "")
3201+
.build();
3202+
3203+
p.cargo("build")
3204+
.with_stderr_data(str![[r#"
3205+
[COMPILING] foo v0.0.0 ([ROOT]/foo)
3206+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
3207+
3208+
"#]])
3209+
.run();
3210+
3211+
p.cargo("check --verbose")
3212+
.with_stderr_data(str![[r#"
3213+
[CHECKING] foo v0.0.0 ([ROOT]/foo)
3214+
[RUNNING] `rustc [..]`
3215+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
3216+
3217+
"#]])
3218+
.run();
3219+
3220+
p.cargo("clean").run();
3221+
3222+
p.cargo("check")
3223+
.with_stderr_data(str![[r#"
3224+
[CHECKING] foo v0.0.0 ([ROOT]/foo)
3225+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
3226+
3227+
"#]])
3228+
.run();
3229+
3230+
p.cargo("build --verbose")
3231+
.with_stderr_data(str![[r#"
3232+
[COMPILING] foo v0.0.0 ([ROOT]/foo)
3233+
[RUNNING] `rustc [..]`
3234+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
3235+
3236+
"#]])
3237+
.run();
3238+
}

0 commit comments

Comments
 (0)