fix(pytest): respect --build-dir argument from pytest-embedded

This commit is contained in:
Ivan Grokhotkov 2024-04-30 17:57:17 +02:00
parent ef716a2390
commit 087d055090
No known key found for this signature in database
GPG Key ID: 1E050E141B280628
3 changed files with 5 additions and 0 deletions

View File

@ -212,6 +212,9 @@ def build_dir(
check_dirs = [f'build_{target}_{config}']
else:
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:

View File

@ -478,6 +478,7 @@ Build Directories
By default, each test case looks for the required binary files in the following directories (in order):
- Directory set by ``--build-dir`` command line argument, if specified.
- ``build_<target>_<sdkconfig>``
- ``build_<target>``
- ``build_<sdkconfig>``

View File

@ -574,6 +574,7 @@ CI 用于执行所有相关测试的命令为: ``pytest <parent_dir> --target
默认情况下pytest 脚本会按照以下顺序查找编译目录:
- 由 ``--build-dir`` 命令行参数设置的目录。(当指定时)
- ``build_<target>_<sdkconfig>``
- ``build_<target>``
- ``build_<sdkconfig>``