Index: build/android/pylib/gtest/setup.py |
diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py |
index 097e283f800712d83f4ba64a89a562030c1a1a52..4c767787511089f1ee8042f8925a93fd1b828a7a 100644 |
--- a/build/android/pylib/gtest/setup.py |
+++ b/build/android/pylib/gtest/setup.py |
@@ -92,21 +92,30 @@ _ISOLATE_SCRIPT = os.path.join( |
constants.DIR_SOURCE_ROOT, 'tools', 'swarming_client', 'isolate.py') |
-def _GenerateDepsDirUsingIsolate(suite_name): |
+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 os.path.isdir(constants.ISOLATE_DEPS_DIR): |
shutil.rmtree(constants.ISOLATE_DEPS_DIR) |
- 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 |
+ 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) |
- 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) |
@@ -309,7 +318,8 @@ def Setup(test_options, devices): |
% test_options.suite_name) |
logging.warning('Found target %s', test_package.suite_path) |
- _GenerateDepsDirUsingIsolate(test_options.suite_name) |
+ _GenerateDepsDirUsingIsolate(test_options.suite_name, |
+ test_options.isolate_file_path) |
tests = _GetTests(test_options, test_package, devices) |