From f14813b63e53a33732615947ca81a0c5b518d395 Mon Sep 17 00:00:00 2001 From: Denis Molokanov Date: Thu, 30 Apr 2020 10:21:34 -0700 Subject: [PATCH] make some dependencies optional with benches feature --- mqtt/mqtt-broker/Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mqtt/mqtt-broker/Cargo.toml b/mqtt/mqtt-broker/Cargo.toml index dabb6d2514f..47f21553082 100644 --- a/mqtt/mqtt-broker/Cargo.toml +++ b/mqtt/mqtt-broker/Cargo.toml @@ -9,6 +9,7 @@ bincode = "1.2" bytes = "0.5" chrono = "0.4" config = { version = "0.10", default-features = false, features = ["json"] } +criterion = { version = "0.3", optional = true } crossbeam-channel = "0.4" fail = "0.3" flate2 = "1.0" @@ -18,6 +19,7 @@ humantime = "2.0" humantime-serde = "1.0" lazy_static = "1.4" native-tls = "0.2" +rand = { version = "0.7", optional = true } regex = "1" serde = { version = "1.0", features = ["derive", "rc"] } thiserror = "1.0" @@ -34,12 +36,10 @@ mqtt3 = { path = "../mqtt3", features = ["serde1"] } [dev-dependencies] atty = "0.2" bytes = "0.5" -criterion = "0.3" fail = { version = "0.3", features = ["failpoints"] } itertools = "0.9" matches = "0.1" proptest = "0.9" -rand = "0.7" serde_json = "1.0" tempfile = "3" test-case = "1.0" @@ -53,6 +53,7 @@ required-features = ["fail/failpoints"] [[bench]] name = "persist_broker_state" harness = false +required-features = ["tokio/rt-threaded"] [[bench]] name = "dispatch_messages" @@ -62,6 +63,7 @@ required-features = ["__internal_broker_callbacks", "tokio/rt-threaded"] [features] default = [] +benches = ["rand", "criterion", "__internal_broker_callbacks", "tokio/rt-threaded"] # Internal (PRIVATE!) features used to aid testing. # Don't rely on these whatsoever. They may disappear at anytime.