Skip to content

Commit 91dc04d

Browse files
nashifkartben
authored andcommitted
twister: adapt ctest results for twister
When we have skips in ctest, the overall result should not be marked as a SKIP unless all tests have been skipped. If we have passing tests, mark the test as PASS. Any failures/errors obviously will fail the tests. Also pass the skip reason from ctest to twister to give a hint about what is going on in case of skips. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent c511b16 commit 91dc04d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/pylib/twister/twisterlib/harness.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ def _parse_report_file(self, report):
11321132
elif suite.errors and suite.errors > 0:
11331133
self.status = TwisterStatus.ERROR
11341134
self.instance.reason = 'Error during ctest execution'
1135-
elif suite.skipped and suite.skipped > 0:
1135+
elif suite.skipped == suite.tests:
11361136
self.status = TwisterStatus.SKIP
11371137
else:
11381138
self.status = TwisterStatus.PASS
@@ -1149,6 +1149,8 @@ def _parse_report_file(self, report):
11491149
tc.output = case.system_out
11501150
elif any(isinstance(r, junit.Skipped) for r in case.result):
11511151
tc.status = TwisterStatus.SKIP
1152+
tc.reason = next((r.message for r in case.result \
1153+
if isinstance(r, junit.Skipped)), 'Ctest skip')
11521154
else:
11531155
tc.status = TwisterStatus.PASS
11541156

0 commit comments

Comments
 (0)