This commit is contained in:
Billy Chan 2021-09-02 18:35:10 +08:00
parent 7f38621c3c
commit 9d5ce08ff8
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7
3 changed files with 9 additions and 3 deletions

View File

@ -31,7 +31,7 @@ chrono = { version = "^0", optional = true }
futures = { version = "^0.3" }
futures-util = { version = "^0.3" }
rust_decimal = { version = "^1", optional = true }
sea-orm-macros = { version = "^0.1.1", optional = true }
sea-orm-macros = { version = "^0.1.1", path = "sea-orm-macros", optional = true }
sea-query = { version = "^0.16", features = ["thread-safe"] }
sea-strum = { version = "^0.21", features = ["derive", "sea-orm"] }
serde = { version = "^1.0", features = ["derive"] }
@ -40,6 +40,7 @@ sqlx-core = { version = "^0.5", optional = true }
sqlx-macros = { version = "^0.5", optional = true }
serde_json = { version = "^1", optional = true }
uuid = { version = "0.8", features = ["serde", "v4"], optional = true }
log = { version = "^0.4", optional = true }
[dev-dependencies]
smol = { version = "^1.2" }
@ -49,11 +50,12 @@ tokio = { version = "^1.6", features = ["full"] }
actix-rt = { version = "2.2.0" }
maplit = { version = "^1" }
rust_decimal_macros = { version = "^1" }
env_logger = { version = "^0.9" }
sea-orm = { path = ".", features = ["debug-print"] }
pretty_assertions = { version = "^0.7" }
[features]
debug-print = []
debug-print = ["log"]
default = [
"macros",
"mock",

View File

@ -99,6 +99,10 @@ pub fn test(_: TokenStream, input: TokenStream) -> TokenStream {
#[test]
#(#attrs)*
fn #name() #ret {
let _ = ::env_logger::builder()
.filter_level(::log::LevelFilter::Debug)
.is_test(true)
.try_init();
crate::block_on!(async { #body })
}
)

View File

@ -1,7 +1,7 @@
#[macro_export]
#[cfg(feature = "debug-print")]
macro_rules! debug_print {
($( $args:expr ),*) => { println!( $( $args ),* ); }
($( $args:expr ),*) => { log::debug!( $( $args ),* ); }
}
#[macro_export]