Show More
@@ -619,6 +619,23 b' class Test(object):' | |||
|
619 | 619 | if not self._options.keep_tmpdir: |
|
620 | 620 | shutil.rmtree(testtmp) |
|
621 | 621 | |
|
622 | if ret == SKIPPED_STATUS: | |
|
623 | if out is None: # Debug mode, nothing to parse. | |
|
624 | missing = ['unknown'] | |
|
625 | failed = None | |
|
626 | else: | |
|
627 | missing, failed = parsehghaveoutput(out) | |
|
628 | ||
|
629 | if not missing: | |
|
630 | missing = ['irrelevant'] | |
|
631 | ||
|
632 | if failed: | |
|
633 | return self.fail('hg have failed checking for %s' % failed[-1], | |
|
634 | ret) | |
|
635 | else: | |
|
636 | result.skipped = True | |
|
637 | return self.skip(missing[-1]) | |
|
638 | ||
|
622 | 639 | def _run(self, testtmp, replacements, env): |
|
623 | 640 | raise NotImplemented('Subclasses must implement Test.run()') |
|
624 | 641 | |
@@ -699,6 +716,12 b' class Test(object):' | |||
|
699 | 716 | |
|
700 | 717 | return warned and '~' or '!', self._test, msg |
|
701 | 718 | |
|
719 | def skip(self, msg): | |
|
720 | if self._options.verbose: | |
|
721 | log("\nSkipping %s: %s" % (self._path, msg)) | |
|
722 | ||
|
723 | return 's', self._test, msg | |
|
724 | ||
|
702 | 725 | class TestResult(object): |
|
703 | 726 | """Holds the result of a test execution.""" |
|
704 | 727 | |
@@ -708,11 +731,7 b' class TestResult(object):' | |||
|
708 | 731 | self.duration = None |
|
709 | 732 | self.exception = None |
|
710 | 733 | self.refout = None |
|
711 | ||
|
712 | @property | |
|
713 | def skipped(self): | |
|
714 | """Whether the test was skipped.""" | |
|
715 | return self.ret == SKIPPED_STATUS | |
|
734 | self.skipped = False | |
|
716 | 735 | |
|
717 | 736 | class PythonTest(Test): |
|
718 | 737 | """A Python-based test.""" |
@@ -1101,7 +1120,7 b' def runone(options, test, count):' | |||
|
1101 | 1120 | |
|
1102 | 1121 | t = runner(test, testpath, options, count, ref, err) |
|
1103 | 1122 | res = TestResult() |
|
1104 | t.run(res) | |
|
1123 | result = t.run(res) | |
|
1105 | 1124 | |
|
1106 | 1125 | if res.exception: |
|
1107 | 1126 | return t.fail('Exception during execution: %s' % res.exception, 255) |
@@ -1122,19 +1141,8 b' def runone(options, test, count):' | |||
|
1122 | 1141 | f.write(line) |
|
1123 | 1142 | f.close() |
|
1124 | 1143 | |
|
1125 |
if |
|
|
1126 | if out is None: # debug mode: nothing to parse | |
|
1127 | missing = ['unknown'] | |
|
1128 | failed = None | |
|
1129 | else: | |
|
1130 | missing, failed = parsehghaveoutput(out) | |
|
1131 | if not missing: | |
|
1132 | missing = ['irrelevant'] | |
|
1133 | if failed: | |
|
1134 | result = t.fail("hghave failed checking for %s" % failed[-1], ret) | |
|
1135 | skipped = False | |
|
1136 | else: | |
|
1137 | result = skip(missing[-1]) | |
|
1144 | if result: | |
|
1145 | pass | |
|
1138 | 1146 | elif ret == 'timeout': |
|
1139 | 1147 | result = t.fail("timed out", ret) |
|
1140 | 1148 | elif out != refout: |
General Comments 0
You need to be logged in to leave comments.
Login now