summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-11-10 11:52:12 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-11-10 11:52:26 +0100
commit164880dbf9f43fd16890513bbb8be13b1ebd335f (patch)
tree6feb49bcaf68a9a56c04fb104fd2e9a1224b377e
parent9f5b28ea111249a6bb00e1b188e8b0d6a5aa0572 (diff)
downloadimag-164880dbf9f43fd16890513bbb8be13b1ebd335f.zip
imag-164880dbf9f43fd16890513bbb8be13b1ebd335f.tar.gz
Fix: Make everything cfg(test)
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--tests/ui/src/lib.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/ui/src/lib.rs b/tests/ui/src/lib.rs
index 56009df..3d9026c 100644
--- a/tests/ui/src/lib.rs
+++ b/tests/ui/src/lib.rs
@@ -17,13 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
-extern crate assert_cmd;
-extern crate assert_fs;
-extern crate env_logger;
-extern crate predicates;
-extern crate semver;
-#[macro_use] extern crate log;
-#[macro_use] extern crate pretty_assertions;
+#[cfg(test)] extern crate assert_cmd;
+#[cfg(test)] extern crate assert_fs;
+#[cfg(test)] extern crate env_logger;
+#[cfg(test)] extern crate predicates;
+#[cfg(test)] extern crate semver;
+#[cfg(test)] #[macro_use] extern crate log;
+#[cfg(test)] #[macro_use] extern crate pretty_assertions;
#[cfg(test)] mod imag;
#[cfg(test)] mod imag_annotate;
@@ -57,8 +57,10 @@ extern crate semver;
#[cfg(test)] mod imag_todo;
#[cfg(test)] mod imag_wiki;
+#[cfg(test)]
static LOG_SYNC: std::sync::Once = std::sync::Once::new();
+#[cfg(test)]
pub fn setup_logging() {
LOG_SYNC.call_once(|| { let _ = env_logger::try_init(); });
}