From: Michael Fairley Date: Wed, 29 Nov 2017 15:40:02 +0000 (-0400) Subject: Update dylib check test to explicitly express that it doesn't cause rebuilds X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~4^2~38^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3ff4cf425e9421de034b4aa22b438641a7a0ca9d;p=cargo.git Update dylib check test to explicitly express that it doesn't cause rebuilds --- diff --git a/tests/check.rs b/tests/check.rs index 68e1615ec..6f3a8a1fc 100644 --- a/tests/check.rs +++ b/tests/check.rs @@ -301,7 +301,7 @@ fn issue_3419() { // Check on a dylib should have a different metadata hash than build. #[test] -fn check_dylib() { +fn dylib_check_preserves_build_cache() { let p = project("foo") .file("Cargo.toml", r#" [package] @@ -317,25 +317,21 @@ fn check_dylib() { .file("src/lib.rs", "") .build(); - let build_output = t!(String::from_utf8( - t!(p.cargo("build").arg("-v").exec_with_output()) - .stderr, - )); - let build_metadata = build_output - .split_whitespace() - .find(|arg| arg.starts_with("metadata=")) - .unwrap(); - - let check_output = t!(String::from_utf8( - t!(p.cargo("check").arg("-v").exec_with_output()) - .stderr, - )); - let check_metadata = check_output - .split_whitespace() - .find(|arg| arg.starts_with("metadata=")) - .unwrap(); - - assert_ne!(build_metadata, check_metadata); + assert_that(p.cargo("build"), + execs().with_status(0) + .with_stderr("\ +[..]Compiling foo v0.1.0 ([..]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +")); + + assert_that(p.cargo("check"), + execs().with_status(0)); + + assert_that(p.cargo("build"), + execs().with_status(0) + .with_stderr("\ +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +")); } // test `cargo rustc --profile check`