| 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 import os | 5 import os |
| 6 import re | 6 import re |
| 7 import shutil | 7 import shutil |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 class DartStubTestConfiguration(test_configuration.StandardTestConfiguration): | 81 class DartStubTestConfiguration(test_configuration.StandardTestConfiguration): |
| 82 def __init__(self, context, root): | 82 def __init__(self, context, root): |
| 83 super(DartStubTestConfiguration, self).__init__(context, root) | 83 super(DartStubTestConfiguration, self).__init__(context, root) |
| 84 | 84 |
| 85 def ListTests(self, current_path, path, mode, arch): | 85 def ListTests(self, current_path, path, mode, arch): |
| 86 dartc = self.context.GetDartC(mode, 'dartc') | 86 dartc = self.context.GetDartC(mode, 'dartc') |
| 87 self.context.generate = os.access(dartc[0], os.X_OK) | 87 self.context.generate = os.access(dartc[0], os.X_OK) |
| 88 tests = [] | 88 tests = [] |
| 89 for root, dirs, files in os.walk(join(self.root, 'src')): | 89 for root, dirs, files in os.walk(join(self.root, 'src')): |
| 90 # Skip remnants from the subdirectory that used to be used for |
| 91 # generated code. |
| 92 if root.endswith('generated'): |
| 93 continue |
| 90 for f in [x for x in files if self.IsTest(x)]: | 94 for f in [x for x in files if self.IsTest(x)]: |
| 91 # If we can generate code, do not use the checked-in generated | 95 # If we can generate code, do not use the checked-in generated |
| 92 # code. Conversely, if we cannot, then only use the | 96 # code. Conversely, if we cannot, then only use the |
| 93 # checked-in generated code. | 97 # checked-in generated code. |
| 94 if self.context.generate == f.endswith('-generatedTest.dart'): | 98 if self.context.generate == f.endswith('-generatedTest.dart'): |
| 95 continue | 99 continue |
| 96 test_path = current_path + [ f[:-5] ] # Remove .dart suffix. | 100 test_path = current_path + [ f[:-5] ] # Remove .dart suffix. |
| 97 if not self.Contains(path, test_path): | 101 if not self.Contains(path, test_path): |
| 98 continue | 102 continue |
| 99 tests.append(DartStubTestCase(self.context, | 103 tests.append(DartStubTestCase(self.context, |
| 100 test_path, | 104 test_path, |
| 101 join(root, f), | 105 join(root, f), |
| 102 mode, | 106 mode, |
| 103 arch)) | 107 arch)) |
| 104 return tests | 108 return tests |
| 105 | 109 |
| 106 | 110 |
| 107 def GetConfiguration(context, root): | 111 def GetConfiguration(context, root): |
| 108 return DartStubTestConfiguration(context, root) | 112 return DartStubTestConfiguration(context, root) |
| OLD | NEW |