File tree 3 files changed +33
-4
lines changed
3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,6 @@ jobs:
196
196
PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi/"
197
197
run : |
198
198
pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code opencv-python numpy
199
- apt-get update && apt-get install -y libgl1
200
199
- name : Download latest results
201
200
uses : actions/download-artifact@v4
202
201
with :
@@ -205,7 +204,6 @@ jobs:
205
204
- name : Run apps
206
205
run : |
207
206
pytest --suppress-no-test-exit-code --ignore-glob '*/managed_components/*' --ignore=.github --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.runs-on }} ${{ env.PYTEST_BENCHMARK_IGNORE }}
208
- python .github/ci/runner_camera.py
209
207
- name : Upload test results
210
208
uses : actions/upload-artifact@v4
211
209
if : always()
Original file line number Diff line number Diff line change 1
- # SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
2
2
# SPDX-License-Identifier: CC0-1.0
3
3
4
4
import pytest
5
5
from pytest_embedded import Dut
6
+ from pytest_helpers import bsp_test_image
6
7
7
8
8
9
@pytest .mark .esp_box_3
20
21
@pytest .mark .m5stack_core_s3
21
22
@pytest .mark .m5stack_core_s3_se
22
23
@pytest .mark .m5_atom_s3
23
- def test_display_example (dut : Dut ) -> None :
24
+ def test_display_example (dut : Dut , request ) -> None :
25
+ board = request .node .callspec .id
24
26
dut .expect_exact ('example: Display LVGL animation' )
25
27
dut .expect_exact ('main_task: Returned from app_main()' )
28
+ bsp_test_image (board , "" )
Original file line number Diff line number Diff line change
1
+ # SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ import cv2
4
+
5
+
6
+ def bsp_capture_image (image_path ):
7
+ # Return video from the first webcam on your computer.
8
+ cap = cv2 .VideoCapture (0 )
9
+ # reads frames from a camera
10
+ # ret checks return at each frame
11
+ ret , frame = cap .read ()
12
+ if ret :
13
+ # TODO: Change size image
14
+ # TODO: Crop image
15
+
16
+ # Save image
17
+ cv2 .imwrite (image_path , frame )
18
+ print (f"Image saved { image_path } " )
19
+ else :
20
+ print ("Cannot save image." )
21
+
22
+ # Close the window / Release webcam
23
+ cap .release ()
24
+
25
+
26
+ def bsp_test_image (board , expectation ):
27
+ image_file = f"snapshot_{ board } .jpg"
28
+ bsp_capture_image (image_file )
You can’t perform that action at this time.
0 commit comments