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 isolate_cmd = [ | 111 isolate_cmd = [ |
M-A Ruel
2014/01/15 20:40:47
While at it, can you add a comment at the top stat
jungshik at Google
2014/01/15 23:14:15
Done.
| |
112 'python', _ISOLATE_SCRIPT, | 112 'python', _ISOLATE_SCRIPT, |
113 'remap', | 113 'remap', |
114 '--isolate', isolate_abs_path, | 114 '--isolate', isolate_abs_path, |
115 '--isolated', isolated_abs_path, | 115 '--isolated', isolated_abs_path, |
116 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), | 116 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), |
117 '--config-variable', 'OS', 'android', | 117 '--config-variable', 'OS', 'android', |
118 '--config-variable', 'icu_use_data_file_flag', 0, | |
118 '--outdir', constants.ISOLATE_DEPS_DIR, | 119 '--outdir', constants.ISOLATE_DEPS_DIR, |
119 ] | 120 ] |
120 assert not cmd_helper.RunCmd(isolate_cmd) | 121 assert not cmd_helper.RunCmd(isolate_cmd) |
121 | 122 |
122 # We're relying on the fact that timestamps are preserved | 123 # We're relying on the fact that timestamps are preserved |
123 # by the remap command (hardlinked). Otherwise, all the data | 124 # by the remap command (hardlinked). Otherwise, all the data |
124 # will be pushed to the device once we move to using time diff | 125 # will be pushed to the device once we move to using time diff |
125 # instead of md5sum. Perform a sanity check here. | 126 # instead of md5sum. Perform a sanity check here. |
126 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): | 127 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): |
127 if filenames: | 128 if filenames: |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 if test_options.gtest_filter: | 308 if test_options.gtest_filter: |
308 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 309 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
309 | 310 |
310 # Coalesce unit tests into a single test per device | 311 # Coalesce unit tests into a single test per device |
311 if test_options.suite_name != 'content_browsertests': | 312 if test_options.suite_name != 'content_browsertests': |
312 num_devices = len(devices) | 313 num_devices = len(devices) |
313 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 314 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
314 tests = [t for t in tests if t] | 315 tests = [t for t in tests if t] |
315 | 316 |
316 return (TestRunnerFactory, tests) | 317 return (TestRunnerFactory, tests) |
OLD | NEW |