We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab56479 commit 907bfe7Copy full SHA for 907bfe7
tests/support/paths.rs
@@ -3,6 +3,7 @@ use std::fs;
3
use std::io::prelude::*;
4
use std::io::{self, ErrorKind};
5
use std::path::{Path, PathBuf};
6
+use std::sync::{Once, ONCE_INIT};
7
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
8
9
static CARGO_INTEGRATION_TEST_DIR : &'static str = "cit";
@@ -101,6 +102,10 @@ impl CargoPathExt for Path {
101
102
/// Ensure required test directories exist and are empty
103
pub fn setup() {
104
debug!("path setup; root={}; home={}", root().display(), home().display());
105
+ static INIT: Once = ONCE_INIT;
106
+ INIT.call_once(|| {
107
+ root().parent().unwrap().mkdir_p().unwrap();
108
+ });
109
root().rm_rf().unwrap();
110
home().mkdir_p().unwrap();
111
}
0 commit comments