Skip to content

Commit

Permalink
#414 fix testgen tester: wrong dir was removed
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-kuprianov committed Sep 23, 2020
1 parent b479d59 commit 85b8814
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions testgen/src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ impl Tester {

pub fn output_env(&self) -> Option<TestEnv> {
let output_dir = self.root_dir.clone() + "/_" + &self.name;
fs::create_dir_all(&output_dir)
.ok()
.and(TestEnv::new(&output_dir))
TestEnv::new(&output_dir)
}

fn capture_test<F>(test: F) -> TestResult
Expand Down Expand Up @@ -270,8 +268,8 @@ impl Tester {
let env = TestEnv::new(dir.path().to_str().unwrap()).unwrap();
let output_dir = output_env.full_path(path);
let output_env = TestEnv::new(output_dir.to_str().unwrap()).unwrap();
fs::remove_dir_all(&output_dir).unwrap();
test(test_case, &env, &test_env, &output_env);
fs::remove_dir_all(&env.current_dir()).unwrap();
}),
Err(_) => ParseError,
};
Expand Down

0 comments on commit 85b8814

Please sign in to comment.