blob: 17dfed6d810d4a2910f49fd11333009a912a635a (
plain)
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
|
#![allow(dead_code)]
use std::path::PathBuf;
use std::sync::{Once, ONCE_INIT};
static LOGGER_INIT: Once = ONCE_INIT;
// Rust runs the tests concurrently, so unless we synchronize logging access
// it will crash when attempting to run `cargo test` with some logging facilities.
pub fn ensure_env_logger_initialized() {
LOGGER_INIT.call_once(env_logger::init);
}
pub fn samples_dir() -> PathBuf {
PathBuf::from(file!())
.parent()
.unwrap()
.parent()
.unwrap()
.join("samples")
.canonicalize()
.unwrap()
}
pub fn mft_sample() -> PathBuf {
samples_dir().join("MFT")
}
|