iceoryx2_pal_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#![warn(clippy::alloc_instead_of_core)]
14#![warn(clippy::std_instead_of_alloc)]
15#![warn(clippy::std_instead_of_core)]
16
17extern crate alloc;
18
19#[macro_use]
20pub mod assert;
21pub mod memory;
22pub mod watchdog;
23
24#[macro_export(local_inner_macros)]
25macro_rules! test_requires {
26    { $condition:expr } => {
27        if !$condition { return; }
28    }
29}
30
31#[macro_export(local_inner_macros)]
32macro_rules! test_fail {
33    ($($e:expr),*) => {
34        core::panic!(
35            "test failed: {} {} {}",
36            assert_that![color_start],
37            std::format_args!($($e),*).to_string(),
38            assert_that![color_end]
39        )
40    };
41}
42
43pub const AT_LEAST_TIMING_VARIANCE: f32 = iceoryx2_pal_configuration::AT_LEAST_TIMING_VARIANCE;