Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hil-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ harness = false
name = "spi_full_duplex_dma_async"
harness = false

[[test]]
name = "spi_full_duplex_dma_pcnt"
harness = false

[[test]]
name = "spi_half_duplex_read"
harness = false
Expand Down
24 changes: 9 additions & 15 deletions hil-test/tests/spi_full_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ struct Context {
spi: Spi<'static, esp_hal::peripherals::SPI2, FullDuplexMode>,
}

impl Context {
pub fn init() -> Self {
#[cfg(test)]
#[embedded_test::tests]
mod tests {
use defmt::assert_eq;

use super::*;

#[init]
fn init() -> Context {
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
Expand All @@ -49,19 +56,6 @@ impl Context {

Context { spi }
}
}

#[cfg(test)]
#[embedded_test::tests]
mod tests {
use defmt::assert_eq;

use super::*;

#[init]
fn init() -> Context {
Context::init()
}

#[test]
#[timeout(3)]
Expand Down
Loading