| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import shutil | 8 import shutil |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 self._exe_path = os.path.join(constants.GetOutDirectory(), | 104 self._exe_path = os.path.join(constants.GetOutDirectory(), |
| 105 self._suite) | 105 self._suite) |
| 106 if not os.path.exists(self._apk_path): | 106 if not os.path.exists(self._apk_path): |
| 107 self._apk_path = None | 107 self._apk_path = None |
| 108 if not os.path.exists(self._exe_path): | 108 if not os.path.exists(self._exe_path): |
| 109 self._exe_path = None | 109 self._exe_path = None |
| 110 if not self._apk_path and not self._exe_path: | 110 if not self._apk_path and not self._exe_path: |
| 111 error_func('Could not find apk or executable for %s' % self._suite) | 111 error_func('Could not find apk or executable for %s' % self._suite) |
| 112 | 112 |
| 113 self._data_deps = [] | 113 self._data_deps = [] |
| 114 self._gtest_filter = args.test_filter | 114 if args.test_filter: |
| 115 self._gtest_filter = args.test_filter |
| 116 elif args.test_filter_file: |
| 117 with open(args.test_filter_file, 'r') as f: |
| 118 self._gtest_filter = ':'.join(l.strip() for l in f) |
| 119 else: |
| 120 self._gtest_filter = None |
| 115 if args.isolate_file_path: | 121 if args.isolate_file_path: |
| 116 self._isolate_abs_path = os.path.abspath(args.isolate_file_path) | 122 self._isolate_abs_path = os.path.abspath(args.isolate_file_path) |
| 117 self._isolate_delegate = isolate_delegate | 123 self._isolate_delegate = isolate_delegate |
| 118 self._isolated_abs_path = os.path.join( | 124 self._isolated_abs_path = os.path.join( |
| 119 constants.GetOutDirectory(), '%s.isolated' % self._suite) | 125 constants.GetOutDirectory(), '%s.isolated' % self._suite) |
| 120 else: | 126 else: |
| 121 logging.warning('No isolate file provided. No data deps will be pushed.'); | 127 logging.warning('No isolate file provided. No data deps will be pushed.'); |
| 122 self._isolate_delegate = None | 128 self._isolate_delegate = None |
| 123 | 129 |
| 124 #override | 130 #override |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 Returns: | 164 Returns: |
| 159 A filtered list of tests to run. | 165 A filtered list of tests to run. |
| 160 """ | 166 """ |
| 161 gtest_filter_strings = [ | 167 gtest_filter_strings = [ |
| 162 self._GenerateDisabledFilterString(disabled_prefixes)] | 168 self._GenerateDisabledFilterString(disabled_prefixes)] |
| 163 if self._gtest_filter: | 169 if self._gtest_filter: |
| 164 gtest_filter_strings.append(self._gtest_filter) | 170 gtest_filter_strings.append(self._gtest_filter) |
| 165 | 171 |
| 166 filtered_test_list = test_list | 172 filtered_test_list = test_list |
| 167 for gtest_filter_string in gtest_filter_strings: | 173 for gtest_filter_string in gtest_filter_strings: |
| 174 logging.debug('Filtering tests using: %s', gtest_filter_string) |
| 168 filtered_test_list = unittest_util.FilterTestNames( | 175 filtered_test_list = unittest_util.FilterTestNames( |
| 169 filtered_test_list, gtest_filter_string) | 176 filtered_test_list, gtest_filter_string) |
| 170 return filtered_test_list | 177 return filtered_test_list |
| 171 | 178 |
| 172 def _GenerateDisabledFilterString(self, disabled_prefixes): | 179 def _GenerateDisabledFilterString(self, disabled_prefixes): |
| 173 disabled_filter_items = [] | 180 disabled_filter_items = [] |
| 174 | 181 |
| 175 if disabled_prefixes is None: | 182 if disabled_prefixes is None: |
| 176 disabled_prefixes = ['DISABLED_', 'FLAKY_', 'FAILS_', 'PRE_', 'MANUAL_'] | 183 disabled_prefixes = ['DISABLED_', 'FLAKY_', 'FAILS_', 'PRE_', 'MANUAL_'] |
| 177 disabled_filter_items += ['%s*' % dp for dp in disabled_prefixes] | 184 disabled_filter_items += ['%s*' % dp for dp in disabled_prefixes] |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 return self._apk_path | 232 return self._apk_path |
| 226 | 233 |
| 227 @property | 234 @property |
| 228 def exe(self): | 235 def exe(self): |
| 229 return self._exe_path | 236 return self._exe_path |
| 230 | 237 |
| 231 @property | 238 @property |
| 232 def suite(self): | 239 def suite(self): |
| 233 return self._suite | 240 return self._suite |
| 234 | 241 |
| OLD | NEW |