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 Testconfiguration subclasses used to define a class of tests.""" | 5 """Common Testconfiguration subclasses used to define a class of tests.""" |
6 | 6 |
7 import atexit | 7 import atexit |
8 import fileinput | 8 import fileinput |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 status = os.path.join(self.root, os.path.basename(self.root) + '.status') | 129 status = os.path.join(self.root, os.path.basename(self.root) + '.status') |
130 if os.path.exists(status): | 130 if os.path.exists(status): |
131 test.ReadConfigurationInto(status, sections, defs) | 131 test.ReadConfigurationInto(status, sections, defs) |
132 | 132 |
133 def FindReferencedFiles(self, lines): | 133 def FindReferencedFiles(self, lines): |
134 """Scours the lines containing source code for include directives.""" | 134 """Scours the lines containing source code for include directives.""" |
135 referenced_files = [] | 135 referenced_files = [] |
136 for line in lines: | 136 for line in lines: |
137 m = re.match("#(source|import)\(['\"](.*)['\"]\);", line) | 137 m = re.match("#(source|import)\(['\"](.*)['\"]\);", line) |
138 if m: | 138 if m: |
139 referenced_files.append(m.group(2)) | 139 file_name = m.group(2) |
| 140 if not file_name.startswith('dart:'): |
| 141 referenced_files.append(file_name) |
140 return referenced_files | 142 return referenced_files |
141 | 143 |
142 def SplitMultiTest(self, test_path, filename): | 144 def SplitMultiTest(self, test_path, filename): |
143 """Takes a file with multiple test case defined. | 145 """Takes a file with multiple test case defined. |
144 | 146 |
145 Splits the file into multiple TestCase instances. | 147 Splits the file into multiple TestCase instances. |
146 | 148 |
147 Args: | 149 Args: |
148 test_path: temporary dir to write split test case data. | 150 test_path: temporary dir to write split test case data. |
149 filename: name of the file to split. | 151 filename: name of the file to split. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 298 |
297 def GetTestStatus(self, sections, defs): | 299 def GetTestStatus(self, sections, defs): |
298 status = os.path.join(self.root, 'dartc.status') | 300 status = os.path.join(self.root, 'dartc.status') |
299 if os.path.exists(status): | 301 if os.path.exists(status): |
300 test.ReadConfigurationInto(status, sections, defs) | 302 test.ReadConfigurationInto(status, sections, defs) |
301 | 303 |
302 def _Cleanup(self, tests): | 304 def _Cleanup(self, tests): |
303 if not utils.Daemonize(): return | 305 if not utils.Daemonize(): return |
304 os.execlp('rm', *(['rm', '-rf'] + [t.temp_dir for t in tests])) | 306 os.execlp('rm', *(['rm', '-rf'] + [t.temp_dir for t in tests])) |
305 raise | 307 raise |
OLD | NEW |