cli-test: Do not store `bins`

This commit is contained in:
Lorenz Leutgeb 2026-02-14 16:29:54 +01:00 committed by Fintan Halpenny
parent 8fbdd46ce4
commit e831aeb57b
1 changed files with 4 additions and 8 deletions

View File

@ -169,9 +169,6 @@ pub struct TestFormula {
tests: Vec<Test>, tests: Vec<Test>,
/// Output substitutions. /// Output substitutions.
subs: Substitutions, subs: Substitutions,
/// List of paths to directories to be searched for binaries.
/// This is used to construct the `PATH` environment variable for the tests.
bins: Vec<PathBuf>,
} }
impl TestFormula { impl TestFormula {
@ -182,7 +179,6 @@ impl TestFormula {
homes: HashMap::new(), homes: HashMap::new(),
tests: Vec::new(), tests: Vec::new(),
subs: Substitutions::new(), subs: Substitutions::new(),
bins: bins(cwd),
} }
} }
@ -401,7 +397,6 @@ impl TestFormula {
let mut runner = TestRunner::new(self); let mut runner = TestRunner::new(self);
fs::create_dir_all(&self.cwd)?; fs::create_dir_all(&self.cwd)?;
log::debug!(target: "test", "Using PATH {:?}", self.bins);
// For each code block. // For each code block.
for test in &self.tests { for test in &self.tests {
@ -462,12 +457,14 @@ impl TestFormula {
vec![] vec![]
}; };
let bins = self let bins = bins(self.cwd.clone())
.bins
.iter() .iter()
.map(|p| p.as_os_str()) .map(|p| p.as_os_str())
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(ffi::OsStr::new(&PATH_SEPARATOR.to_string())); .join(ffi::OsStr::new(&PATH_SEPARATOR.to_string()));
log::debug!(target: "test", "Using PATH={:?}", bins);
let result = Command::new(cmd.clone()) let result = Command::new(cmd.clone())
.env_clear() .env_clear()
.env("PATH", &bins) .env("PATH", &bins)
@ -593,7 +590,6 @@ $ rad sync
cwd: cwd.clone(), cwd: cwd.clone(),
env: HashMap::new(), env: HashMap::new(),
subs: Substitutions::new(), subs: Substitutions::new(),
bins: bins(cwd),
tests: vec![ tests: vec![
Test { Test {
context: vec![String::from("Let's try to track @dave and @sean:")], context: vec![String::from("Let's try to track @dave and @sean:")],