Removing useless dependencies on //testing/gmock.

If a WebRTC build target requires gmock it has to include
test/gmock.h and just depend on //test:test_support.

Unfortunately //testtest_support was a leaky abstraction because it
wasn't propagating the correct -I compiler flag. To make everything
work, all the targets that use gmock started also to depend on
//testing/gmock (even if they were not including any gmock header
directly).

This CL makes //testtest_support propagate the include path up in the
dependency chain so it is possible to remove unused dependencies.

Note: all_dependent_configs should probably be used in the original
gmock target. There is an ongoing discussion about it. This CL solves
the problem on WebRTC side and it is forward compatible.

TBR=phoglund@webrtc.org

Bug: webrtc:8603
Change-Id: If08daf2ce9a6431a6e881a236743b4ec33b59ea7
Reviewed-on: https://webrtc-review.googlesource.com/44340
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21776}
This commit is contained in:
Mirko Bonadei 2018-01-26 11:57:47 +01:00 committed by Commit Bot
parent 5e4833cc90
commit 65ce31158f
29 changed files with 5 additions and 49 deletions

View File

@ -322,7 +322,6 @@ if (rtc_include_tests) {
deps = [ deps = [
":audio_mixer_api", ":audio_mixer_api",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
} }
@ -336,7 +335,6 @@ if (rtc_include_tests) {
deps = [ deps = [
":libjingle_peerconnection_api", ":libjingle_peerconnection_api",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
} }
@ -350,7 +348,6 @@ if (rtc_include_tests) {
deps = [ deps = [
"../api/video_codecs:video_codecs_api", "../api/video_codecs:video_codecs_api",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
} }

View File

@ -38,7 +38,6 @@ if (rtc_include_tests) {
"../isac:audio_encoder_isac_float", "../isac:audio_encoder_isac_float",
"../opus:audio_decoder_opus", "../opus:audio_decoder_opus",
"../opus:audio_encoder_opus", "../opus:audio_encoder_opus",
"//testing/gmock",
] ]
} }
} }

View File

@ -152,7 +152,6 @@ if (rtc_include_tests) {
"../test:test_common", "../test:test_common",
"../test:test_support", "../test:test_support",
"utility:utility_tests", "utility:utility_tests",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
@ -183,7 +182,6 @@ if (rtc_include_tests) {
"../test:fake_audio_device", "../test:fake_audio_device",
"../test:test_common", "../test:test_common",
"../test:test_main", "../test:test_main",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (is_android) { if (is_android) {
@ -237,7 +235,6 @@ if (rtc_include_tests) {
"../test:single_threaded_task_queue", "../test:single_threaded_task_queue",
"../test:test_common", "../test:test_common",
"../test:test_main", "../test:test_main",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]

View File

@ -235,7 +235,6 @@ if (rtc_include_tests) {
"../test:test_common", "../test:test_common",
"../test:test_support", "../test:test_support",
"../test:video_test_common", "../test:video_test_common",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -296,7 +295,6 @@ if (rtc_include_tests) {
"../modules/congestion_controller:congestion_controller", "../modules/congestion_controller:congestion_controller",
"../modules/pacing:pacing", "../modules/pacing:pacing",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
} }

View File

@ -457,7 +457,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../system_wrappers:cpu_features_api", "../system_wrappers:cpu_features_api",
"../test:test_main", "../test:test_main",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]

View File

@ -117,7 +117,6 @@ if (rtc_include_tests) {
"../system_wrappers:system_wrappers", "../system_wrappers:system_wrappers",
"../test:test_main", "../test:test_main",
"../test:video_test_common", "../test:video_test_common",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/libyuv", "//third_party/libyuv",
] ]

View File

@ -198,7 +198,6 @@ if (rtc_enable_protobuf) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../test:test_support", "../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {

View File

@ -457,7 +457,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../test:test_support", "../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }

View File

@ -89,7 +89,6 @@ if (rtc_include_tests) {
"audio_coding:audio_coding_modules_tests", "audio_coding:audio_coding_modules_tests",
"rtp_rtcp:rtp_rtcp_modules_tests", "rtp_rtcp:rtp_rtcp_modules_tests",
"video_coding:video_coding_modules_tests", "video_coding:video_coding_modules_tests",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]

View File

@ -2182,7 +2182,6 @@ if (rtc_include_tests) {
"../../test:rtp_test_utils", "../../test:rtp_test_utils",
"../../test:test_common", "../../test:test_common",
"../../test:test_support", "../../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]

View File

@ -322,7 +322,6 @@ if (rtc_include_tests) {
"../../sdk:audio_objc", "../../sdk:audio_objc",
"../../system_wrappers", "../../system_wrappers",
"../../test:test_support", "../../test:test_support",
"//testing/gmock",
"//third_party/ocmock", "//third_party/ocmock",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -348,7 +347,6 @@ if (rtc_include_tests) {
"../../system_wrappers", "../../system_wrappers",
"../../test:test_support", "../../test:test_support",
"../utility:utility", "../utility:utility",
"//testing/gmock",
] ]
if (is_linux || is_mac || is_win) { if (is_linux || is_mac || is_win) {
sources += [ "audio_device_unittest.cc" ] sources += [ "audio_device_unittest.cc" ]

View File

@ -90,7 +90,6 @@ if (rtc_include_tests) {
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_task_queue", "../../rtc_base:rtc_task_queue",
"../../test:test_support", "../../test:test_support",
"//testing/gmock",
] ]
} }
} }

