Skip to content

Commit

Permalink
feat: Add a way to cfg away test for unsuported peripherals
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Mar 18, 2024
1 parent f8cab4f commit 700a86b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions hil-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
13 changes: 13 additions & 0 deletions hil-test/tests/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 700a86b

Please sign in to comment.