filament/xiao-esp32c6/tests/hello_test.rs
2025-06-28 16:59:55 -05:00

26 lines
635 B
Rust

//! Demo test suite using embedded-test
//!
//! You can run this using `cargo test` as usual.
#![no_std]
#![no_main]
#[cfg(test)]
#[embedded_test::tests(executor = esp_hal_embassy::Executor::new())]
mod tests {
use esp_hal::timer::systimer::SystemTimer;
#[init]
fn init() {
let peripherals = esp_hal::init(esp_hal::Config::default());
let timer0 = SystemTimer::new(peripherals.SYSTIMER);
esp_hal_embassy::init(timer0.alarm0);
}
#[test]
async fn hello_test() {
embassy_time::Timer::after(embassy_time::Duration::from_millis(100)).await;
assert_eq!(1 + 1, 2);
}
}