View File

@ -607,7 +607,6 @@ if (rtc_include_tests) {
"../audio_coding:neteq_input_audio_tools", "../audio_coding:neteq_input_audio_tools",
"aec_dump:mock_aec_dump_unittests", "aec_dump:mock_aec_dump_unittests",
"test/conversational_speech:unittest", "test/conversational_speech:unittest",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]

View File

@ -36,7 +36,6 @@ rtc_source_set("mock_aec_dump") {
public_deps = [ public_deps = [
"../..:module_api", "../..:module_api",
"../../../test:test_support", "../../../test:test_support",
"//testing/gmock",
] ]
} }

View File

@ -72,7 +72,6 @@ rtc_source_set("unittest") {
"../../../../common_audio", "../../../../common_audio",
"../../../../rtc_base:rtc_base_approved", "../../../../rtc_base:rtc_base_approved",
"../../../../test:test_support", "../../../../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }

View File

@ -75,7 +75,6 @@ if (rtc_include_tests) {
"../../test:test_support", "../../test:test_support",
"../pacing:mock_paced_sender", "../pacing:mock_paced_sender",
"../remote_bitrate_estimator:remote_bitrate_estimator", "../remote_bitrate_estimator:remote_bitrate_estimator",
"//testing/gmock",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).

View File

@ -158,7 +158,6 @@ if (rtc_include_tests) {
"../pacing:pacing", "../pacing:pacing",
"../remote_bitrate_estimator:remote_bitrate_estimator", "../remote_bitrate_estimator:remote_bitrate_estimator",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"//testing/gmock",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).

View File

@ -99,7 +99,6 @@ if (rtc_include_tests) {
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../system_wrappers:cpu_features_api", "../../system_wrappers:cpu_features_api",
"../../test:test_support", "../../test:test_support",
"//testing/gmock",
] ]
if (rtc_desktop_capture_supported) { if (rtc_desktop_capture_supported) {
sources += [ sources += [
@ -146,7 +145,6 @@ if (rtc_include_tests) {
public_deps = [ public_deps = [
":desktop_capture", ":desktop_capture",
"//testing/gmock",
] ]
sources = [ sources = [

View File

@ -76,7 +76,6 @@ if (rtc_include_tests) {
"../rtp_rtcp", "../rtp_rtcp",
"../rtp_rtcp:mock_rtp_rtcp", "../rtp_rtcp:mock_rtp_rtcp",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"//testing/gmock",
] ]
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning. # TODO(jschuh): bugs.webrtc.org/1348: fix this warning.

View File

@ -156,7 +156,6 @@ if (rtc_include_tests) {
"../rtp_rtcp", "../rtp_rtcp",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"../video_coding:video_coding_utility", "../video_coding:video_coding_utility",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }
@ -213,7 +212,6 @@ if (rtc_include_tests) {
"../../test:test_support", "../../test:test_support",
"../pacing:pacing", "../pacing:pacing",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"//testing/gmock",
] ]
if (is_win) { if (is_win) {
cflags = [ cflags = [
@ -239,7 +237,6 @@ if (rtc_include_tests) {
"../..:webrtc_common", "../..:webrtc_common",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../test:test_main", "../../test:test_main",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
data = [ data = [

View File

@ -417,7 +417,6 @@ if (rtc_include_tests) {
"../../test:test_common", "../../test:test_common",
"../../test:test_support", "../../test:test_support",
"../audio_coding:audio_format_conversion", "../audio_coding:audio_format_conversion",
"//testing/gmock",
] ]
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning. # TODO(jschuh): bugs.webrtc.org/1348: fix this warning.

View File

@ -68,7 +68,6 @@ if (rtc_include_tests) {
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_task_queue", "../../rtc_base:rtc_task_queue",
"../../test:test_support", "../../test:test_support",
"//testing/gmock",
] ]
} }
} }

View File

@ -703,7 +703,6 @@ if (rtc_include_tests) {
"../../test:video_test_common", "../../test:video_test_common",
"../../test:video_test_support", "../../test:video_test_support",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"//testing/gmock",
] ]
if (rtc_build_libvpx) { if (rtc_build_libvpx) {
deps += [ rtc_libvpx_dir ] deps += [ rtc_libvpx_dir ]

View File

@ -141,7 +141,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
} }
@ -180,7 +179,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../rtc_base:stringutils", "../rtc_base:stringutils",
"../test:test_support", "../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -221,7 +219,6 @@ if (rtc_include_tests) {
"../rtc_base:checks", "../rtc_base:checks",
"../rtc_base:rtc_base", "../rtc_base:rtc_base",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
defines = [ "GTEST_RELATIVE_PATH" ] defines = [ "GTEST_RELATIVE_PATH" ]

View File

@ -367,7 +367,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../test:test_support", "../test:test_support",
"//testing/gmock",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {

View File

@ -880,7 +880,6 @@ rtc_source_set("rtc_base_tests_utils") {
"../test:test_support", "../test:test_support",
] ]
public_deps = [ public_deps = [
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }
@ -901,7 +900,6 @@ if (rtc_include_tests) {
] ]
public_deps = [ public_deps = [
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }

View File

@ -66,7 +66,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_json", "../rtc_base:rtc_json",
"../system_wrappers:metrics_default", "../system_wrappers:metrics_default",
"//testing/gmock",
] ]
if (is_android) { if (is_android) {

View File

@ -164,7 +164,11 @@ rtc_source_set("test_support") {
visibility = [ "*" ] visibility = [ "*" ]
testonly = true testonly = true
all_dependent_configs = [ ":suppress_warning_4373" ] all_dependent_configs = [
":suppress_warning_4373",
"//third_party/googletest:gmock_config",
"//third_party/googletest:gtest_config",
]
sources = [ sources = [
"gmock.h", "gmock.h",
@ -226,7 +230,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../system_wrappers:metrics_default", "../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default", "../system_wrappers:runtime_enabled_features_default",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }
@ -256,7 +259,6 @@ if (rtc_include_tests) {
"../rtc_base:checks", "../rtc_base:checks",
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../system_wrappers", "../system_wrappers",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/libyuv", "//third_party/libyuv",
] ]
@ -379,7 +381,6 @@ if (rtc_include_tests) {
":video_test_support", ":video_test_support",
"../modules/video_capture", "../modules/video_capture",
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }
@ -483,7 +484,6 @@ rtc_source_set("fileutils_unittests") {
"../api:optional", "../api:optional",
"../rtc_base:checks", "../rtc_base:checks",
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
} }
@ -634,7 +634,6 @@ rtc_source_set("test_common") {
"../system_wrappers:field_trial_api", "../system_wrappers:field_trial_api",
"../system_wrappers:runtime_enabled_features_api", "../system_wrappers:runtime_enabled_features_api",
"../video", "../video",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!is_android && !build_with_chromium) { if (!is_android && !build_with_chromium) {
@ -768,7 +767,6 @@ rtc_source_set("audio_codec_mocks") {
"../api/audio_codecs:audio_codecs_api", "../api/audio_codecs:audio_codecs_api",
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"//testing/gmock",
] ]
} }

View File

@ -177,7 +177,6 @@ if (rtc_include_tests) {
"../test:test_common", "../test:test_common",
"../test:test_renderer", "../test:test_renderer",
"../test:test_support", "../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -227,7 +226,6 @@ if (rtc_include_tests) {
"../test:test_common", "../test:test_common",
"../test:test_renderer", "../test:test_renderer",
"../test:test_support", "../test:test_support",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
@ -342,7 +340,6 @@ if (rtc_include_tests) {
"../test:test_common", "../test:test_common",
"../test:test_support", "../test:test_support",
"../test:video_test_common", "../test:video_test_common",
"//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {