From 8b58c165a7914016333f2703489124bcbe53b9f1 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 8 Jul 2021 17:33:08 -0700 Subject: [PATCH] Re-export zed-rpc's test support items from zed's test support --- zed-rpc/Cargo.toml | 3 +++ zed-rpc/src/lib.rs | 4 ++-- zed/Cargo.toml | 2 +- zed/src/test.rs | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/zed-rpc/Cargo.toml b/zed-rpc/Cargo.toml index 95700ff3d89a612f185dd97397c22f7c6da7eb67..f74d4cfc2277b38e93029598070ef3898f5a14e9 100644 --- a/zed-rpc/Cargo.toml +++ b/zed-rpc/Cargo.toml @@ -4,6 +4,9 @@ edition = "2018" name = "zed-rpc" version = "0.1.0" +[features] +test-support = [] + [dependencies] anyhow = "1.0" async-lock = "2.4" diff --git a/zed-rpc/src/lib.rs b/zed-rpc/src/lib.rs index b5bd62e07eeae9dd36af4d36c3645f7e187faf01..8cafad9f1f57b9e38af28cbf08c95de66183cc84 100644 --- a/zed-rpc/src/lib.rs +++ b/zed-rpc/src/lib.rs @@ -1,7 +1,7 @@ pub mod auth; mod peer; pub mod proto; -#[cfg(test)] -mod test; +#[cfg(any(test, feature = "test-support"))] +pub mod test; pub use peer::*; diff --git a/zed/Cargo.toml b/zed/Cargo.toml index 3c069f1dcdf4971bb6c8278ac7d820f8217d36b7..70ecb15df48c372aba9a012b155945d276bf57ea 100644 --- a/zed/Cargo.toml +++ b/zed/Cargo.toml @@ -14,7 +14,7 @@ name = "Zed" path = "src/main.rs" [features] -test-support = ["tempdir", "serde_json"] +test-support = ["tempdir", "serde_json", "zed-rpc/test-support"] [dependencies] anyhow = "1.0.38" diff --git a/zed/src/test.rs b/zed/src/test.rs index 55504d678f9ebd6d190b690c56a1b31890ffad27..8350d4b0d46f8b60b79ee3d0addb2fdde14ce776 100644 --- a/zed/src/test.rs +++ b/zed/src/test.rs @@ -6,6 +6,9 @@ use std::{ }; use tempdir::TempDir; +#[cfg(feature = "test-support")] +pub use zed_rpc::test::Channel; + #[cfg(test)] #[ctor::ctor] fn init_logger() {