!234 修复L0和L1设备中C++驱动报告异常的bug

Merge pull request !234 from liguangjie/master
This commit is contained in:
openharmony_ci 2023-06-02 02:52:23 +00:00 committed by Gitee
commit 76d3ecfdea
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 4 deletions

View File

@ -367,6 +367,7 @@ class CppTestListParser(IParser):
self.last_test_class_name = None
self.tests = []
self.result_data = ""
self.suites = dict()
def __process__(self, lines):
for line in lines:
@ -384,14 +385,22 @@ class CppTestListParser(IParser):
line)
if class_matcher:
self.last_test_class_name = class_matcher.group(1)
if self.last_test_class_name not in self.suites:
self.suites.setdefault(self.last_test_class_name, [])
elif method_matcher:
if not self.last_test_class_name:
LOG.error("Parsed new test case name %s but no test class name"
" has been set" % line)
else:
test = TestDescription(self.last_test_class_name,
method_matcher.group(1))
self.tests.append(test)
test_name = method_matcher.group(1)
if test_name not in self.suites.get(self.last_test_class_name, []):
test = TestDescription(self.last_test_class_name,
test_name)
self.tests.append(test)
self.suites.get(self.last_test_class_name, []).append(test_name)
else:
LOG.debug("[{}.{}] has already collect it, skip it.".format(
self.last_test_class_name, test_name))
else:
if not check_pub_key_exist():
LOG.debug("Line ignored: %s" % line)

View File

@ -701,7 +701,7 @@ class CTestParser(IParser):
test_class, test_name, status, run_time = \
self.parse_test_description(message)
test_result = self.state_machine.test(reset=True)
test_result.test_class = test_class
test_result.test_class = self.state_machine.suite().suite_name
test_result.test_name = test_name
test_result.run_time = run_time
self.state_machine.running_test_index += 1