diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-11 20:05:12 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-11 21:27:31 +1100 |
| commit | ec662b9c09ce9f472613a066dd42ae7bd7242e00 (patch) | |
| tree | 524d768d6cbf4212917b4334251596a316fedc43 | |
| parent | 188f7ce91b2a69988846a6af5adb7807434940b6 (diff) | |
| download | rust-ec662b9c09ce9f472613a066dd42ae7bd7242e00.tar.gz rust-ec662b9c09ce9f472613a066dd42ae7bd7242e00.zip | |
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.
| -rw-r--r-- | src/tools/compiletest/src/header/auxiliary.rs | 16 | ||||
| -rw-r--r-- | src/tools/compiletest/src/lib.rs | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/header/auxiliary.rs b/src/tools/compiletest/src/header/auxiliary.rs index 2a94622264a..6f6538ce196 100644 --- a/src/tools/compiletest/src/header/auxiliary.rs +++ b/src/tools/compiletest/src/header/auxiliary.rs @@ -1,6 +1,8 @@ //! Code for dealing with test directives that request an "auxiliary" crate to //! be built and made available to the test in some way. +use std::iter; + use crate::common::Config; use crate::header::directives::{AUX_BIN, AUX_BUILD, AUX_CODEGEN_BACKEND, AUX_CRATE}; @@ -20,6 +22,20 @@ pub(crate) struct AuxProps { pub(crate) codegen_backend: Option<String>, } +impl AuxProps { + /// Yields all of the paths (relative to `./auxiliary/`) that have been + /// specified in `aux-*` directives for this test. + pub(crate) fn all_aux_path_strings(&self) -> impl Iterator<Item = &str> { + let Self { builds, bins, crates, codegen_backend } = self; + + iter::empty() + .chain(builds.iter().map(String::as_str)) + .chain(bins.iter().map(String::as_str)) + .chain(crates.iter().map(|(_, path)| path.as_str())) + .chain(codegen_backend.iter().map(String::as_str)) + } +} + /// If the given test directive line contains an `aux-*` directive, parse it /// and update [`AuxProps`] accordingly. pub(super) fn parse_and_update_aux(config: &Config, ln: &str, aux: &mut AuxProps) { diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 30215c0bbe6..30d1644b148 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -862,7 +862,7 @@ fn files_related_to_test( related.push(testpaths.file.clone()); } - for aux in &props.aux.builds { + for aux in props.aux.all_aux_path_strings() { // FIXME(Zalathar): Perform all `auxiliary` path resolution in one place. let path = testpaths.file.parent().unwrap().join("auxiliary").join(aux); related.push(path); |
