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>
This commit is contained in:
parent
c511b16fca
commit
91dc04d5d0
1 changed files with 3 additions and 1 deletions
|
@ -1132,7 +1132,7 @@ class Ctest(Harness):
|
||||||
elif suite.errors and suite.errors > 0:
|
elif suite.errors and suite.errors > 0:
|
||||||
self.status = TwisterStatus.ERROR
|
self.status = TwisterStatus.ERROR
|
||||||
self.instance.reason = 'Error during ctest execution'
|
self.instance.reason = 'Error during ctest execution'
|
||||||
elif suite.skipped and suite.skipped > 0:
|
elif suite.skipped == suite.tests:
|
||||||
self.status = TwisterStatus.SKIP
|
self.status = TwisterStatus.SKIP
|
||||||
else:
|
else:
|
||||||
self.status = TwisterStatus.PASS
|
self.status = TwisterStatus.PASS
|
||||||
|
@ -1149,6 +1149,8 @@ class Ctest(Harness):
|
||||||
tc.output = case.system_out
|
tc.output = case.system_out
|
||||||
elif any(isinstance(r, junit.Skipped) for r in case.result):
|
elif any(isinstance(r, junit.Skipped) for r in case.result):
|
||||||
tc.status = TwisterStatus.SKIP
|
tc.status = TwisterStatus.SKIP
|
||||||
|
tc.reason = next((r.message for r in case.result \
|
||||||
|
if isinstance(r, junit.Skipped)), 'Ctest skip')
|
||||||
else:
|
else:
|
||||||
tc.status = TwisterStatus.PASS
|
tc.status = TwisterStatus.PASS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue