Add env-logger for test logging
This commit is contained in:
parent
36b77f4e38
commit
4e2bcf7d58
3 changed files with 11 additions and 0 deletions
|
@ -10,6 +10,7 @@ toml = "0.2.*"
|
|||
semver = "0.2"
|
||||
url = "1.1"
|
||||
rust-crypto = "0.2.35"
|
||||
env_logger = "0.3"
|
||||
|
||||
[dependencies.libimagstore]
|
||||
path = "../libimagstore"
|
||||
|
|
|
@ -257,12 +257,18 @@ mod test {
|
|||
|
||||
use super::InternalLinker;
|
||||
|
||||
fn setup_logging() {
|
||||
use env_logger;
|
||||
let _ = env_logger::init().unwrap_or(());
|
||||
}
|
||||
|
||||
pub fn get_store() -> Store {
|
||||
Store::new(PathBuf::from("/"), None).unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_new_entry_no_links() {
|
||||
setup_logging();
|
||||
let store = get_store();
|
||||
let entry = store.create(PathBuf::from("test_new_entry_no_links")).unwrap();
|
||||
let links = entry.get_internal_links();
|
||||
|
@ -273,6 +279,7 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_link_two_entries() {
|
||||
setup_logging();
|
||||
let store = get_store();
|
||||
let mut e1 = store.create(PathBuf::from("test_link_two_entries1")).unwrap();
|
||||
assert!(e1.get_internal_links().is_ok());
|
||||
|
|
|
@ -38,6 +38,9 @@ extern crate semver;
|
|||
extern crate url;
|
||||
extern crate crypto;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate env_logger;
|
||||
|
||||
#[macro_use] extern crate libimagstore;
|
||||
#[macro_use] extern crate libimagerror;
|
||||
#[macro_use] extern crate libimagutil;
|
||||
|
|
Loading…
Reference in a new issue