Fix cargo test without cargo features enabled

This commit is contained in:
Roman Proskuryakov 2021-03-28 10:22:19 +03:00
parent a3f4d8f41e
commit 92cc062a4c
2 changed files with 3 additions and 0 deletions

View File

@ -15,12 +15,14 @@ use as_slice::{AsMutSlice, AsSlice};
use super::{Init, Node, Uninit};
/// Instantiates a pool as a global singleton
// NOTE(any(test)) makes testing easier (no need to enable Cargo features for testing)
#[cfg(any(
armv7a,
armv7r,
armv7m,
armv8m_main,
all(target_arch = "x86_64", feature = "x86-sync-pool"),
test
))]
#[macro_export]
macro_rules! pool {

View File

@ -235,6 +235,7 @@ fn iterator_properly_wraps() {
assert_eq!(expected, actual)
}
#[cfg(all(target_arch = "x86_64", feature = "x86-sync-pool"))]
#[test]
fn pool() {
use heapless::pool::singleton::Pool as _;