1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
diff --git a/src/tests/test_helpers.rs b/src/tests/test_helpers.rs
index 73e4175..47841c3 100644
--- a/src/tests/test_helpers.rs
b/src/tests/test_helpers.rs
@@ -18,6 18,7 @@ use crate::{
pub struct UnpackedDir {
dir: PathBuf,
d: tempfile::TempDir,
}
impl Drop for UnpackedDir {
@@ -35,10 36,13 @@ impl UnpackedDir {
let tar_gz = File::open(packed_file)?;
let tar = GzDecoder::new(tar_gz);
let mut archive = Archive::new(tar);
- archive.unpack(base_path.clone())?;
let d = tempfile::tempdir()?;
archive.unpack(&d)?;
Ok(UnpackedDir {
- dir: base_path.join(name),
dir: d.path().join(name),
d
})
}
@@ -48,11 52,7 @@ impl UnpackedDir {
}
fn get_testres_path() -> PathBuf {
- let mut base_path: PathBuf = std::env::current_exe().unwrap();
- base_path.pop();
- base_path.pop();
- base_path.pop();
- base_path.pop();
let mut base_path: PathBuf = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
base_path.push("testres");
base_path
|