Add lots of testonly annotations to the GN build.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/547793002
Cr-Commit-Position: refs/heads/master@{#293774}
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index a52394bc..fb546dc 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -165,6 +165,7 @@
}
static_library("test_support") {
+ testonly = true
sources = gypi_values.ash_test_support_sources
deps = [
@@ -198,6 +199,7 @@
}
static_library("ash_shell_lib") {
+ testonly = true
sources = gypi_values.ash_shell_lib_sources
deps = [
@@ -338,6 +340,7 @@
}
executable("ash_shell") {
+ testonly = true
sources = [
"shell/shell_main.cc",
]
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 5155e52c..440f9e6 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1014,6 +1014,7 @@
}
source_set("prefs_test_support") {
+ testonly = true
sources = [
"prefs/mock_pref_change_callback.cc",
"prefs/mock_pref_change_callback.h",
diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn
index e3312c2..8af0925 100644
--- a/base/test/BUILD.gn
+++ b/base/test/BUILD.gn
@@ -9,6 +9,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"expectations/expectation.cc",
"expectations/expectation.h",
@@ -134,6 +135,7 @@
}
source_set("test_support_perf") {
+ testonly = true
sources = [
"run_all_perftests.cc",
]
@@ -147,6 +149,7 @@
}
source_set("run_all_unittests") {
+ testonly = true
sources = [
"run_all_unittests.cc",
]
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 43a6c6da..4222804 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -495,6 +495,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"test/animation_test_common.cc",
"test/animation_test_common.h",
diff --git a/components/data_reduction_proxy/browser/BUILD.gn b/components/data_reduction_proxy/browser/BUILD.gn
index d00e084..c79a909 100644
--- a/components/data_reduction_proxy/browser/BUILD.gn
+++ b/components/data_reduction_proxy/browser/BUILD.gn
@@ -35,6 +35,7 @@
}
static_library("test_support") {
+ testonly = true
sources = [
"data_reduction_proxy_params_test_utils.cc",
"data_reduction_proxy_params_test_utils.h",
@@ -54,6 +55,7 @@
}
source_set("unit_tests") {
+ testonly = true
sources = [
"data_reduction_proxy_auth_request_handler_unittest.cc",
"data_reduction_proxy_config_service_unittest.cc",
diff --git a/components/proximity_auth/BUILD.gn b/components/proximity_auth/BUILD.gn
index 11818d9..09de32c 100644
--- a/components/proximity_auth/BUILD.gn
+++ b/components/proximity_auth/BUILD.gn
@@ -15,6 +15,7 @@
}
source_set("unit_tests") {
+ testonly = true
sources = [
"proximity_auth_system_unittest.cc",
]
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 8c372a9d..bad7f4d 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -20,6 +20,7 @@
}
static_library("content_shell_lib") {
+ testonly = true
sources = [
"android/shell_jni_registrar.cc",
"android/shell_jni_registrar.h",
@@ -428,6 +429,7 @@
}
executable("content_shell") {
+ testonly = true
# TODO(GYP) mac resource bundle stuff for this target.
# TODO(GYP) Windows content shell settings:
# - Manifest.
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 5de3754..6224b5f 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -14,6 +14,7 @@
# GYP version //content/content_tests.gypi:test_support_content
static_library("test_support") {
+ testonly = true
deps = [
"//content/public/app:both",
"//content/public/browser",
@@ -139,6 +140,7 @@
# GYP version //content/content_tests.gypi:layouttest_support_content
static_library("layouttest_support") {
+ testonly = true
sources = rebase_path(content_tests_gypi_values.layouttest_support_content_sources,
".", "//content")
diff --git a/dbus/BUILD.gn b/dbus/BUILD.gn
index a17f1f1..29b3859 100644
--- a/dbus/BUILD.gn
+++ b/dbus/BUILD.gn
@@ -55,6 +55,7 @@
# This target contains mocks that can be used to write unit tests without
# issuing actual D-Bus calls.
source_set("test_support") {
+ testonly = true
sources = [
"mock_bus.cc",
"mock_bus.h",
@@ -111,6 +112,7 @@
}
executable("dbus_test_server") {
+ testonly = true
sources = [
"test_server.cc",
"test_service.cc",
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn
index 7ef2e774..13e7a50 100644
--- a/extensions/BUILD.gn
+++ b/extensions/BUILD.gn
@@ -55,6 +55,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"browser/api/dns/mock_host_resolver_creator.cc",
"browser/api/dns/mock_host_resolver_creator.h",
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn
index 90ca8ff..a529d01 100644
--- a/google_apis/BUILD.gn
+++ b/google_apis/BUILD.gn
@@ -169,6 +169,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"gaia/fake_gaia.cc",
"gaia/fake_gaia.h",
diff --git a/google_apis/gcm/BUILD.gn b/google_apis/gcm/BUILD.gn
index cb6d043..d8542fe 100644
--- a/google_apis/gcm/BUILD.gn
+++ b/google_apis/gcm/BUILD.gn
@@ -67,6 +67,7 @@
}
static_library("test_support") {
+ testonly = true
sources = [
"base/fake_encryptor.cc",
"base/fake_encryptor.h",
@@ -89,6 +90,7 @@
# A standalone MCS (mobile connection server) client.
executable("mcs_probe") {
+ testonly = true
sources = [
"tools/mcs_probe.cc",
]
diff --git a/jingle/BUILD.gn b/jingle/BUILD.gn
index 00df14c..67e0105 100644
--- a/jingle/BUILD.gn
+++ b/jingle/BUILD.gn
@@ -108,6 +108,7 @@
# GYP version: jingle/jingle.gyp:jingle_unittests
# TODO(GYP): Convert to executable when its dependencies are linkable.
source_set("jingle_unittests") {
+ testonly = true
sources = [
"glue/channel_socket_adapter_unittest.cc",
"glue/chrome_async_socket_unittest.cc",
diff --git a/media/cast/BUILD.gn b/media/cast/BUILD.gn
index 1345cb0a..948e5a0 100644
--- a/media/cast/BUILD.gn
+++ b/media/cast/BUILD.gn
@@ -169,6 +169,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
# TODO(hclam): FFmpeg.
# "test/fake_media_source.cc",
@@ -283,6 +284,7 @@
}
executable("generate_barcode_video") {
+ testonly = true
sources = [
"test/utility/generate_barcode_video.cc",
]
@@ -295,6 +297,7 @@
}
executable("generate_timecode_audio") {
+ testonly = true
sources = [
"test/utility/generate_timecode_audio.cc",
]
@@ -307,6 +310,7 @@
}
executable("udp_proxy") {
+ testonly = true
sources = [
"test/utility/udp_proxy_main.cc",
]
diff --git a/mojo/common/test/BUILD.gn b/mojo/common/test/BUILD.gn
index a0df6d0..b63de6a 100644
--- a/mojo/common/test/BUILD.gn
+++ b/mojo/common/test/BUILD.gn
@@ -4,6 +4,7 @@
# GYP version: mojo/mojo_base.gyp:mojo_run_all_unittests
source_set("run_all_unittests") {
+ testonly = true
deps = [
":test_support_impl",
"//base",
@@ -18,6 +19,7 @@
# GYP version: mojo/mojo_base.gyp:mojo_test_support_impl
source_set("test_support_impl") {
+ testonly = true
deps = [
"//base",
]
@@ -30,6 +32,7 @@
# GYP version: mojo/mojo_base.gyp:mojo_common_test_support
source_set("test_support") {
+ testonly = true
deps = [
"//base",
"//base/test:test_support",
diff --git a/mojo/embedder/BUILD.gn b/mojo/embedder/BUILD.gn
index 04e3759..c763c38 100644
--- a/mojo/embedder/BUILD.gn
+++ b/mojo/embedder/BUILD.gn
@@ -53,6 +53,7 @@
source_set("embedder_unittests") {
visibility = [ "//mojo/system:mojo_system_unittests" ]
+ testonly = true
deps = [
"//base",
diff --git a/mojo/services/public/cpp/view_manager/lib/BUILD.gn b/mojo/services/public/cpp/view_manager/lib/BUILD.gn
index e2dc06b9..32f4f3d 100644
--- a/mojo/services/public/cpp/view_manager/lib/BUILD.gn
+++ b/mojo/services/public/cpp/view_manager/lib/BUILD.gn
@@ -6,6 +6,7 @@
# GYP version: mojo/mojo_services.gypi:mojo_view_manager_run_unittests
source_set("run_unittests") {
+ testonly = true
sources = [
"view_manager_test_suite.cc",
"view_manager_test_suite.h",
diff --git a/net/BUILD.gn b/net/BUILD.gn
index bc71f87..94da4dd 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -594,6 +594,7 @@
}
executable("dump_cache") {
+ testonly = true
sources = [
"tools/dump_cache/cache_dumper.cc",
"tools/dump_cache/cache_dumper.h",
@@ -618,6 +619,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"base/capturing_net_log.cc",
"base/capturing_net_log.h",
@@ -798,6 +800,7 @@
if (!is_ios && !is_android) {
executable("crash_cache") {
+ testonly = true
sources = [ "tools/crash_cache/crash_cache.cc" ]
configs += [ ":net_win_size_truncation" ]
deps = [
@@ -808,6 +811,7 @@
}
executable("crl_set_dump") {
+ testonly = true
sources = [ "tools/crl_set_dump/crl_set_dump.cc" ]
configs += [ ":net_win_size_truncation" ]
deps = [
@@ -817,6 +821,7 @@
}
executable("dns_fuzz_stub") {
+ testonly = true
sources = [ "tools/dns_fuzz_stub/dns_fuzz_stub.cc" ]
configs += [ ":net_win_size_truncation" ]
deps = [
@@ -826,6 +831,7 @@
}
executable("gdig") {
+ testonly = true
sources = [
"tools/gdig/file_net_log.cc",
"tools/gdig/gdig.cc",
@@ -837,6 +843,7 @@
}
executable("get_server_time") {
+ testonly = true
sources = [ "tools/get_server_time/get_server_time.cc" ]
configs += [ ":net_win_size_truncation" ]
deps = [
@@ -849,6 +856,7 @@
if (use_v8_in_net) {
executable("net_watcher") {
+ testonly = true
sources = [ "tools/net_watcher/net_watcher.cc" ]
deps = [
":net",
@@ -867,6 +875,7 @@
}
executable("run_testserver") {
+ testonly = true
sources = [ "tools/testserver/run_testserver.cc" ]
deps = [
":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
@@ -879,6 +888,7 @@
}
executable("stress_cache") {
+ testonly = true
sources = [ "disk_cache/blockfile/stress_cache.cc" ]
configs += [ ":net_win_size_truncation" ]
deps = [
@@ -912,6 +922,7 @@
}
static_library("flip_in_mem_edsm_server_base") {
+ testonly = true
sources = [
"tools/dump_cache/url_to_filename_encoder.cc",
"tools/dump_cache/url_to_filename_encoder.h",
@@ -955,6 +966,7 @@
}
executable("flip_in_mem_edsm_server_unittests") {
+ testonly = true
sources = [
"tools/flip_server/flip_test_utils.cc",
"tools/flip_server/flip_test_utils.h",
@@ -974,6 +986,7 @@
}
executable("flip_in_mem_edsm_server") {
+ testonly = true
sources = [ "tools/flip_server/flip_in_mem_edsm_server.cc" ]
deps = [
":flip_in_mem_edsm_server_base",
@@ -1062,6 +1075,7 @@
if (is_android || is_linux) {
executable("disk_cache_memory_test") {
+ testonly = true
sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ]
deps = [
":net",
diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn
index c51e252c..9fd6b82 100644
--- a/ppapi/BUILD.gn
+++ b/ppapi/BUILD.gn
@@ -786,6 +786,7 @@
}
static_library("ppapi_unittest_shared") {
+ testonly = true
sources = [
"proxy/ppapi_proxy_test.cc",
"proxy/ppapi_proxy_test.h",
diff --git a/rlz/BUILD.gn b/rlz/BUILD.gn
index a7e3991..7b76c73 100644
--- a/rlz/BUILD.gn
+++ b/rlz/BUILD.gn
@@ -76,6 +76,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"test/rlz_test_helpers.cc",
"test/rlz_test_helpers.h",
diff --git a/sync/BUILD.gn b/sync/BUILD.gn
index e25d63b..28b77b5 100644
--- a/sync/BUILD.gn
+++ b/sync/BUILD.gn
@@ -709,6 +709,7 @@
# GYP version: sync/sync_tests.gypi:test_support_sync_testserver
static_library("test_support_sync_testserver") {
+ testonly = true
sources = [
"test/local_sync_test_server.cc",
"test/local_sync_test_server.h",
@@ -730,6 +731,7 @@
# GYP version: sync/sync_tests.gypi:test_support_accounts_client
static_library("test_support_accounts_client") {
+ testonly = true
sources = [
"test/accounts_client/test_accounts_client.cc",
"test/accounts_client/test_accounts_client.h",
@@ -759,6 +761,7 @@
if (!is_ios) {
# GYP version: sync/sync_tests.gypi:run_sync_testserver
executable("run_sync_testserver") {
+ testonly = true
sources = [ "tools/testserver/run_sync_testserver.cc" ]
deps = [
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 10962d3..686cb28 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -142,6 +142,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"test/aura_test_base.cc",
"test/aura_test_base.h",
@@ -209,6 +210,8 @@
executable("demo") {
output_name = "aura_demo"
+ testonly = true
+
sources = [
"demo/demo_main.cc",
]
@@ -238,6 +241,8 @@
executable("bench") {
output_name = "aura_bench"
+ testonly = true
+
sources = [
"bench/bench_main.cc",
]
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 03ed5fc6..0f1fe557 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -78,6 +78,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"test/context_factories_for_test.cc",
"test/context_factories_for_test.h",
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 11d8a3e..bb0288f 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -364,6 +364,7 @@
# Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
source_set("test_support") {
+ testonly = true
sources = [
"test/fontconfig_util_linux.cc",
"test/fontconfig_util_linux.h",
diff --git a/ui/message_center/BUILD.gn b/ui/message_center/BUILD.gn
index 96315b5..536bcfc0 100644
--- a/ui/message_center/BUILD.gn
+++ b/ui/message_center/BUILD.gn
@@ -147,6 +147,7 @@
}
static_library("test_support") {
+ testonly = true
sources = [
"fake_message_center.h",
"fake_message_center.cc",
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index d4cf745..a3f3311 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -104,6 +104,7 @@
}
static_library("test_support") {
+ testonly = true
sources = gypi_values.views_test_support_sources
deps = [
diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn
index 2907fc7..640a39ed 100644
--- a/ui/views/controls/webview/BUILD.gn
+++ b/ui/views/controls/webview/BUILD.gn
@@ -40,6 +40,7 @@
}
source_set("test_support") {
+ testonly = true
sources = [
"../../test/webview_test_helper.cc",
"../../test/webview_test_helper.h",
diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn
index d762bc6..16643fa6 100644
--- a/ui/wm/BUILD.gn
+++ b/ui/wm/BUILD.gn
@@ -93,6 +93,7 @@
}
static_library("test_support") {
+ testonly = true
sources = [
"test/wm_test_helper.cc",
"test/wm_test_helper.h",