[PATCH v4] dts: update overall result pass/skip logic
Dean Marx
dmarx at iol.unh.edu
Fri Mar 20 19:21:26 CET 2026
Update overall result of test suites such that
when some cases skip and at least one passes,
the result is a pass instead of a skip. Only
when all cases skip is the result a skip.
Bugzilla ID: 1899
Signed-off-by: Dean Marx <dmarx at iol.unh.edu>
Tested-by: Andrew Bailey <abailey at iol.unh.edu>
Reviewed-by: Andrew Bailey <abailey at iol.unh.edu>
---
dts/framework/test_result.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py
index c6bddc55a9..21faa55dc1 100644
--- a/dts/framework/test_result.py
+++ b/dts/framework/test_result.py
@@ -45,11 +45,11 @@
class Result(IntEnum):
"""The possible states that a setup, a teardown or a test case may end up in."""
- #:
- PASS = auto()
#:
SKIP = auto()
#:
+ PASS = auto()
+ #:
BLOCK = auto()
#:
FAIL = auto()
@@ -195,8 +195,15 @@ def extract_result(value: ResultNode | ResultLeaf) -> ResultLeaf:
case ResultLeaf():
return value
+ # Filter out setup/teardown steps
+ results = [
+ extract_result(child)
+ for child in self.children
+ if not (isinstance(child, ResultNode) and child.label in self.__ignore_steps)
+ ]
+
return max(
- (extract_result(child) for child in self.children),
+ results,
default=ResultLeaf(result=Result.PASS),
)
--
2.52.0
More information about the dev
mailing list