OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Generates test runner factory and tests for GTests.""" | 5 """Generates test runner factory and tests for GTests.""" |
6 | 6 |
7 import fnmatch | 7 import fnmatch |
8 import glob | 8 import glob |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 isolate_rel_path = _ISOLATE_FILE_PATHS.get(suite_name) | 102 isolate_rel_path = _ISOLATE_FILE_PATHS.get(suite_name) |
103 if not isolate_rel_path: | 103 if not isolate_rel_path: |
104 logging.info('Did not find an isolate file for the test suite.') | 104 logging.info('Did not find an isolate file for the test suite.') |
105 return | 105 return |
106 | 106 |
107 isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) | 107 isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) |
108 isolated_abs_path = os.path.join( | 108 isolated_abs_path = os.path.join( |
109 constants.GetOutDirectory(), '%s.isolated' % suite_name) | 109 constants.GetOutDirectory(), '%s.isolated' % suite_name) |
110 assert os.path.exists(isolate_abs_path) | 110 assert os.path.exists(isolate_abs_path) |
| 111 # This needs to be kept in sync with the cmd line options for isolate.py |
| 112 # in src/build/isolate.gypi. |
111 isolate_cmd = [ | 113 isolate_cmd = [ |
112 'python', _ISOLATE_SCRIPT, | 114 'python', _ISOLATE_SCRIPT, |
113 'remap', | 115 'remap', |
114 '--isolate', isolate_abs_path, | 116 '--isolate', isolate_abs_path, |
115 '--isolated', isolated_abs_path, | 117 '--isolated', isolated_abs_path, |
116 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), | 118 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), |
117 '--config-variable', 'OS', 'android', | 119 '--config-variable', 'OS', 'android', |
| 120 '--config-variable', 'icu_use_data_file_flag', '0', |
118 '--outdir', constants.ISOLATE_DEPS_DIR, | 121 '--outdir', constants.ISOLATE_DEPS_DIR, |
119 ] | 122 ] |
120 assert not cmd_helper.RunCmd(isolate_cmd) | 123 assert not cmd_helper.RunCmd(isolate_cmd) |
121 | 124 |
122 # We're relying on the fact that timestamps are preserved | 125 # We're relying on the fact that timestamps are preserved |
123 # by the remap command (hardlinked). Otherwise, all the data | 126 # by the remap command (hardlinked). Otherwise, all the data |
124 # will be pushed to the device once we move to using time diff | 127 # will be pushed to the device once we move to using time diff |
125 # instead of md5sum. Perform a sanity check here. | 128 # instead of md5sum. Perform a sanity check here. |
126 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): | 129 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): |
127 if filenames: | 130 if filenames: |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 if test_options.gtest_filter: | 310 if test_options.gtest_filter: |
308 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 311 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
309 | 312 |
310 # Coalesce unit tests into a single test per device | 313 # Coalesce unit tests into a single test per device |
311 if test_options.suite_name != 'content_browsertests': | 314 if test_options.suite_name != 'content_browsertests': |
312 num_devices = len(devices) | 315 num_devices = len(devices) |
313 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 316 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
314 tests = [t for t in tests if t] | 317 tests = [t for t in tests if t] |
315 | 318 |
316 return (TestRunnerFactory, tests) | 319 return (TestRunnerFactory, tests) |
OLD | NEW |