Chromium Code Reviews| Index: build/android/pylib/gtest/setup.py |
| diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py |
| index 3206bda67cb6dad8a2bc82f786944eceed00c75a..2d9c5756449c0afe0d6a5c1a1a8002ff6c0d3acf 100644 |
| --- a/build/android/pylib/gtest/setup.py |
| +++ b/build/android/pylib/gtest/setup.py |
| @@ -10,15 +10,14 @@ import os |
| import sys |
| from pylib import constants |
| -from pylib import valgrind_tools |
| +from pylib.base import base_setup |
| from pylib.base import base_test_result |
| from pylib.base import test_dispatcher |
| from pylib.device import device_utils |
| from pylib.gtest import test_package_apk |
| from pylib.gtest import test_package_exe |
| from pylib.gtest import test_runner |
| -from pylib.utils import isolator |
| sys.path.insert(0, |
| os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', |
| @@ -26,7 +25,7 @@ sys.path.insert(0, |
| import unittest_util # pylint: disable=F0401 |
| -_ISOLATE_FILE_PATHS = { |
| +ISOLATE_FILE_PATHS = { |
| 'base_unittests': 'base/base_unittests.isolate', |
| 'blink_heap_unittests': |
| 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate', |
| @@ -49,7 +48,7 @@ _ISOLATE_FILE_PATHS = { |
| # Used for filtering large data deps at a finer grain than what's allowed in |
| # isolate files since pushing deps to devices is expensive. |
| # Wildcards are allowed. |
| -_DEPS_EXCLUSION_LIST = [ |
| +DEPS_EXCLUSION_LIST = [ |
| 'chrome/test/data/extensions/api_test', |
| 'chrome/test/data/extensions/secure_shell', |
| 'chrome/test/data/firefox*', |
| @@ -69,43 +68,6 @@ _DEPS_EXCLUSION_LIST = [ |
| ] |
| -def _GenerateDepsDirUsingIsolate(suite_name, isolate_file_path=None): |
| - """Generate the dependency dir for the test suite using isolate. |
| - |
| - Args: |
| - suite_name: Name of the test suite (e.g. base_unittests). |
| - isolate_file_path: .isolate file path to use. If there is a default .isolate |
| - file path for the suite_name, this will override it. |
| - """ |
| - if isolate_file_path: |
| - if os.path.isabs(isolate_file_path): |
| - isolate_abs_path = isolate_file_path |
| - else: |
| - isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, |
| - isolate_file_path) |
| - else: |
| - isolate_rel_path = _ISOLATE_FILE_PATHS.get(suite_name) |
| - if not isolate_rel_path: |
| - logging.info('Did not find an isolate file for the test suite.') |
| - return |
| - isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) |
| - |
| - isolated_abs_path = os.path.join( |
| - constants.GetOutDirectory(), '%s.isolated' % suite_name) |
| - assert os.path.exists(isolate_abs_path), 'Cannot find %s' % isolate_abs_path |
| - |
| - i = isolator.Isolator(constants.ISOLATE_DEPS_DIR) |
| - i.Clear() |
| - i.Remap(isolate_abs_path, isolated_abs_path) |
| - # We're relying on the fact that timestamps are preserved |
| - # by the remap command (hardlinked). Otherwise, all the data |
| - # will be pushed to the device once we move to using time diff |
| - # instead of md5sum. Perform a sanity check here. |
| - i.VerifyHardlinks() |
| - i.PurgeExcluded(_DEPS_EXCLUSION_LIST) |
| - i.MoveOutputDeps() |
| - |
| - |
| def _GetDisabledTestsFilterFromFile(suite_name): |
| """Returns a gtest filter based on the *_disabled file. |
| @@ -219,19 +181,6 @@ def _FilterDisabledTests(tests, suite_name, has_gtest_filter): |
| return tests |
| -def PushDataDeps(device, test_options, test_package): |
| - valgrind_tools.PushFilesForTool(test_options.tool, device) |
| - if os.path.exists(constants.ISOLATE_DEPS_DIR): |
| - device_dir = ( |
| - constants.TEST_EXECUTABLE_DIR |
| - if test_package.suite_name == 'breakpad_unittests' |
| - else device.GetExternalStoragePath()) |
| - device.PushChangedFiles([ |
| - (os.path.join(constants.ISOLATE_DEPS_DIR, p), |
| - '%s/%s' % (device_dir, p)) |
| - for p in os.listdir(constants.ISOLATE_DEPS_DIR)]) |
| - |
| - |
| def Setup(test_options, devices): |
| """Create the test runner factory and tests. |
| @@ -256,11 +205,16 @@ def Setup(test_options, devices): |
| test_package = exe_test_package |
| logging.warning('Found target %s', test_package.suite_path) |
| - _GenerateDepsDirUsingIsolate(test_options.suite_name, |
| - test_options.isolate_file_path) |
| - |
| - device_utils.DeviceUtils.parallel(devices).pMap( |
| - PushDataDeps, test_options, test_package) |
| + base_setup.GenerateDepsDirUsingIsolate(test_options.suite_name, |
| + test_options.isolate_file_path, |
| + ISOLATE_FILE_PATHS, |
| + DEPS_EXCLUSION_LIST) |
| + def PushDataDepsToDeviceDir(device): |
|
jbudorick
2014/11/11 16:31:47
nit: I've been moving toward naming local function
mikecase (-- gone --)
2014/11/11 23:23:21
Done.
|
| + device_dir = (constants.TEST_EXECUTABLE_DIR |
| + if test_package.suite_name == 'breakpad_unittests' |
|
jbudorick
2014/11/11 16:31:47
nit: 4 space indent for continuation lines
mikecase (-- gone --)
2014/11/11 23:23:21
Done.
|
| + else device.GetExternalStoragePath()) |
| + base_setup.PushDataDeps(device, device_dir, test_options) |
| + device_utils.DeviceUtils.parallel(devices).pMap(PushDataDepsToDeviceDir) |
| tests = _GetTests(test_options, test_package, devices) |