From 98deacdb55780232d958d9b10ce8feeebc870802 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 27 Jan 2022 11:20:02 +0100 Subject: ltp: update 20210927 -> 20220121 The ltp compliancy parser is rewritten to actually match the logs: they seem to be unstructured, test case names are not printed and the only indication of failure is appearance of FAIL[ED] somewhere. (From OE-Core rev: 52766561dbfee625c89393905a85e10d85f69c6c) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/logparser.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'meta/lib/oeqa/utils/logparser.py') diff --git a/meta/lib/oeqa/utils/logparser.py b/meta/lib/oeqa/utils/logparser.py index 60e16d500e..879aefca33 100644 --- a/meta/lib/oeqa/utils/logparser.py +++ b/meta/lib/oeqa/utils/logparser.py @@ -135,30 +135,27 @@ class LtpComplianceParser(object): def parse(self, logfile): test_regex = {} - test_regex['PASSED'] = re.compile(r"^PASS") - test_regex['FAILED'] = re.compile(r"^FAIL") - test_regex['SKIPPED'] = re.compile(r"(?:UNTESTED)|(?:UNSUPPORTED)") + test_regex['FAILED'] = re.compile(r"FAIL") section_regex = {} - section_regex['test'] = re.compile(r"^Testing") + section_regex['test'] = re.compile(r"^Executing") with open(logfile, errors='replace') as f: + name = logfile + result = "PASSED" for line in f: - result = section_regex['test'].search(line) - if result: - self.name = "" - self.name = line.split()[1].strip() - self.results[self.name] = "PASSED" - failed = 0 + regex_result = section_regex['test'].search(line) + if regex_result: + name = line.split()[1].strip() - failed_result = test_regex['FAILED'].search(line) - if failed_result: - failed = line.split()[1].strip() - if int(failed) > 0: - self.results[self.name] = "FAILED" + regex_result = test_regex['FAILED'].search(line) + if regex_result: + result = "FAILED" + self.results[name] = result for test in self.results: result = self.results[test] + print (self.results) self.section['log'] = self.section['log'] + ("%s: %s\n" % (result.strip()[:-2], test.strip())) return self.results, self.section -- cgit v1.2.3-54-g00ecf