-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(lcd_qemu_rgb_panel): test example in CI
- Loading branch information
Showing
10 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Generic requirements for all tests | ||
pytest-embedded==1.11.7 | ||
pytest-embedded-serial-esp==1.11.7 | ||
pytest-embedded-idf==1.11.7 | ||
pytest-embedded-qemu==1.11.7 | ||
pytest-custom_exit_code==0.3.0 | ||
|
||
# Test-specific requirements | ||
cryptography==43.0.3 | ||
pillow==10.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
esp_lcd_qemu_rgb/examples/lcd_qemu_rgb_panel/pytest_lcd_qemu_rgb_panel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
|
||
import pytest | ||
import os | ||
from pytest_embedded import Dut | ||
import time | ||
try: | ||
from PIL import Image | ||
from PIL import ImageChops | ||
except ImportError: | ||
Image = None | ||
|
||
Check warning on line 13 in esp_lcd_qemu_rgb/examples/lcd_qemu_rgb_panel/pytest_lcd_qemu_rgb_panel.py GitHub Actions / Test Resultstest_qemu_rgb_panel[idf,qemu--display sdl] (esp_lcd_qemu_rgb.examples.lcd_qemu_rgb_panel.pytest_lcd_qemu_rgb_panel) failed
Raw output
|
||
@pytest.mark.qemu | ||
@pytest.mark.parametrize('qemu_extra_args', ['-display sdl']) | ||
@pytest.mark.parametrize('embedded_services', ['idf,qemu']) | ||
def test_qemu_rgb_panel(dut: Dut) -> None: | ||
if not Image: | ||
pytest.fail('Pillow is not installed') | ||
|
||
dut.expect_exact('Install RGB LCD panel driver') | ||
dut.expect_exact('LVGL Scatter Chart displayed') | ||
time.sleep(2) | ||
filename = 'scatter_chart.ppm' | ||
dut.qemu.take_screenshot(filename) | ||
|
||
img = Image.open(filename) | ||
ref_img = Image.open(os.path.join(os.path.dirname(__file__), 'doc', 'scatter_chart.png')) | ||
|
||
diff = ImageChops.difference(img, ref_img) | ||
assert not diff.getbbox(), 'Images are different' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_EXAMPLE_QEMU_RGB_PANEL_STATIC=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters