From 700a86b9c181fdacdbbc8a0fee8178b78335a8fc Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Mon, 18 Mar 2024 16:59:09 +0100 Subject: [PATCH] feat: Add a way to cfg away test for unsuported peripherals --- hil-test/Cargo.toml | 1 + hil-test/tests/aes.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/hil-test/Cargo.toml b/hil-test/Cargo.toml index 82760b94007..6eaa430087f 100644 --- a/hil-test/Cargo.toml +++ b/hil-test/Cargo.toml @@ -29,6 +29,7 @@ embedded-hal = { version = "0.2.7", features = ["unproven"] } embedded-hal-async = { version = "1.0.0", optional = true } embedded-hal-1 = { version = "1.0.0", package = "embedded-hal" } embassy-executor = { default-features = false, version = "0.5.0", features = ["executor-thread", "arch-riscv32"], optional = true } +semihosting = "0.1.6" [dev-dependencies] embedded-test = {git = "https://github.com/probe-rs/embedded-test/", branch = "next"} diff --git a/hil-test/tests/aes.rs b/hil-test/tests/aes.rs index 4aecf5e1601..ee653d6daaa 100644 --- a/hil-test/tests/aes.rs +++ b/hil-test/tests/aes.rs @@ -23,7 +23,20 @@ impl Context<'_> { } } +#[cfg(not(any(esp32c3, esp32c6, esp32h2)))] +mod not_test { + #[esp_hal::entry] + fn main() -> ! { + semihosting::process::exit(0) + } + #[panic_handler] + fn panic(_info: &core::panic::PanicInfo) -> ! { + loop {} + } +} + #[cfg(test)] +#[cfg(any(esp32c3, esp32c6, esp32h2))] #[embedded_test::tests] mod tests { #[cfg(feature = "defmt")]