scripts: twister: Fix duplicate statusless testcases

In some cases, Twister would report twice the amount
of testcases run than expected, with half of them
lacking any status.

This change fixes erroneous ELF testcase name extraction,
which deleted every instance of 'test_' in the name,
rather than just the first.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This commit is contained in:
Lukasz Mrugala 2024-04-22 12:22:37 +00:00 committed by Fabio Baltieri
parent fdcd944c82
commit f99dc66d8e

View file

@ -731,7 +731,7 @@ class ProjectBuilder(FilterBuilder):
if matches:
for m in matches:
# new_ztest_suite = m[0] # not used for now
test_func_name = m[1].replace("test_", "")
test_func_name = m[1].replace("test_", "", 1)
testcase_id = f"{yaml_testsuite_name}.{test_func_name}"
detected_cases.append(testcase_id)