mirror of
https://github.com/espressif/esp-idf.git
synced 2025-06-25 01:11:38 +02:00
test(tools): Added test for installing supported tool version
Added test_export_supported_version_cmake in `test_idf_tools.py`, that installs and exports supported version of tool - cmake.
This commit is contained in:
@ -113,7 +113,8 @@ test_cli_installer:
|
||||
script:
|
||||
# Tools must be downloaded for testing
|
||||
# We could use "idf_tools.py download all", but we don't want to install clang because of its huge size
|
||||
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
|
||||
# cmake@version that is supported
|
||||
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
|
||||
- cd ${IDF_PATH}/tools/test_idf_tools
|
||||
- python3 -m pip install jsonschema
|
||||
- python3 ./test_idf_tools.py -v
|
||||
|
@ -35,7 +35,8 @@ test_cli_installer_win:
|
||||
timeout: 3h
|
||||
script:
|
||||
# Tools must be downloaded for testing
|
||||
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
|
||||
# cmake@version that is supported
|
||||
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
|
||||
- cd ${IDF_PATH}\tools\test_idf_tools
|
||||
- python -m pip install jsonschema
|
||||
- python .\test_idf_tools.py
|
||||
|
@ -313,6 +313,32 @@ class TestUsage(TestUsageBase):
|
||||
|
||||
self.assertIn(os.path.join(tool_to_test, tool_version), output)
|
||||
|
||||
def test_export_supported_version_cmake(self):
|
||||
tool_to_test = 'cmake'
|
||||
supported_version = ''
|
||||
recommended_version = ''
|
||||
for tool in self.tools_dict['tools']:
|
||||
if tool['name'] != tool_to_test:
|
||||
continue
|
||||
for version in tool['versions']:
|
||||
if version['status'] == 'supported':
|
||||
supported_version = version['name']
|
||||
elif version['status'] == 'recommended':
|
||||
recommended_version = version['name']
|
||||
|
||||
self.run_idf_tools_with_action(['install'])
|
||||
output = self.run_idf_tools_with_action(['install', f'{tool_to_test}@{supported_version}'])
|
||||
self.assert_tool_installed(output, tool_to_test, supported_version)
|
||||
|
||||
# Remove the recommended version folder installed by install command (in case of Windows)
|
||||
recommended_version_folder = os.path.join(self.temp_tools_dir, 'tools', tool_to_test, recommended_version)
|
||||
if os.path.exists(recommended_version_folder):
|
||||
shutil.rmtree(recommended_version_folder)
|
||||
|
||||
output = self.run_idf_tools_with_action(['export'])
|
||||
self.assertIn(os.path.join(tool_to_test, supported_version), output)
|
||||
self.assertNotIn(os.path.join(tool_to_test, recommended_version), output)
|
||||
|
||||
def test_export_prefer_system_cmake(self):
|
||||
tool_to_test = 'cmake'
|
||||
self.run_idf_tools_with_action(['install'])
|
||||
|
Reference in New Issue
Block a user