ci: pass target from build stage to unit test

This commit is contained in:
Michael (XIAO Xufeng)
2019-08-22 16:45:25 +08:00
committed by Angus Gratton
parent 4558824150
commit 3a9ae4acc6
4 changed files with 43 additions and 13 deletions
+16 -4
View File
@@ -10,7 +10,7 @@ import CreateSectionTable
TEST_CASE_PATTERN = {
"initial condition": "UTINIT1",
"SDK": "ESP32_IDF",
"chip_target": "esp32",
"level": "Unit",
"execution time": 0,
"auto test": "Yes",
@@ -73,6 +73,7 @@ class Parser(object):
table = CreateSectionTable.SectionTable("section_table.tmp")
tags = self.parse_tags(os.path.join(config_output_folder, self.SDKCONFIG_FILE))
print("Tags of config %s: %s" % (config_name, tags))
test_cases = []
# we could split cases of same config into multiple binaries as we have limited rom space
@@ -94,7 +95,17 @@ class Parser(object):
name = table.get_string("any", name_addr)
desc = table.get_string("any", desc_addr)
file_name = table.get_string("any", file_name_addr)
tc = self.parse_one_test_case(name, desc, file_name, config_name, stripped_config_name, tags)
# Search in tags to set the target
target_tag_dict = {"ESP32_IDF": "esp32", "7.2.2": "esp32s2beta"}
for tag in target_tag_dict:
if tag in tags:
target = target_tag_dict[tag]
break
else:
target = "esp32"
tc = self.parse_one_test_case(name, desc, file_name, config_name, stripped_config_name, tags, target)
# check if duplicated case names
# we need to use it to select case,
@@ -233,7 +244,7 @@ class Parser(object):
return match.group(1).split(' ')
return None
def parse_one_test_case(self, name, description, file_name, config_name, stripped_config_name, tags):
def parse_one_test_case(self, name, description, file_name, config_name, stripped_config_name, tags, target):
"""
parse one test case
:param name: test case name (summary)
@@ -261,7 +272,8 @@ class Parser(object):
"multi_device": prop["multi_device"],
"multi_stage": prop["multi_stage"],
"timeout": int(prop["timeout"]),
"tags": tags})
"tags": tags,
"chip_target": target})
return test_case
def dump_test_cases(self, test_cases):