OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # chrome_tests.py | 6 # chrome_tests.py |
7 | 7 |
8 ''' Runs various chrome tests through valgrind_test.py.''' | 8 ''' Runs various chrome tests through valgrind_test.py.''' |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 os.path.join(directory, name + ".gtest-%s_%s.txt" % \ | 173 os.path.join(directory, name + ".gtest-%s_%s.txt" % \ |
174 (self._options.valgrind_tool, platform_suffix))] | 174 (self._options.valgrind_tool, platform_suffix))] |
175 for filename in gtest_filter_files: | 175 for filename in gtest_filter_files: |
176 if os.path.exists(filename): | 176 if os.path.exists(filename): |
177 logging.info("reading gtest filters from %s" % filename) | 177 logging.info("reading gtest filters from %s" % filename) |
178 f = open(filename, 'r') | 178 f = open(filename, 'r') |
179 for line in f.readlines(): | 179 for line in f.readlines(): |
180 if line.startswith("#") or line.startswith("//") or line.isspace(): | 180 if line.startswith("#") or line.startswith("//") or line.isspace(): |
181 continue | 181 continue |
182 line = line.rstrip() | 182 line = line.rstrip() |
| 183 test_prefixes = ["FLAKY", "FAILS"] |
| 184 for p in test_prefixes: |
| 185 # Strip prefixes from the test names. |
| 186 line = line.replace(".%s_" % p, ".") |
| 187 # Exclude the original test name. |
183 filters.append(line) | 188 filters.append(line) |
| 189 if line[-2:] != ".*": |
| 190 # List all possible prefixes if line doesn't end with ".*". |
| 191 for p in test_prefixes: |
| 192 filters.append(line.replace(".", ".%s_" % p)) |
| 193 # Get rid of duplicates. |
| 194 filters = set(filters) |
184 gtest_filter = self._gtest_filter | 195 gtest_filter = self._gtest_filter |
185 if len(filters): | 196 if len(filters): |
186 if gtest_filter: | 197 if gtest_filter: |
187 gtest_filter += ":" | 198 gtest_filter += ":" |
188 if gtest_filter.find("-") < 0: | 199 if gtest_filter.find("-") < 0: |
189 gtest_filter += "-" | 200 gtest_filter += "-" |
190 else: | 201 else: |
191 gtest_filter = "-" | 202 gtest_filter = "-" |
192 gtest_filter += ":".join(filters) | 203 gtest_filter += ":".join(filters) |
193 if gtest_filter: | 204 if gtest_filter: |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 for t in options.test: | 440 for t in options.test: |
430 tests = ChromeTests(options, args, t) | 441 tests = ChromeTests(options, args, t) |
431 ret = tests.Run() | 442 ret = tests.Run() |
432 if ret: return ret | 443 if ret: return ret |
433 return 0 | 444 return 0 |
434 | 445 |
435 | 446 |
436 if __name__ == "__main__": | 447 if __name__ == "__main__": |
437 ret = _main(sys.argv) | 448 ret = _main(sys.argv) |
438 sys.exit(ret) | 449 sys.exit(ret) |
OLD | NEW |