File tree 2 files changed +17
-1
lines changed
src/tools/compiletest/src
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Code for dealing with test directives that request an "auxiliary" crate to
2
2
//! be built and made available to the test in some way.
3
3
4
+ use std:: iter;
5
+
4
6
use crate :: common:: Config ;
5
7
use crate :: header:: directives:: { AUX_BIN , AUX_BUILD , AUX_CODEGEN_BACKEND , AUX_CRATE } ;
6
8
@@ -20,6 +22,20 @@ pub(crate) struct AuxProps {
20
22
pub ( crate ) codegen_backend : Option < String > ,
21
23
}
22
24
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
+
23
39
/// If the given test directive line contains an `aux-*` directive, parse it
24
40
/// and update [`AuxProps`] accordingly.
25
41
pub ( super ) fn parse_and_update_aux ( config : & Config , ln : & str , aux : & mut AuxProps ) {
Original file line number Diff line number Diff line change @@ -862,7 +862,7 @@ fn files_related_to_test(
862
862
related. push ( testpaths. file . clone ( ) ) ;
863
863
}
864
864
865
- for aux in & props. aux . builds {
865
+ for aux in props. aux . all_aux_path_strings ( ) {
866
866
// FIXME(Zalathar): Perform all `auxiliary` path resolution in one place.
867
867
let path = testpaths. file . parent ( ) . unwrap ( ) . join ( "auxiliary" ) . join ( aux) ;
868
868
related. push ( path) ;
You can’t perform that action at this time.
0 commit comments