Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests by running cargo build a second time in tests #53

Merged
merged 1 commit into from
Jul 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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