Skip to content

Commit

Permalink
Merge pull request #53 from LukasKalbertodt/fix-tests
Browse files Browse the repository at this point in the history
Fix tests by running `cargo build` a second time in tests
  • Loading branch information
LukasKalbertodt authored Jul 12, 2019
2 parents 705252e + 3ea4ce1 commit 52b3794
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ pub(crate) fn get_dep_path() -> PathBuf {

assert!(outputs.len() == 1);

// Run `cargo build` again to regenerate artifacts that might have been
// removed by the previous execution. See
// https://github.com/rust-lang/cargo/issues/6954
let mut command = Command::new(env!("CARGO"));
command.args(&["build"]);
command.stderr(Stdio::inherit());

#[cfg(feature = "nightly")]
command.arg("--features=nightly");

let status = command.status().expect("failed to run `cargo build`");
if !status.success() {
panic!("error running 'cargo build'");
}

outputs.remove(0).into()
}

Expand Down

0 comments on commit 52b3794

Please sign in to comment.