test_component_manager.py 844 B

12345678910111213141516171819202122232425
  1. # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.0
  3. import os.path
  4. from pathlib import Path
  5. import pytest
  6. from test_build_system_helpers import IdfPyFunc
  7. @pytest.mark.test_app_copy('examples/get-started/blink')
  8. def test_dependency_lock(idf_py: IdfPyFunc, test_app_copy: Path) -> None:
  9. with open(test_app_copy / 'CMakeLists.txt', 'r+') as fw:
  10. data = fw.read()
  11. fw.seek(0)
  12. fw.write(
  13. data.replace(
  14. 'project(blink)',
  15. 'idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET})\nproject(blink)',
  16. )
  17. )
  18. idf_py('fullclean')
  19. idf_py('reconfigure')
  20. assert os.path.isfile(test_app_copy / 'dependencies.lock.esp32')
  21. assert not os.path.isfile(test_app_copy / 'dependencies.lock')