| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 def Cleanup(self): | 57 def Cleanup(self): |
| 58 # TODO(ngeoffray): We run out of space on the build bots for these tests if | 58 # TODO(ngeoffray): We run out of space on the build bots for these tests if |
| 59 # the temp directories are not removed right after running the test. | 59 # the temp directories are not removed right after running the test. |
| 60 if not self.context.keep_temporary_files: | 60 if not self.context.keep_temporary_files: |
| 61 self.run_arch.Cleanup() | 61 self.run_arch.Cleanup() |
| 62 | 62 |
| 63 | 63 |
| 64 class MultiTestCase(StandardTestCase): | 64 class MultiTestCase(StandardTestCase): |
| 65 """Multiple test cases defined within a single *Test.dart file.""" | 65 """Multiple test cases defined within a single *Test.dart file.""" |
| 66 | 66 |
| 67 def __init__(self, context, path, filename, kind, mode, arch, component): | 67 def __init__(self, context, path, filename, kind, mode, arch, component, |
| 68 vm_options = None): |
| 68 super(MultiTestCase, self).__init__(context, path, filename, mode, arch, | 69 super(MultiTestCase, self).__init__(context, path, filename, mode, arch, |
| 69 component) | 70 component, vm_options) |
| 70 self.kind = kind | 71 self.kind = kind |
| 71 | 72 |
| 72 def GetCommand(self): | 73 def GetCommand(self): |
| 73 """Returns a commandline to execute to perform the test.""" | 74 """Returns a commandline to execute to perform the test.""" |
| 74 return self.run_arch.GetRunCommand( | 75 return self.run_arch.GetRunCommand( |
| 75 fatal_static_type_errors=(self.kind == 'static type error')) | 76 fatal_static_type_errors=(self.kind == 'static type error')) |
| 76 | 77 |
| 77 def IsNegative(self): | 78 def IsNegative(self): |
| 78 """Determine if this is a negative test. by looking at @ directives. | 79 """Determine if this is a negative test. by looking at @ directives. |
| 79 | 80 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 self.filename] | 161 self.filename] |
| 161 | 162 |
| 162 return cmd | 163 return cmd |
| 163 | 164 |
| 164 def GetName(self): | 165 def GetName(self): |
| 165 return self.path[-1] | 166 return self.path[-1] |
| 166 | 167 |
| 167 def Cleanup(self): | 168 def Cleanup(self): |
| 168 if not self.context.keep_temporary_files: | 169 if not self.context.keep_temporary_files: |
| 169 self.run_arch.Cleanup() | 170 self.run_arch.Cleanup() |
| OLD | NEW |