Skip to content

Commit 5ce030e

Browse files
committed
faet(led_strip): add pytest
1 parent f10e707 commit 5ce030e

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

.build-test-rules.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ led_strip/examples/led_strip_spi_ws2812:
1111
- if: CONFIG_SOC_GPSPI_SUPPORTED != 1
1212
reason: Relevant only for SPI enabled targets
1313

14+
led_strip/examples/led_strip_parlio_ws2812:
15+
disable:
16+
- if: CONFIG_SOC_PARLIO_SUPPORTED != 1
17+
reason: Relevant only for PARLIO enabled targets
18+
1419
esp_delta_ota:
1520
enable:
1621
- if: IDF_VERSION_MAJOR > 4
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Unlicense OR CC0-1.0
3+
4+
import pytest
5+
from pytest_embedded import Dut
6+
from pytest_embedded_idf.utils import idf_parametrize
7+
from pytest_embedded_idf.utils import soc_filtered_targets
8+
9+
@pytest.mark.generic
10+
@idf_parametrize(
11+
'target', soc_filtered_targets('SOC_PARLIO_SUPPORTED == 1'), indirect=['target']
12+
)
13+
def test_led_strip_parlio_ws2812(dut: Dut) -> None:
14+
dut.expect_exact('example: Created LED strip object with PARLIO backend')
15+
dut.expect_exact('example: Start blinking LED strip')
16+
dut.expect_exact('example: LED OFF!')
17+
dut.expect_exact('example: LED ON!')
18+
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Unlicense OR CC0-1.0
3+
4+
import pytest
5+
from pytest_embedded import Dut
6+
from pytest_embedded_idf.utils import idf_parametrize
7+
from pytest_embedded_idf.utils import soc_filtered_targets
8+
9+
@pytest.mark.generic
10+
@idf_parametrize(
11+
'target', soc_filtered_targets('SOC_RMT_SUPPORTED == 1'), indirect=['target']
12+
)
13+
def test_led_strip_rmt_ws2812(dut: Dut) -> None:
14+
dut.expect_exact('example: Created LED strip object with RMT backend')
15+
dut.expect_exact('example: Start blinking LED strip')
16+
dut.expect_exact('example: LED OFF!')
17+
dut.expect_exact('example: LED ON!')
18+
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Unlicense OR CC0-1.0
3+
4+
import pytest
5+
from pytest_embedded import Dut
6+
from pytest_embedded_idf.utils import idf_parametrize
7+
from pytest_embedded_idf.utils import soc_filtered_targets
8+
9+
@pytest.mark.generic
10+
@idf_parametrize(
11+
'target', soc_filtered_targets('SOC_SPI_SUPPORTED == 1'), indirect=['target']
12+
)
13+
def test_led_strip_spi_ws2812(dut: Dut) -> None:
14+
dut.expect_exact('example: Created LED strip object with SPI backend')
15+
dut.expect_exact('example: Start blinking LED strip')
16+
dut.expect_exact('example: LED OFF!')
17+
dut.expect_exact('example: LED ON!')
18+
19+

0 commit comments

Comments
 (0)