Skip to content

Commit

Permalink
[base] Relocate isolate support inclusion to test.gni.
Browse files Browse the repository at this point in the history
Moves the data dependency on testing:test_scripts_shared to
the platform-specific implementations of the test() template.

Previously, //base:test_support was including test_scripts_shared,
which caused the Python scripts to be bundled in Android APKs and
Fuchsia FAR files *in addition* to isolated data.

Bug: 1293574
Change-Id: I61783e278c3f537ad56362ffdc1f22512baee6d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3481076
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Benoit Lize <lizeb@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#974217}
  • Loading branch information
Kevin Marshall authored and Chromium LUCI CQ committed Feb 23, 2022
1 parent 0f63cd5 commit 2352936
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
6 changes: 0 additions & 6 deletions base/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ static_library("test_support") {

configs += [ "//build/config:precompiled_headers" ]

data_deps = [
# The isolate needs this script for setting up the test. It's not actually
# needed to run this target locally.
"//testing:test_scripts_shared",
]

public_deps = [
":test_config",
"//base",
Expand Down
36 changes: 27 additions & 9 deletions testing/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ template("test") {
} else {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

if (tests_have_location_tags) {
data = [ "//testing/location_tags.json" ]
}
Expand Down Expand Up @@ -487,6 +490,8 @@ template("test") {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

# TODO(crbug.com/1199334): Because perfetto unit test is defined outside
# of chromium, the dependency to the filter file is added here.
data_deps += [ "//testing/buildbot/filters:perfetto_unittests_filters" ]
Expand Down Expand Up @@ -600,6 +605,8 @@ template("test") {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

# Include the generate_wrapper as part of data_deps
data_deps += [ ":${_wrapper_output_name}" ]
write_runtime_deps = _runtime_deps_file
Expand Down Expand Up @@ -667,10 +674,13 @@ template("test") {
data += [ _runtime_deps_file ]
deps += [ ":$_gen_runner_target" ]

if (!defined(data_deps)) {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

if (use_rts) {
if (!defined(data_deps)) {
data_deps = []
}
data_deps += [ ":${invoker.target_name}__rts_filters" ]
}
}
Expand Down Expand Up @@ -755,6 +765,8 @@ template("test") {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

write_runtime_deps = _runtime_deps_file
deps += [ ":$_gen_runner_target" ]
if (_use_ash_chrome && also_build_ash_chrome) {
Expand Down Expand Up @@ -837,10 +849,13 @@ template("test") {
write_runtime_deps = _runtime_deps_file
deps += [ ":$_gen_runner_target" ]

if (!defined(data_deps)) {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

if (use_rts) {
if (!defined(data_deps)) {
data_deps = []
}
data_deps += [ ":${invoker.target_name}__rts_filters" ]
}
}
Expand All @@ -858,10 +873,13 @@ template("test") {
deps = []
}

if (!defined(data_deps)) {
data_deps = []
}

data_deps += [ "//testing:test_scripts_shared" ]

if (use_rts) {
if (!defined(data_deps)) {
data_deps = []
}
data_deps += [ ":${invoker.target_name}__rts_filters" ]
}
}
Expand Down

0 comments on commit 2352936

Please sign in to comment.