aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/router/tests
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2020-05-22 18:01:15 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2020-05-22 18:01:15 +0200
commit16ede0f37da6050d3037cd85eb1055f239cef7b8 (patch)
treeec6172fdd1c2c3d97bedcbcc93bce5cd34049b9b /src/wireguard/router/tests
parentElimited Daemonize dependency (diff)
downloadwireguard-rs-16ede0f37da6050d3037cd85eb1055f239cef7b8.tar.xz
wireguard-rs-16ede0f37da6050d3037cd85eb1055f239cef7b8.zip
Enable wireguard-rs to build on stable.
WireGuard Rust targets the latest nightly compiler, primarily for security and speed reasons. The recommended way to build WireGuard Rust is still with latest nightly.
Diffstat (limited to '')
-rw-r--r--src/wireguard/router/tests/bench.rs11
-rw-r--r--src/wireguard/router/tests/tests.rs1
2 files changed, 11 insertions, 1 deletions
diff --git a/src/wireguard/router/tests/bench.rs b/src/wireguard/router/tests/bench.rs
index f025dc9..948a156 100644
--- a/src/wireguard/router/tests/bench.rs
+++ b/src/wireguard/router/tests/bench.rs
@@ -1,13 +1,21 @@
+#[cfg(feature = "unstable")]
extern crate test;
use super::*;
-use std::net::IpAddr;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Arc;
+// only used in benchmark
+#[cfg(feature = "unstable")]
+use std::net::IpAddr;
+
+// only used in benchmark
+#[cfg(feature = "unstable")]
use num_cpus;
+
+#[cfg(feature = "unstable")]
use test::Bencher;
//
@@ -78,6 +86,7 @@ fn profiler_start(name: &str) {
}
}
+#[cfg(feature = "unstable")]
#[bench]
fn bench_router_outbound(b: &mut Bencher) {
// 10 GB transmission per iteration
diff --git a/src/wireguard/router/tests/tests.rs b/src/wireguard/router/tests/tests.rs
index 6819644..f6205d5 100644
--- a/src/wireguard/router/tests/tests.rs
+++ b/src/wireguard/router/tests/tests.rs
@@ -11,6 +11,7 @@ use rand::Rng;
use super::*;
+#[cfg(feature = "unstable")]
extern crate test;
const SIZE_MSG: usize = 1024;