Skip to content

Commit 52f9927

Browse files
committed
Add the TARGET_LIBS environment variable for rustc CI testing
1 parent 7531a08 commit 52f9927

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/compile-test.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ fn host_libs() -> PathBuf {
2727
}
2828
}
2929

30+
#[must_use]
31+
fn target_libs() -> Option<PathBuf> {
32+
option_env!("TARGET_LIBS").map(PathBuf::from)
33+
}
34+
3035
#[must_use]
3136
fn rustc_test_suite() -> Option<PathBuf> {
3237
option_env!("RUSTC_TEST_SUITE").map(PathBuf::from)
@@ -57,8 +62,14 @@ fn config(mode: &str, dir: PathBuf) -> compiletest::Config {
5762
// See https://github.com/rust-lang/rust-clippy/issues/4015.
5863
let needs_disambiguation = ["serde", "regex", "clippy_lints"];
5964
// This assumes that deps are compiled (they are for Cargo integration tests).
60-
let deps = std::fs::read_dir(host_libs().join("deps")).unwrap();
65+
let deps = fs::read_dir(host_libs().join("deps")).unwrap();
66+
let deps: Vec<_> = if let Some(target_libs) = target_libs() {
67+
deps.chain(fs::read_dir(target_libs.join("deps")).unwrap()).collect()
68+
} else {
69+
deps.collect()
70+
};
6171
let disambiguated = deps
72+
.into_iter()
6273
.filter_map(|dep| {
6374
let path = dep.ok()?.path();
6475
let name = path.file_name()?.to_string_lossy();

0 commit comments

Comments
 (0)