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