| OLD | NEW |
| 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Common TestCase subclasses used to define a single test.""" | 5 """Common TestCase subclasses used to define a single test.""" |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 import tempfile | 8 import tempfile |
| 9 | 9 |
| 10 import test | 10 import test |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 # If errors were found, fail fast and show compile errors: | 117 # If errors were found, fail fast and show compile errors: |
| 118 if test_output.output.exit_code != 0: | 118 if test_output.output.exit_code != 0: |
| 119 return test_output | 119 return test_output |
| 120 | 120 |
| 121 command = self.run_arch.GetRunCommand() | 121 command = self.run_arch.GetRunCommand() |
| 122 test_output = self.RunCommand(command) | 122 test_output = self.RunCommand(command) |
| 123 # The return value of DumpRenderedTree does not indicate test failing, but | 123 # The return value of DumpRenderedTree does not indicate test failing, but |
| 124 # the output does. | 124 # the output does. |
| 125 if self.run_arch.HasFailed(test_output.output.stdout): | 125 if self.run_arch.HasFailed(test_output.output.stdout): |
| 126 test_output.output.exit_code = 1 | 126 test_output.output.exit_code = 1 |
| 127 # DumpRenderTree is sometimes flaky in xvfb-run, try again in that case. |
| 128 if (self.run_arch.WasFlakyDrt(test_output.output.stderr)): |
| 129 print "\nFlaky Gtw-WARNING error found, trying again..." |
| 130 test_output = self.RunCommand(command) |
| 131 if self.run_arch.HasFailed(test_output.output.stdout): |
| 132 test_output.output.exit_code = 1 |
| 127 | 133 |
| 128 return test_output | 134 return test_output |
| 129 | 135 |
| 130 | 136 |
| 131 class CompilationTestCase(test.TestCase): | 137 class CompilationTestCase(test.TestCase): |
| 132 """Run the dartc compiler on a given top level .dart file.""" | 138 """Run the dartc compiler on a given top level .dart file.""" |
| 133 | 139 |
| 134 def __init__(self, path, context, filename, mode, arch, component): | 140 def __init__(self, path, context, filename, mode, arch, component): |
| 135 super(CompilationTestCase, self).__init__(context, path) | 141 super(CompilationTestCase, self).__init__(context, path) |
| 136 self.filename = filename | 142 self.filename = filename |
| (...skipping 24 matching lines...) Expand all Loading... |
| 161 self.filename] | 167 self.filename] |
| 162 | 168 |
| 163 return cmd | 169 return cmd |
| 164 | 170 |
| 165 def GetName(self): | 171 def GetName(self): |
| 166 return self.path[-1] | 172 return self.path[-1] |
| 167 | 173 |
| 168 def Cleanup(self): | 174 def Cleanup(self): |
| 169 if not self.context.keep_temporary_files: | 175 if not self.context.keep_temporary_files: |
| 170 self.run_arch.Cleanup() | 176 self.run_arch.Cleanup() |
| OLD | NEW |