Merge branch 'bugfix/test_build_system_fixtures' into 'master'

build system tests: fix issues with idf_copy and get_idf_build_env

See merge request espressif/esp-idf!21754
This commit is contained in:
Ivan Grokhotkov
2023-01-02 16:14:38 +08:00
2 changed files with 6 additions and 2 deletions

View File

@@ -120,6 +120,7 @@ def idf_copy(session_work_dir: Path, request: FixtureRequest) -> typing.Generato
shutil.copytree(path_from, path_to, ignore=ignore, symlinks=True)
orig_idf_path = os.environ['IDF_PATH']
os.environ['IDF_PATH'] = str(path_to)
yield Path(path_to)

View File

@@ -43,8 +43,11 @@ def get_idf_build_env(idf_path: str) -> EnvDict:
'--format=key-value'
]
keys_values = subprocess.check_output(cmd, stderr=subprocess.PIPE).decode()
env_vars = {key: os.path.expandvars(value) for key, value in
[line.split('=') for line in keys_values.splitlines()]}
idf_tool_py_env = {key: os.path.expandvars(value) for key, value in
[line.split('=') for line in keys_values.splitlines()]}
env_vars = {} # type: EnvDict
env_vars.update(os.environ)
env_vars.update(idf_tool_py_env)
# not set by idf_tools.py, normally set by export.sh
env_vars['IDF_PATH'] = idf_path