| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 111 # This needs to be kept in sync with the cmd line options for isolate.py |
| 112 # in src/build/isolate.gypi. | 112 # in src/build/isolate.gypi. |
| 113 isolate_cmd = [ | 113 isolate_cmd = [ |
| 114 'python', _ISOLATE_SCRIPT, | 114 'python', _ISOLATE_SCRIPT, |
| 115 'remap', | 115 'remap', |
| 116 '--isolate', isolate_abs_path, | 116 '--isolate', isolate_abs_path, |
| 117 '--isolated', isolated_abs_path, | 117 '--isolated', isolated_abs_path, |
| 118 '--outdir', constants.ISOLATE_DEPS_DIR, |
| 119 |
| 118 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), | 120 '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), |
| 121 |
| 119 '--config-variable', 'OS', 'android', | 122 '--config-variable', 'OS', 'android', |
| 123 '--config-variable', 'component', 'static_library', |
| 120 '--config-variable', 'icu_use_data_file_flag', '0', | 124 '--config-variable', 'icu_use_data_file_flag', '0', |
| 121 '--outdir', constants.ISOLATE_DEPS_DIR, | 125 '--config-variable', 'use_openssl', '0', |
| 122 ] | 126 ] |
| 123 assert not cmd_helper.RunCmd(isolate_cmd) | 127 assert not cmd_helper.RunCmd(isolate_cmd) |
| 124 | 128 |
| 125 # We're relying on the fact that timestamps are preserved | 129 # We're relying on the fact that timestamps are preserved |
| 126 # by the remap command (hardlinked). Otherwise, all the data | 130 # by the remap command (hardlinked). Otherwise, all the data |
| 127 # will be pushed to the device once we move to using time diff | 131 # will be pushed to the device once we move to using time diff |
| 128 # instead of md5sum. Perform a sanity check here. | 132 # instead of md5sum. Perform a sanity check here. |
| 129 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): | 133 for root, _, filenames in os.walk(constants.ISOLATE_DEPS_DIR): |
| 130 if filenames: | 134 if filenames: |
| 131 linked_file = os.path.join(root, filenames[0]) | 135 linked_file = os.path.join(root, filenames[0]) |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 if test_options.gtest_filter: | 314 if test_options.gtest_filter: |
| 311 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) | 315 tests = unittest_util.FilterTestNames(tests, test_options.gtest_filter) |
| 312 | 316 |
| 313 # Coalesce unit tests into a single test per device | 317 # Coalesce unit tests into a single test per device |
| 314 if test_options.suite_name != 'content_browsertests': | 318 if test_options.suite_name != 'content_browsertests': |
| 315 num_devices = len(devices) | 319 num_devices = len(devices) |
| 316 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] | 320 tests = [':'.join(tests[i::num_devices]) for i in xrange(num_devices)] |
| 317 tests = [t for t in tests if t] | 321 tests = [t for t in tests if t] |
| 318 | 322 |
| 319 return (TestRunnerFactory, tests) | 323 return (TestRunnerFactory, tests) |
| OLD | NEW |