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 | 5 |
6 import os | 6 import os |
7 from os.path import join, exists | 7 from os.path import join, exists |
8 import re | 8 import re |
9 | 9 |
10 import test | 10 import test |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 # Parse the options by reading the .dart source file. | 43 # Parse the options by reading the .dart source file. |
44 source = self.GetSource() | 44 source = self.GetSource() |
45 vm_options = utils.ParseTestOptions(test.VM_OPTIONS_PATTERN, source, | 45 vm_options = utils.ParseTestOptions(test.VM_OPTIONS_PATTERN, source, |
46 self.context.workspace) | 46 self.context.workspace) |
47 dart_options = utils.ParseTestOptions(test.DART_OPTIONS_PATTERN, source, | 47 dart_options = utils.ParseTestOptions(test.DART_OPTIONS_PATTERN, source, |
48 self.context.workspace) | 48 self.context.workspace) |
49 | 49 |
50 # Combine everything into a command array and return it. | 50 # Combine everything into a command array and return it. |
51 command = self.context.GetDart(self.mode, self.arch) | 51 command = self.context.GetDart(self.mode, self.arch) |
52 command += self.context.flags | 52 command += self.context.flags |
| 53 if self.mode == 'release': command += ['--optimize'] |
53 if vm_options: command += vm_options | 54 if vm_options: command += vm_options |
54 if dart_options: command += dart_options | 55 if dart_options: command += dart_options |
55 else: | 56 else: |
56 command += [self.filename] | 57 command += [self.filename] |
57 return command | 58 return command |
58 | 59 |
59 def GetName(self): | 60 def GetName(self): |
60 return self.path[-1] | 61 return self.path[-1] |
61 | 62 |
62 def GetPath(self): | 63 def GetPath(self): |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 patterns[idx : idx] = ['*'] * (len(file) - len(path)) | 141 patterns[idx : idx] = ['*'] * (len(file) - len(path)) |
141 path = [test.Pattern(p) for p in patterns] | 142 path = [test.Pattern(p) for p in patterns] |
142 | 143 |
143 for i in xrange(len(path)): | 144 for i in xrange(len(path)): |
144 if not path[i].match(file[i]): | 145 if not path[i].match(file[i]): |
145 return False | 146 return False |
146 return True | 147 return True |
147 | 148 |
148 def GetConfiguration(context, root): | 149 def GetConfiguration(context, root): |
149 return Co19TestConfiguration(context, root) | 150 return Co19TestConfiguration(context, root) |
OLD | NEW |