Skip to content

Commit

Permalink
chore: use feature for testing purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuschen committed Oct 16, 2024
1 parent cd27eee commit d278555
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iceoryx2-bb/container/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ version = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
iceoryx2-bb-derive-macros = { workspace = true }
iceoryx2-bb-elementary = { workspace = true }
iceoryx2-bb-derive-macros = { workspace = true}
iceoryx2-bb-elementary = { workspace = true , features = ["test-utils"]}
iceoryx2-bb-log = { workspace = true }
iceoryx2-pal-concurrency-sync = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions iceoryx2-bb/elementary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ iceoryx2-bb-testing = { workspace = true }

generic-tests = { workspace = true }

[features]
test-utils = []
2 changes: 2 additions & 0 deletions iceoryx2-bb/elementary/src/bump_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
//
// SPDX-License-Identifier: Apache-2.0 OR MIT


use crate::{allocator::BaseAllocator, math::align};
use iceoryx2_pal_concurrency_sync::iox_atomic::IoxAtomicUsize;
use std::sync::atomic::Ordering;


/// Simple BumpAllocator for testing purposes. Do not use this in production. If you are looking
/// for a production ready BumpAllocator use the one from iceoryx2_bb_memory::bump_allocator
#[doc(hidden)]
Expand Down
2 changes: 2 additions & 0 deletions iceoryx2-bb/elementary/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub mod enum_gen;
/// A strong type that represents the alignment part of [`std::alloc::Layout`]
pub mod alignment;
pub mod allocator;

#[cfg(any(test, feature = "test-utils"))]
pub mod bump_allocator;
pub mod lazy_singleton;
pub mod math;
Expand Down

0 comments on commit d278555

Please sign in to comment.