| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 def GetTestStatus(self, sections, defs): | 111 def GetTestStatus(self, sections, defs): |
| 112 status = join(self.root, "co19-runtime.status") | 112 status = join(self.root, "co19-runtime.status") |
| 113 if exists(status): | 113 if exists(status): |
| 114 test.ReadConfigurationInto(status, sections, defs) | 114 test.ReadConfigurationInto(status, sections, defs) |
| 115 status = join(self.root, "co19-compiler.status") | 115 status = join(self.root, "co19-compiler.status") |
| 116 if exists(status): | 116 if exists(status): |
| 117 test.ReadConfigurationInto(status, sections, defs) | 117 test.ReadConfigurationInto(status, sections, defs) |
| 118 status = join(self.root, "co19-frog.status") | 118 status = join(self.root, "co19-frog.status") |
| 119 if exists(status): | 119 if exists(status): |
| 120 test.ReadConfigurationInto(status, sections, defs) | 120 test.ReadConfigurationInto(status, sections, defs) |
| 121 status = join(self.root, "co19-leg.status") |
| 122 if exists(status): |
| 123 test.ReadConfigurationInto(status, sections, defs) |
| 121 | 124 |
| 122 def Contains(self, path, file): | 125 def Contains(self, path, file): |
| 123 """ reimplemented for support '**' glob pattern """ | 126 """ reimplemented for support '**' glob pattern """ |
| 124 if len(path) > len(file): | 127 if len(path) > len(file): |
| 125 return | 128 return |
| 126 # ** matches to any number of directories, a/**/d matches a/b/c/d | 129 # ** matches to any number of directories, a/**/d matches a/b/c/d |
| 127 # paths like a/**/x/**/b not allowed | 130 # paths like a/**/x/**/b not allowed |
| 128 patterns = [p.pattern for p in path] | 131 patterns = [p.pattern for p in path] |
| 129 if '**' in patterns: | 132 if '**' in patterns: |
| 130 idx = patterns.index('**') | 133 idx = patterns.index('**') |
| 131 patterns[idx : idx] = ['*'] * (len(file) - len(path)) | 134 patterns[idx : idx] = ['*'] * (len(file) - len(path)) |
| 132 path = [test.Pattern(p) for p in patterns] | 135 path = [test.Pattern(p) for p in patterns] |
| 133 | 136 |
| 134 for i in xrange(len(path)): | 137 for i in xrange(len(path)): |
| 135 if not path[i].match(file[i]): | 138 if not path[i].match(file[i]): |
| 136 return False | 139 return False |
| 137 return True | 140 return True |
| 138 | 141 |
| 139 def GetConfiguration(context, root): | 142 def GetConfiguration(context, root): |
| 140 return Co19TestConfiguration(context, root) | 143 return Co19TestConfiguration(context, root) |
| OLD | NEW |