mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
test: improve test_dependency_lock test case
This commit is contained in:
@ -3,22 +3,17 @@
|
|||||||
import os.path
|
import os.path
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
|
||||||
from test_build_system_helpers import IdfPyFunc
|
from test_build_system_helpers import IdfPyFunc
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.test_app_copy('examples/get-started/blink')
|
|
||||||
def test_dependency_lock(idf_py: IdfPyFunc, test_app_copy: Path) -> None:
|
def test_dependency_lock(idf_py: IdfPyFunc, test_app_copy: Path) -> None:
|
||||||
with open(test_app_copy / 'CMakeLists.txt', 'r+') as fw:
|
replace_in_file(
|
||||||
data = fw.read()
|
test_app_copy / 'CMakeLists.txt',
|
||||||
fw.seek(0)
|
search='# placeholder_after_include_project_cmake',
|
||||||
fw.write(
|
replace='idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET})',
|
||||||
data.replace(
|
)
|
||||||
'project(blink)',
|
|
||||||
'idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET})\nproject(blink)',
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
idf_py('add-dependency', 'example/cmp')
|
||||||
idf_py('fullclean')
|
idf_py('fullclean')
|
||||||
idf_py('reconfigure')
|
idf_py('reconfigure')
|
||||||
assert os.path.isfile(test_app_copy / 'dependencies.lock.esp32')
|
assert os.path.isfile(test_app_copy / 'dependencies.lock.esp32')
|
||||||
|
Reference in New Issue
Block a user