Enable verbose for test

This commit is contained in:
2022-06-25 01:45:15 +00:00
committed by GitHub
parent 5bba7d2c2e
commit 12c01ccb95
4 changed files with 16 additions and 2 deletions

1
Cargo.lock generated
View File

@@ -1258,6 +1258,7 @@ dependencies = [
"atty",
"bindgen",
"c_fixed_string",
"cfg-if 1.0.0",
"chrono",
"cmake",
"dateparser",

View File

@@ -8,6 +8,7 @@ edition = "2018"
[dependencies]
atty = "0.2"
c_fixed_string = { version = "0.2", optional = true }
cfg-if = "1"
chrono = "0.4"
dateparser = "0.1.6"
derive_more = "0.99"

View File

@@ -1,4 +1,6 @@
#[macro_use]
extern crate cfg_if;
#[macro_use]
extern crate lazy_static;
#[cfg(all(feature = "link-cplusplus", target_env = "gnu"))]
extern crate link_cplusplus;

View File

@@ -568,7 +568,17 @@ pub fn parse_cmd() -> Option<CommandOpts> {
}
impl Default for CommandOpts {
fn default() -> Self {
Self::new(Command::None)
cfg_if! {
if #[cfg(test)] {
fn default() -> Self {
let mut re = Self::new(Command::None);
re.verbose = true;
re
}
} else {
fn default() -> Self {
Self::new(Command::None)
}
}
}
}