[package]
name    = "hil-test"
version = "0.0.0"
edition = "2021"
publish = false

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[[test]]
name              = "uart_async"
harness           = false
required-features = ["async", "embassy"]

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


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

[[test]]
name              = "embassy_timers_executors"
harness           = false
required-features = ["async", "embassy"]

[[test]]
name              = "embassy_interrupt_executor"
harness           = false
required-features = ["async", "embassy", "integrated-timers"]

[dependencies]
cfg-if             = "1.0.0"
critical-section   = "1.1.2"
defmt              = "0.3.8"
defmt-rtt          = "0.4.1"
embassy-futures    = "0.1.1"
embassy-sync       = "0.6.0"
embassy-time       = { version = "0.3.1", features = ["generic-queue-64"] }
embedded-hal       = "1.0.0"
embedded-hal-02    = { version = "0.2.7", package = "embedded-hal", features = ["unproven"] }
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-hal-nb    = { version = "1.0.0", optional = true }
esp-backtrace      = { path = "../esp-backtrace", default-features = false, features = ["exception-handler", "panic-handler", "defmt", "semihosting"] }
esp-hal            = { path = "../esp-hal", features = ["defmt", "embedded-hal", "embedded-hal-02"], optional = true }
esp-hal-embassy    = { path = "../esp-hal-embassy", optional = true }
portable-atomic    = "1.6.0"
static_cell        = { version = "2.1.0", features = ["nightly"] }

[dev-dependencies]
crypto-bigint       = { version = "0.5.5", default-features = false }
elliptic-curve      = { version = "0.13.8", default-features = false, features = ["sec1"] }
embassy-executor    = { version = "0.5.0", default-features = false }
# Add the `embedded-test/defmt` feature for more verbose testing
embedded-test       = { version = "0.4.0", default-features = false }
hex-literal         = "0.4.1"
nb                  = "1.1.0"
p192                = { version = "0.13.0", default-features = false, features = ["arithmetic"] }
p256                = { version = "0.13.2", default-features = false, features = ["arithmetic"] }

[features]
default = ["async", "embassy"]

# Device support (required!):
esp32 = [
    "embedded-test/xtensa-semihosting",
    "esp-backtrace/esp32",
    "esp-hal/esp32",
    "esp-hal-embassy/esp32",
]
esp32c2 = ["esp-backtrace/esp32c2", "esp-hal/esp32c2", "esp-hal-embassy/esp32c2"]
esp32c3 = ["esp-backtrace/esp32c3", "esp-hal/esp32c3", "esp-hal-embassy/esp32c3"]
esp32c6 = ["esp-backtrace/esp32c6", "esp-hal/esp32c6", "esp-hal-embassy/esp32c6"]
esp32h2 = ["esp-backtrace/esp32h2", "esp-hal/esp32h2", "esp-hal-embassy/esp32h2"]
esp32s2 = [
    "embedded-test/xtensa-semihosting",
    "esp-backtrace/esp32s2",
    "esp-hal/esp32s2",
    "esp-hal-embassy/esp32s2",
]
esp32s3 = [
    "embedded-test/xtensa-semihosting",
    "esp-backtrace/esp32s3",
    "esp-hal/esp32s3",
    "esp-hal-embassy/esp32s3",
]
# Async & Embassy:
async = ["dep:embedded-hal-async", "esp-hal?/async"]
embassy = [
    "embedded-test/embassy",
    "embedded-test/external-executor",
    "dep:esp-hal-embassy",
]
integrated-timers = [
    "embassy-executor/integrated-timers",
]

# https://doc.rust-lang.org/cargo/reference/profiles.html#test
# Test and bench profiles inherit from dev and release respectively.
[profile.dev]
codegen-units    = 1
debug            = 2
debug-assertions = true
incremental      = false
opt-level        = "z"
overflow-checks  = true

[profile.release]
codegen-units    = 1
debug            = 2
debug-assertions = false
incremental      = false
opt-level        = 3
lto              = "fat"
overflow-checks  = false
