summaryrefslogtreecommitdiffstats
path: root/tests/construction.rs
blob: 5f228018a8cf7d97b79e66b19d63219f648e5915 (plain)
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
extern crate embedded_hal_mock as hal;

#[macro_use]
#[allow(unused)]
mod common;
use common::{ new_ads1013, destroy_ads1013, new_ads1113, destroy_ads1113,
              new_ads1014, destroy_ads1014, new_ads1114, destroy_ads1114,
              new_ads1015, destroy_ads1015, new_ads1115, destroy_ads1115 };

macro_rules! impl_tests {
    ($IC:ident, $create:ident, $destroy:ident) => {
        mod $IC {
            use super::*;
            #[test]
            fn can_create() {
                let dev = $create(&[]);
                $destroy(dev);
            }
        }
    }
}

impl_tests!(ads1013, new_ads1013, destroy_ads1013);
impl_tests!(ads1113, new_ads1113, destroy_ads1113);
impl_tests!(ads1014, new_ads1014, destroy_ads1014);
impl_tests!(ads1114, new_ads1114, destroy_ads1114);
impl_tests!(ads1015, new_ads1015, destroy_ads1015);
impl_tests!(ads1115, new_ads1115, destroy_ads1115);