iceoryx2_bb_testing/lib.rs
1// Copyright (c) 2023 Contributors to the Eclipse Foundation
2//
3// See the NOTICE file(s) distributed with this work for additional
4// information regarding copyright ownership.
5//
6// This program and the accompanying materials are made available under the
7// terms of the Apache Software License 2.0 which is available at
8// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
9// which is available at https://opensource.org/licenses/MIT.
10//
11// SPDX-License-Identifier: Apache-2.0 OR MIT
12
13#[macro_use]
14pub mod assert;
15pub mod lifetime_tracker;
16pub mod memory;
17pub mod watchdog;
18
19#[macro_export(local_inner_macros)]
20macro_rules! test_requires {
21 { $condition:expr } => {
22 if !$condition { return; }
23 }
24}
25
26#[macro_export(local_inner_macros)]
27macro_rules! test_fail {
28 ($($e:expr),*) => {
29 core::panic!(
30 "test failed: {} {} {}",
31 assert_that![color_start],
32 std::format_args!($($e),*).to_string(),
33 assert_that![color_end]
34 )
35 };
36}
37
38pub const AT_LEAST_TIMING_VARIANCE: f32 =
39 iceoryx2_pal_configuration::settings::AT_LEAST_TIMING_VARIANCE;