From f9f4b0ef5dfd10bf8a936b3eecc2407fe94fc305 Mon Sep 17 00:00:00 2001 From: yanxk Date: Sun, 14 Aug 2022 17:25:42 +0800 Subject: agl-test-framework: enable ptest of 'bc' we have already submitted patches that enabled ptest of 'bc' to the OpenEmbedded community and the patches got merged. but it is not yet in the YP 4.0.5, so it would skip now. it can be seen in YP 4.1. we now add it into the test framework, for it would be available in the next YP release, maybe, or several versions later. Signed-off-by: yanxk Change-Id: Iffdef472c9449c9e3179c3b3bd1273fb2ec0e032 --- tests/bc/parser.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/bc/parser.py (limited to 'tests/bc/parser.py') diff --git a/tests/bc/parser.py b/tests/bc/parser.py new file mode 100644 index 0000000..8c3cd95 --- /dev/null +++ b/tests/bc/parser.py @@ -0,0 +1,34 @@ +# +# this is a parser function specially designed for the 'bc.log' +# +import re + +def log_parse(log_file): + # set up rule for regex + reObj = re.compile('^(PASS|FAIL+?):\\sbc/(.+)[.]b', re.MULTILINE) + + # init a dictionary, it stores the return result + case_list = dict() + + # open file + test_log = open(log_file, 'r') + + # start to read the new line + line = test_log.readline() + + while line: + # checking regex status in line + matchs = reObj.search(line) + + # if the line fits the regex rule + if matchs: + # spliting elements into a tuple + groups = matchs.groups() + case_list[groups[1]] = [groups[1], groups[0], ""] + + # jump out if-else, read next line + line = test_log.readline() + + test_log.close() + + return case_list -- cgit