Skip to content

Commit ec662b9

Browse files
committed
Include all kinds of auxiliary crates in the up-to-date timestamp
This was previously only including ordinary `aux-build` crates, and not files associated with the other three kinds of auxiliary crate.
1 parent 188f7ce commit ec662b9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/tools/compiletest/src/header/auxiliary.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Code for dealing with test directives that request an "auxiliary" crate to
22
//! be built and made available to the test in some way.
33
4+
use std::iter;
5+
46
use crate::common::Config;
57
use crate::header::directives::{AUX_BIN, AUX_BUILD, AUX_CODEGEN_BACKEND, AUX_CRATE};
68

@@ -20,6 +22,20 @@ pub(crate) struct AuxProps {
2022
pub(crate) codegen_backend: Option<String>,
2123
}
2224

25+
impl AuxProps {
26+
/// Yields all of the paths (relative to `./auxiliary/`) that have been
27+
/// specified in `aux-*` directives for this test.
28+
pub(crate) fn all_aux_path_strings(&self) -> impl Iterator<Item = &str> {
29+
let Self { builds, bins, crates, codegen_backend } = self;
30+
31+
iter::empty()
32+
.chain(builds.iter().map(String::as_str))
33+
.chain(bins.iter().map(String::as_str))
34+
.chain(crates.iter().map(|(_, path)| path.as_str()))
35+
.chain(codegen_backend.iter().map(String::as_str))
36+
}
37+
}
38+
2339
/// If the given test directive line contains an `aux-*` directive, parse it
2440
/// and update [`AuxProps`] accordingly.
2541
pub(super) fn parse_and_update_aux(config: &Config, ln: &str, aux: &mut AuxProps) {

src/tools/compiletest/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ fn files_related_to_test(
862862
related.push(testpaths.file.clone());
863863
}
864864

865-
for aux in &props.aux.builds {
865+
for aux in props.aux.all_aux_path_strings() {
866866
// FIXME(Zalathar): Perform all `auxiliary` path resolution in one place.
867867
let path = testpaths.file.parent().unwrap().join("auxiliary").join(aux);
868868
related.push(path);

0 commit comments

Comments
 (0)