diff options
Diffstat (limited to 'tests/integration_test.rs')
-rw-r--r-- | tests/integration_test.rs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 3b8dec9..7b5d408 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{Ok, Result}; use common::{run_rathole_client, PING, PONG}; use rand::Rng; use std::time::Duration; @@ -57,17 +57,17 @@ async fn tcp() -> Result<()> { test("tests/for_tcp/tcp_transport.toml", Type::Tcp).await?; // FIXME: Self-signed certificate on Mac requires mannual interference. Disable CI for now #[cfg(not(target_os = "macos"))] - #[cfg(feature="tls")] + #[cfg(any(feature = "native-tls", feature = "rustls"))] test("tests/for_tcp/tls_transport.toml", Type::Tcp).await?; - #[cfg(feature="noise")] + #[cfg(feature = "noise")] test("tests/for_tcp/noise_transport.toml", Type::Tcp).await?; - #[cfg(feature="websocket")] + #[cfg(any(feature = "websocket-native-tls", feature = "websocket-rustls"))] test("tests/for_tcp/websocket_transport.toml", Type::Tcp).await?; #[cfg(not(target_os = "macos"))] - #[cfg(feature="websocket")] + #[cfg(any(feature = "websocket-native-tls", feature = "websocket-rustls"))] test("tests/for_tcp/websocket_tls_transport.toml", Type::Tcp).await?; Ok(()) @@ -94,17 +94,17 @@ async fn udp() -> Result<()> { test("tests/for_udp/tcp_transport.toml", Type::Udp).await?; // See above #[cfg(not(target_os = "macos"))] - #[cfg(feature="tls")] + #[cfg(any(feature = "native-tls", feature = "rustls"))] test("tests/for_udp/tls_transport.toml", Type::Udp).await?; - #[cfg(feature="noise")] + #[cfg(feature = "noise")] test("tests/for_udp/noise_transport.toml", Type::Udp).await?; - #[cfg(feature="websocket")] + #[cfg(any(feature = "websocket-native-tls", feature = "websocket-rustls"))] test("tests/for_udp/websocket_transport.toml", Type::Udp).await?; #[cfg(not(target_os = "macos"))] - #[cfg(feature="websocket")] + #[cfg(any(feature = "websocket-native-tls", feature = "websocket-rustls"))] test("tests/for_udp/websocket_tls_transport.toml", Type::Udp).await?; Ok(()) @@ -112,6 +112,11 @@ async fn udp() -> Result<()> { #[instrument] async fn test(config_path: &'static str, t: Type) -> Result<()> { + if cfg!(not(all(feature = "client", feature = "server"))) { + // Skip the test if the client or the server is not enabled + return Ok(()); + } + let (client_shutdown_tx, client_shutdown_rx) = broadcast::channel(1); let (server_shutdown_tx, server_shutdown_rx) = broadcast::channel(1); |