mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Tools: Load tool versions automatically for IDF Tools tests
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
@ -45,13 +46,29 @@ XTENSA_ESP32_ELF = 'xtensa-esp32-elf'
|
|||||||
XTENSA_ESP32S2_ELF = 'xtensa-esp32s2-elf'
|
XTENSA_ESP32S2_ELF = 'xtensa-esp32s2-elf'
|
||||||
XTENSA_ESP32S3_ELF = 'xtensa-esp32s3-elf'
|
XTENSA_ESP32S3_ELF = 'xtensa-esp32s3-elf'
|
||||||
|
|
||||||
ESP32ULP_VERSION = '2.28.51-esp-20191205'
|
|
||||||
ESP32S2ULP_VERSION = '2.28.51-esp-20191205'
|
def get_version_dict():
|
||||||
OPENOCD_VERSION = 'v0.10.0-esp32-20211111'
|
'''
|
||||||
RISCV_ELF_VERSION = 'esp-2021r2-8.4.0'
|
Return a dictionary with tool name to tool version mapping.
|
||||||
XTENSA_ESP32_ELF_VERSION = 'esp-2021r2-8.4.0'
|
|
||||||
XTENSA_ESP32S2_ELF_VERSION = 'esp-2021r2-8.4.0'
|
It works with tools.json directly and not through idf_tools.py in order to bypass the script under test. This is
|
||||||
XTENSA_ESP32S3_ELF_VERSION = 'esp-2021r2-8.4.0'
|
a little hacky but thanks to this, versions are not required to be updated here every time a tool is updated.
|
||||||
|
'''
|
||||||
|
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'tools.json')) as f:
|
||||||
|
tools_obj = json.loads(f.read())
|
||||||
|
|
||||||
|
return dict((tool['name'], tool['versions'][0]['name']) for tool in tools_obj['tools'])
|
||||||
|
|
||||||
|
|
||||||
|
version_dict = get_version_dict()
|
||||||
|
|
||||||
|
ESP32ULP_VERSION = version_dict[ESP32ULP]
|
||||||
|
ESP32S2ULP_VERSION = version_dict[ESP32S2ULP]
|
||||||
|
OPENOCD_VERSION = version_dict[OPENOCD]
|
||||||
|
RISCV_ELF_VERSION = version_dict[RISCV_ELF]
|
||||||
|
XTENSA_ESP32_ELF_VERSION = version_dict[XTENSA_ESP32_ELF]
|
||||||
|
XTENSA_ESP32S2_ELF_VERSION = version_dict[XTENSA_ESP32S2_ELF]
|
||||||
|
XTENSA_ESP32S3_ELF_VERSION = version_dict[XTENSA_ESP32S3_ELF]
|
||||||
|
|
||||||
|
|
||||||
class TestUsage(unittest.TestCase):
|
class TestUsage(unittest.TestCase):
|
||||||
|
Reference in New Issue
Block a user