Skip to content

Commit d68b832

Browse files
committed
Auto merge of #387 - pietroalbini:revert-cleanup, r=pietroalbini
Revert target directory cleanup Actually broke a lot of stuff.
2 parents b83e3c7 + 9bdc4e8 commit d68b832

File tree

4 files changed

+0
-131
lines changed

4 files changed

+0
-131
lines changed

src/runner/cleanup.rs

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/runner/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
mod cleanup;
21
mod graph;
32
mod prepare;
43
mod tasks;

src/runner/test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use super::cleanup;
21
use crate::docker::{DockerError, MountPerms};
32
use crate::prelude::*;
43
use crate::results::{FailureReason, TestResult, WriteResults};
@@ -93,7 +92,6 @@ pub(super) fn run_test<DB: WriteResults>(
9392
test_fn(ctx, &source_path)
9493
},
9594
)?;
96-
cleanup::clean_target_dirs(&ctx.toolchain.target_dir(&ctx.experiment.name))?;
9795
}
9896
Ok(())
9997
}

src/utils/fs.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -61,40 +61,3 @@ pub(crate) fn copy_dir(src_dir: &Path, dest_dir: &Path) -> Fallible<()> {
6161

6262
Ok(())
6363
}
64-
65-
#[cfg(test)]
66-
#[derive(Default)]
67-
pub(crate) struct TempDirBuilder {
68-
dirs: Vec<PathBuf>,
69-
files: Vec<(PathBuf, String)>,
70-
}
71-
72-
#[cfg(test)]
73-
impl TempDirBuilder {
74-
pub(crate) fn dir<P: Into<PathBuf>>(mut self, path: P) -> TempDirBuilder {
75-
self.dirs.push(path.into());
76-
self
77-
}
78-
79-
pub(crate) fn file<P: Into<PathBuf>>(mut self, path: P, content: &str) -> TempDirBuilder {
80-
self.files.push((path.into(), content.into()));
81-
self
82-
}
83-
84-
pub(crate) fn build(self) -> Fallible<tempfile::TempDir> {
85-
let temp = tempfile::TempDir::new()?;
86-
for path in &self.dirs {
87-
std::fs::create_dir_all(temp.path().join(path))?;
88-
}
89-
for (path, content) in &self.files {
90-
let path = temp.path().join(path);
91-
if let Some(parent) = path.parent() {
92-
if !parent.exists() {
93-
std::fs::create_dir_all(parent)?;
94-
}
95-
}
96-
std::fs::write(&path, content.as_bytes())?;
97-
}
98-
Ok(temp)
99-
}
100-
}

0 commit comments

Comments
 (0)