From c82d3e554ba34305fa7ef759c830a74f4ba9559b Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Sun, 6 Oct 2019 13:33:15 +0200 Subject: Restructure dummy implementations --- src/main.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 26b39a2..6133884 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,24 @@ mod timers; mod types; mod wireguard; -#[test] -fn test_pure_wireguard() {} +#[cfg(test)] +mod tests { + use crate::types::{dummy, Bind}; + use crate::wireguard::Wireguard; + + use std::thread; + use std::time::Duration; + + fn init() { + let _ = env_logger::builder().is_test(true).try_init(); + } + + #[test] + fn test_pure_wireguard() { + init(); + let wg = Wireguard::new(dummy::TunTest::new(), dummy::VoidBind::new()); + thread::sleep(Duration::from_millis(500)); + } +} fn main() {} -- cgit v1.2.3-59-g8ed1b