summaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 61338846462a5b61ad1b7da11d9106f22ed269d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![feature(test)]

extern crate jemallocator;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

mod constants;
mod handshake;
mod router;
mod timers;
mod types;
mod 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() {}