twister: Don't require test_ prefix to set status

If a test doesn't start with test_, twister currently emits an error:
suite_name.test_name: Unknown status 'started'

Following the suggestion by Maksim Masalski on PR#21191, change the
regex to exclude spaces in the test name, and remove the check that the
test_ prefix exists.

See also #21162

Signed-off-by: Jeremy Bettis <jbettis@google.com>
This commit is contained in:
Jeremy Bettis 2023-08-28 22:00:04 +00:00 committed by Carles Cufí
commit 1d9ce862a7

View file

@ -24,7 +24,7 @@ logger.setLevel(logging.DEBUG)
_WINDOWS = platform.system() == 'Windows'
result_re = re.compile(r".*(PASS|FAIL|SKIP) - (test_)?(.*) in (\d*[.,]?\d*) seconds")
result_re = re.compile(r".*(PASS|FAIL|SKIP) - (test_)?(\S*) in (\d*[.,]?\d*) seconds")
class Harness:
GCOV_START = "GCOV_COVERAGE_DUMP_START"
GCOV_END = "GCOV_COVERAGE_DUMP_END"
@ -527,7 +527,7 @@ class Test(Harness):
result_match = result_re.match(line)
if result_match and result_match.group(2):
if result_match:
matched_status = result_match.group(1)
name = "{}.{}".format(self.id, result_match.group(3))
tc = self.instance.get_case_or_create(name)