Generate Android .isolate files used for test()s

Tests use write_runtime_deps to have GN write out all runtime_deps, then
use a new script "generate_isolate.py" to filter the files and create a
.isolate.

TBR=vollick
BUG=589318
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1904823003

Cr-Original-Commit-Position: refs/heads/master@{#389105}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 964da0f3923afb10a52dfe81484d7f3dcb18bad6
This commit is contained in:
agrieve 2016-04-22 07:57:00 -07:00 коммит произвёл Commit bot
Родитель 67c6b5c0c1
Коммит 7b6cac068b
4 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -12,6 +12,7 @@ from pylib import constants
from pylib.constants import host_paths
from pylib.base import base_test_result
from pylib.base import test_instance
from pylib.utils import isolator
with host_paths.SysPath(host_paths.BUILD_COMMON_PATH):
import unittest_util # pylint: disable=import-error
@ -196,7 +197,8 @@ class GtestTestInstance(test_instance.TestInstance):
args.isolate_file_path = os.path.join(
host_paths.DIR_SOURCE_ROOT, default_isolate_file_path)
if args.isolate_file_path:
if (args.isolate_file_path and
not isolator.IsIsolateEmpty(args.isolate_file_path)):
self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
self._isolate_delegate = isolate_delegate
self._isolated_abs_path = os.path.join(

Просмотреть файл

@ -17,6 +17,7 @@ from pylib.base import test_instance
from pylib.constants import host_paths
from pylib.instrumentation import test_result
from pylib.instrumentation import instrumentation_parser
from pylib.utils import isolator
from pylib.utils import proguard
with host_paths.SysPath(host_paths.BUILD_COMMON_PATH):
@ -292,7 +293,8 @@ class InstrumentationTestInstance(test_instance.TestInstance):
def _initializeDataDependencyAttributes(self, args, isolate_delegate):
self._data_deps = []
if args.isolate_file_path:
if (args.isolate_file_path and
not isolator.IsIsolateEmpty(args.isolate_file_path)):
if os.path.isabs(args.isolate_file_path):
self._isolate_abs_path = args.isolate_file_path
else:

Просмотреть файл

@ -54,6 +54,12 @@ def DefaultConfigVariables():
}
def IsIsolateEmpty(isolate_path):
"""Returns whether there are no files in the .isolate."""
with open(isolate_path) as f:
return "'files': []" in f.read()
class Isolator(object):
"""Manages calls to isolate.py for the android test runner scripts."""

Просмотреть файл

@ -2095,6 +2095,7 @@ template("test_runner_script") {
depfile = "$target_gen_dir/$target_name.d"
data_deps += [ "//build/android:test_runner_py" ]
data = []
test_runner_args = [
_test_type,
@ -2179,6 +2180,7 @@ template("test_runner_script") {
}
}
if (defined(invoker.isolate_file)) {
data += [ invoker.isolate_file ]
test_runner_args += [
"--isolate-file-path",
rebase_path(invoker.isolate_file, root_build_dir),
@ -2209,9 +2211,7 @@ template("test_runner_script") {
depfile,
generated_script,
]
data = [
generated_script,
]
data += [ generated_script ]
args = [
"--depfile",