| 631 | |
| 632 | |
| 633 | class TestOutput(object): |
| 634 | |
| 635 | def __init__(self, test, command, output, store_unexpected_output): |
| 636 | self.test = test |
| 637 | self.command = command |
| 638 | self.output = output |
| 639 | self.store_unexpected_output = store_unexpected_output |
| 640 | self.diagnostic = [] |
| 641 | |
| 642 | def UnexpectedOutput(self): |
| 643 | if self.HasCrashed(): |
| 644 | outcome = CRASH |
| 645 | elif self.HasTimedOut(): |
| 646 | outcome = TIMEOUT |
| 647 | elif self.HasFailed(): |
| 648 | outcome = FAIL |
| 649 | else: |
| 650 | outcome = PASS |
| 651 | return not outcome in self.test.outcomes |
| 652 | |
| 653 | def HasCrashed(self): |
| 654 | if utils.IsWindows(): |
| 655 | return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.output.exit_code) |
| 656 | else: |
| 657 | # Timed out tests will have exit_code -signal.SIGTERM. |
| 658 | if self.output.timed_out: |
| 659 | return False |
| 660 | return self.output.exit_code < 0 |
| 661 | |
| 662 | def HasTimedOut(self): |
| 663 | return self.output.timed_out |
| 664 | |
| 665 | def HasFailed(self): |
| 666 | execution_failed = self.test.DidFail(self.output) |
| 667 | if self.test.IsNegative(): |
| 668 | return not execution_failed |
| 669 | else: |
| 670 | return execution_failed |
| 671 | |
| 672 | |
| 673 | def KillProcessWithID(pid, signal_to_send=signal.SIGTERM): |
no outgoing calls
searching dependent graphs…