From d747aa78d59ef7c1936c54497ca8403b1b7b7172 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 9 Dec 2022 15:56:05 +0100 Subject: [PATCH] os.TestResutls: Add method addResults() Add method addResults(), which allows to merge results of another TestResults instance into the called instance. Signed-off-by: Jan Lindemann --- src/python/devtest/os/TestResults.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/python/devtest/os/TestResults.py b/src/python/devtest/os/TestResults.py index b70d420..7dc46eb 100644 --- a/src/python/devtest/os/TestResults.py +++ b/src/python/devtest/os/TestResults.py @@ -98,6 +98,9 @@ class TestResults: # export def add(self, case, phase, result): self.__records.append([case, phase, result]) + def addResults(self, results): + self.__records.extend(results.__records) + def n_failed(self): return len(list(filter(None, [rec[TestResults.Field.Result] for rec in self.__records])))