-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebd2c7e
commit f8ba29a
Showing
14 changed files
with
140 additions
and
858 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
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,5 @@ | ||
# TODO: commented out until we can select specific configuration in pytest... | ||
# esp_jpeg/test_apps: | ||
# disable: | ||
# - if: (CONFIG_NAME == "rom") and (ESP_ROM_HAS_JPEG_DECODE != 1) | ||
# reason: "Only compile test with Tjpg ROM implementation for targets that support it" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# import json | ||
import logging | ||
import os | ||
import pytest | ||
from _pytest.fixtures import FixtureRequest | ||
import typing as t | ||
|
||
|
||
@pytest.fixture | ||
def config(request: FixtureRequest) -> str: | ||
return getattr(request, 'param', None) or 'default' # type: ignore | ||
|
||
|
||
@pytest.fixture | ||
def build_dir( | ||
request: FixtureRequest, | ||
app_path: str, | ||
target: t.Optional[str], | ||
config: t.Optional[str], | ||
) -> str: | ||
""" | ||
Check local build dir with the following priority: | ||
1. build_<target>_<config> | ||
2. build_<target> | ||
3. build_<config> | ||
4. build | ||
Returns: | ||
valid build directory | ||
""" | ||
check_dirs = [] | ||
build_dir_arg = request.config.getoption('build_dir', None) | ||
if build_dir_arg: | ||
check_dirs.append(build_dir_arg) | ||
if target is not None and config is not None: | ||
check_dirs.append(f'build_{target}_{config}') | ||
if target is not None: | ||
check_dirs.append(f'build_{target}') | ||
if config is not None: | ||
check_dirs.append(f'build_{config}') | ||
check_dirs.append('build') | ||
|
||
for check_dir in check_dirs: | ||
binary_path = os.path.join(app_path, check_dir) | ||
if os.path.isdir(binary_path): | ||
logging.info(f'found valid binary path: {binary_path}') | ||
return check_dir | ||
|
||
logging.warning('checking binary path: %s... missing... try another place', binary_path) | ||
|
||
raise ValueError( | ||
f'no build dir valid. Please build the binary via "idf.py -B {check_dirs[0]} build" and run pytest again' | ||
) |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
idf_component_register(SRCS "tjpgd_test.c" "test_tjpgd_main.c" | ||
INCLUDE_DIRS "." | ||
PRIV_REQUIRES "unity" | ||
WHOLE_ARCHIVE) | ||
WHOLE_ARCHIVE | ||
EMBED_FILES "logo.jpg" "usb_camera.jpg") |
Oops, something went wrong.