twister: Switch to a non-greedy regex
When parsing test names from symbol names, use a non-greedy match to avoid parsing test names with __ in them. The symbol looks like z_ztest_unit_test__SUITE__TEST. It is more likely that a test name will contain __ than a suite name, so now something z_ztest_unit_test__a_b__c_d__e_f will be parsed as suite:a_b test:c_d__e_f, whereas it used to be parsed as suite:a_b__c_d test:e_f Signed-off-by: Jeremy Bettis <jbettis@google.com>
This commit is contained in:
parent
1d9ce862a7
commit
1e471eb2a7
1 changed files with 1 additions and 1 deletions
|
@ -684,7 +684,7 @@ class ProjectBuilder(FilterBuilder):
|
|||
elf = ELFFile(open(elf_file, "rb"))
|
||||
|
||||
logger.debug(f"Test instance {self.instance.name} already has {len(self.instance.testcases)} cases.")
|
||||
new_ztest_unit_test_regex = re.compile(r"z_ztest_unit_test__([^\s]*)__([^\s]*)")
|
||||
new_ztest_unit_test_regex = re.compile(r"z_ztest_unit_test__([^\s]+?)__([^\s]*)")
|
||||
detected_cases = []
|
||||
for section in elf.iter_sections():
|
||||
if isinstance(section, SymbolTableSection):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue