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 compile-test from forcing a rebuild. #4115

Merged
merged 1 commit into from
May 19, 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
6 changes: 2 additions & 4 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn config(mode: &str, dir: PathBuf) -> compiletest::Config {
// as we'll get a duplicate matching versions. Instead, disambiguate with
// `--extern dep=path`.
// See https://github.com/rust-lang/rust-clippy/issues/4015.
let needs_disambiguation = ["serde"];
let needs_disambiguation = ["serde", "regex", "clippy_lints"];
// This assumes that deps are compiled (they are for Cargo integration tests).
let deps = std::fs::read_dir(host_libs().join("deps")).unwrap();
let disambiguated = deps
Expand All @@ -62,7 +62,7 @@ fn config(mode: &str, dir: PathBuf) -> compiletest::Config {
// NOTE: This only handles a single dep
// https://github.com/laumann/compiletest-rs/issues/101
needs_disambiguation.iter().find_map(|dep| {
if name.starts_with(&format!("lib{}-", dep)) {
if name.starts_with(&format!("lib{}-", dep)) && name.ends_with(".rlib") {
Some(format!("--extern {}={}", dep, path.display()))
} else {
None
Expand Down Expand Up @@ -95,8 +95,6 @@ fn config(mode: &str, dir: PathBuf) -> compiletest::Config {

fn run_mode(mode: &str, dir: PathBuf) {
let cfg = config(mode, dir);
// clean rmeta data, otherwise "cargo check; cargo test" fails (#2896)
cfg.clean_rmeta();
compiletest::run_tests(&cfg);
}

Expand Down