Skip to content

Commit d3b893b

Browse files
committed
Pass TestConfig to build_aux_files
1 parent 92123eb commit d3b893b

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/lib.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,7 @@ fn build_aux(
490490

491491
let mut aux_cmd = config.build_command()?;
492492

493-
let mut extra_args = build_aux_files(
494-
aux_file.parent().unwrap(),
495-
&comments,
496-
"",
497-
&config.config,
498-
build_manager,
499-
)?;
493+
let mut extra_args = build_aux_files(aux_file.parent().unwrap(), &config, build_manager)?;
500494
// Make sure we see our dependencies
501495
aux_cmd.args(extra_args.iter());
502496

@@ -540,9 +534,7 @@ fn build_aux(
540534
fn run_test(build_manager: &BuildManager<'_>, mut config: TestConfig<'_>) -> TestResult {
541535
let extra_args = build_aux_files(
542536
&config.path.parent().unwrap().join("auxiliary"),
543-
config.comments,
544-
config.revision,
545-
&config.config,
537+
&config,
546538
build_manager,
547539
)?;
548540

@@ -590,13 +582,11 @@ fn run_command(mut cmd: Command) -> Result<(Command, Output), Errored> {
590582

591583
fn build_aux_files(
592584
aux_dir: &Path,
593-
comments: &Comments,
594-
revision: &str,
595-
config: &Config,
585+
config: &TestConfig,
596586
build_manager: &BuildManager<'_>,
597587
) -> Result<Vec<OsString>, Errored> {
598588
let mut extra_args = vec![];
599-
for rev in comments.for_revision(revision) {
589+
for rev in config.all() {
600590
for aux in &rev.aux_builds {
601591
let line = aux.line();
602592
let aux = &**aux;
@@ -623,7 +613,7 @@ fn build_aux_files(
623613
)
624614
.collect(),
625615
},
626-
config,
616+
&config.config,
627617
)
628618
.map_err(
629619
|Errored {

src/per_test_config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ impl TestConfig<'_> {
5454
self.comments.find_one_for_revision(self.revision, kind, f)
5555
}
5656

57+
pub fn all(&self) -> impl Iterator<Item = &'_ Revisioned> {
58+
self.comments.for_revision(self.revision)
59+
}
60+
5761
pub fn collect<'a, T, I: Iterator<Item = T>, R: FromIterator<T>>(
5862
&'a self,
5963
f: impl Fn(&'a Revisioned) -> I,

0 commit comments

Comments
 (0)