Initialize logger in gpui tests

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-04-02 12:42:01 -06:00
parent 2d79193fb6
commit fd1f75333f
4 changed files with 13 additions and 0 deletions

1
Cargo.lock generated
View File

@ -797,6 +797,7 @@ dependencies = [
"png",
"rand 0.8.3",
"replace_with",
"simplelog",
"smallvec",
"smol",
"tree-sitter",

View File

@ -8,6 +8,7 @@ version = "0.1.0"
async-task = "4.0.3"
ctor = "0.1"
etagere = "0.2"
log = "0.4"
num_cpus = "1.13"
ordered-float = "2.1.1"
parking_lot = "0.11.1"
@ -25,6 +26,7 @@ cc = "1.0.67"
[dev-dependencies]
png = "0.16"
simplelog = "0.9"
[target.'cfg(target_os = "macos")'.dependencies]
anyhow = "1"

View File

@ -1,6 +1,8 @@
mod app;
pub use app::*;
mod assets;
#[cfg(test)]
mod test;
pub use assets::*;
pub mod elements;
pub mod font_cache;

8
gpui/src/test.rs Normal file
View File

@ -0,0 +1,8 @@
use ctor::ctor;
use simplelog::SimpleLogger;
use log::LevelFilter;
#[ctor]
fn init_logger() {
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
}