diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-13 19:09:11 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-13 19:09:11 +0100 |
commit | 5cc344b1676bdc075a7a6869b3470c8de5425b23 (patch) | |
tree | aff99a9d3bf21791af8ea88f46e124fbdb6c9830 /tests | |
parent | 1700db61238a7e68e51d4e0db4d1154c1a5607a9 (diff) | |
download | ads1x1x-async-5cc344b1676bdc075a7a6869b3470c8de5425b23.tar.gz ads1x1x-async-5cc344b1676bdc075a7a6869b3470c8de5425b23.tar.xz ads1x1x-async-5cc344b1676bdc075a7a6869b3470c8de5425b23.zip |
Move construction tests into specific module
Diffstat (limited to 'tests')
-rw-r--r-- | tests/construction.rs | 30 | ||||
-rw-r--r-- | tests/tier1_i2c.rs | 5 |
2 files changed, 30 insertions, 5 deletions
diff --git a/tests/construction.rs b/tests/construction.rs new file mode 100644 index 0000000..23520af --- /dev/null +++ b/tests/construction.rs @@ -0,0 +1,30 @@ +extern crate embedded_hal; +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); diff --git a/tests/tier1_i2c.rs b/tests/tier1_i2c.rs index 845c919..15e5514 100644 --- a/tests/tier1_i2c.rs +++ b/tests/tier1_i2c.rs @@ -16,11 +16,6 @@ macro_rules! impl_tests { mod $IC { use embedded_hal::adc::OneShot; use super::*; - #[test] - fn can_create() { - let dev = $create(&[]); - $destroy(dev); - } mod would_block { use super::*; |