Reland of Enable GN check for webrtc/base (patchset #3 id:230001 of https://codereview.webrtc.org/2838683002/ )

Reason for revert:
Fourth attempt to land.

Waiting for https://codereview.webrtc.org/2845013003 to
avoid conflicts on webrtc/modules/audio_coding:neteq_unittest_tools.

Original issue's description:
> Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
>
> Reason for revert:
> Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).
>
> Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.
>
> Original issue's description:
> > Enable GN check for webrtc/base
> >
> > It's not possible to enable it for the rtc_base_approved
> > target but since a larger refactoring is ongoing for webrtc/base
> > this CL doesn't attempt to fix that.
> >
> > Changes made:
> > * Move webrtc/system_wrappers/include/stringize_macros.h into
> >   webrtc/base:rtc_base_approved_unittests (and corresponding
> >   unit test to rtc_base_approved_unittests).
> > * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> > * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
> >   webrtc/base.
> > * Remove unused use include of webrtc/base/fileutils.h in
> >   webrtc/base/pathutils.cc
> >
> > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > NOTRY=True
> >
> > Review-Url: https://codereview.webrtc.org/2717083002
> > Cr-Commit-Position: refs/heads/master@{#17766}
> > Committed: ed754e71ae
>
> TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2838683002
> Cr-Commit-Position: refs/heads/master@{#17849}
> Committed: 11ed366c48

TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6828, webrtc:3806, webrtc:7480

Review-Url: https://codereview.webrtc.org/2852663002
Cr-Commit-Position: refs/heads/master@{#17927}
This commit is contained in:
mbonadei
2017-04-28 05:24:50 -07:00
committed by Commit bot
parent 5e82c87d23
commit 148d5a2dca
12 changed files with 171 additions and 128 deletions

1
.gn
View File

@ -24,6 +24,7 @@ secondary_source = "//build/secondary/"
check_targets = [ check_targets = [
"//webrtc/api/*", "//webrtc/api/*",
"//webrtc/audio/*", "//webrtc/audio/*",
"//webrtc/base/*",
"//webrtc/call/*", "//webrtc/call/*",
"//webrtc/common_video/*", "//webrtc/common_video/*",
"//webrtc/common_audio/*", "//webrtc/common_audio/*",

View File

@ -92,6 +92,10 @@ source_set("protobuf_utils") {
# The subset of rtc_base approved for use outside of libjingle. # The subset of rtc_base approved for use outside of libjingle.
rtc_static_library("rtc_base_approved") { rtc_static_library("rtc_base_approved") {
# TODO(kjellander): Remove (bugs.webrtc.org/7480)
# Enabling GN check triggers a cyclic dependency caused by rate_limiter.cc:
# :rtc_base_approved -> //webrtc/system_wrappers -> :rtc_base_approved
check_includes = false
defines = [] defines = []
libs = [] libs = []
deps = [] deps = []
@ -136,8 +140,6 @@ rtc_static_library("rtc_base_approved") {
"location.h", "location.h",
"md5.cc", "md5.cc",
"md5.h", "md5.h",
"md5digest.cc",
"md5digest.h",
"mod_ops.h", "mod_ops.h",
"onetimeevent.h", "onetimeevent.h",
"optional.cc", "optional.cc",
@ -172,6 +174,7 @@ rtc_static_library("rtc_base_approved") {
"string_to_number.h", "string_to_number.h",
"stringencode.cc", "stringencode.cc",
"stringencode.h", "stringencode.h",
"stringize_macros.h",
"stringutils.cc", "stringutils.cc",
"stringutils.h", "stringutils.h",
"swap_queue.h", "swap_queue.h",
@ -655,7 +658,6 @@ rtc_source_set("gtest_prod") {
] ]
} }
if (rtc_include_tests) {
config("rtc_base_tests_utils_exported_config") { config("rtc_base_tests_utils_exported_config") {
defines = [ "GTEST_RELATIVE_PATH" ] defines = [ "GTEST_RELATIVE_PATH" ]
} }
@ -670,26 +672,6 @@ if (rtc_include_tests) {
} }
} }
rtc_source_set("rtc_base_tests_main") {
testonly = true
sources = [
"unittest_main.cc",
]
public_configs = [ ":rtc_base_tests_utils_exported_config" ]
deps = [
":rtc_base_tests_utils",
]
public_deps = [
"//testing/gmock",
"//testing/gtest",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
rtc_source_set("rtc_base_tests_utils") { rtc_source_set("rtc_base_tests_utils") {
testonly = true testonly = true
sources = [ sources = [
@ -706,6 +688,8 @@ if (rtc_include_tests) {
"gunit.h", "gunit.h",
"httpserver.cc", "httpserver.cc",
"httpserver.h", "httpserver.h",
"md5digest.cc",
"md5digest.h",
"memory_usage.cc", "memory_usage.cc",
"memory_usage.h", "memory_usage.h",
"natserver.cc", "natserver.cc",
@ -741,6 +725,31 @@ if (rtc_include_tests) {
} }
} }
if (rtc_include_tests) {
rtc_source_set("rtc_base_tests_main") {
testonly = true
sources = [
"unittest_main.cc",
]
public_configs = [ ":rtc_base_tests_utils_exported_config" ]
deps = [
":rtc_base",
":rtc_base_approved",
":rtc_base_tests_utils",
"../test:field_trial",
"../test:test_support",
]
public_deps = [
"//testing/gmock",
"//testing/gtest",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
rtc_source_set("rtc_base_nonparallel_tests") { rtc_source_set("rtc_base_nonparallel_tests") {
testonly = true testonly = true
@ -763,6 +772,9 @@ if (rtc_include_tests) {
deps = [ deps = [
":rtc_base", ":rtc_base",
":rtc_base_tests_main", ":rtc_base_tests_main",
":rtc_base_tests_utils",
"../system_wrappers:system_wrappers",
"../test:test_support",
"//testing/gtest", "//testing/gtest",
] ]
if (is_win) { if (is_win) {
@ -817,6 +829,7 @@ if (rtc_include_tests) {
"safe_minmax_unittest.cc", "safe_minmax_unittest.cc",
"string_to_number_unittest.cc", "string_to_number_unittest.cc",
"stringencode_unittest.cc", "stringencode_unittest.cc",
"stringize_macros_unittest.cc",
"stringutils_unittest.cc", "stringutils_unittest.cc",
"swap_queue_unittest.cc", "swap_queue_unittest.cc",
"thread_annotations_unittest.cc", "thread_annotations_unittest.cc",
@ -825,8 +838,13 @@ if (rtc_include_tests) {
"timeutils_unittest.cc", "timeutils_unittest.cc",
] ]
deps = [ deps = [
":rtc_base",
":rtc_base_approved", ":rtc_base_approved",
":rtc_base_tests_main", ":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_task_queue",
"../system_wrappers:system_wrappers",
"../test:test_support",
] ]
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).
@ -850,7 +868,9 @@ if (rtc_include_tests) {
] ]
deps = [ deps = [
":rtc_base_tests_main", ":rtc_base_tests_main",
":rtc_base_tests_utils",
":rtc_task_queue", ":rtc_task_queue",
"../test:test_support",
] ]
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).
@ -872,8 +892,10 @@ if (rtc_include_tests) {
"numerics/percentile_filter_unittest.cc", "numerics/percentile_filter_unittest.cc",
] ]
deps = [ deps = [
":rtc_base_approved",
":rtc_base_tests_main", ":rtc_base_tests_main",
":rtc_numerics", ":rtc_numerics",
"../test:test_support",
] ]
} }
@ -939,6 +961,8 @@ if (rtc_include_tests) {
} }
deps = [ deps = [
":rtc_base_tests_main", ":rtc_base_tests_main",
":rtc_base_tests_utils",
"../test:test_support",
] ]
public_deps = [ public_deps = [
":rtc_base", ":rtc_base",

View File

@ -13,7 +13,7 @@
#include <string> #include <string>
#include "webrtc/system_wrappers/include/stringize_macros.h" #include "webrtc/base/stringize_macros.h"
namespace rtc { namespace rtc {

View File

@ -16,7 +16,6 @@
#endif // WEBRTC_WIN #endif // WEBRTC_WIN
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"
#include "webrtc/base/fileutils.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/pathutils.h" #include "webrtc/base/pathutils.h"
#include "webrtc/base/stringutils.h" #include "webrtc/base/stringutils.h"

View File

@ -15,8 +15,8 @@
// symbols (or their output) and manipulating preprocessor symbols // symbols (or their output) and manipulating preprocessor symbols
// that define strings. // that define strings.
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_ #ifndef WEBRTC_BASE_STRINGIZE_MACROS_H_
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_ #define WEBRTC_BASE_STRINGIZE_MACROS_H_
// This is not very useful as it does not expand defined symbols if // This is not very useful as it does not expand defined symbols if
// called directly. Use its counterpart without the _NO_EXPANSION // called directly. Use its counterpart without the _NO_EXPANSION
@ -35,4 +35,4 @@
// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)" // STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x) #define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STRINGIZE_MACROS_H_ #endif // WEBRTC_BASE_STRINGIZE_MACROS_H_

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "webrtc/system_wrappers/include/stringize_macros.h" #include "webrtc/base/stringize_macros.h"
#include "webrtc/test/gtest.h" #include "webrtc/test/gtest.h"

View File

@ -19,11 +19,11 @@
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
#include "webrtc/base/stringize_macros.h"
#include "webrtc/base/timeutils.h" #include "webrtc/base/timeutils.h"
#include "webrtc/common_audio/resampler/sinc_resampler.h" #include "webrtc/common_audio/resampler/sinc_resampler.h"
#include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h" #include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h" #include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
#include "webrtc/system_wrappers/include/stringize_macros.h"
#include "webrtc/test/gmock.h" #include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h" #include "webrtc/test/gtest.h"

View File

@ -1621,6 +1621,7 @@ if (rtc_include_tests) {
"..:module_api", "..:module_api",
"../..:webrtc_common", "../..:webrtc_common",
"../../base:rtc_base_approved", "../../base:rtc_base_approved",
"../../base:rtc_base_tests_utils",
"../../common_audio", "../../common_audio",
"../../test:rtp_test_utils", "../../test:rtp_test_utils",
"../rtp_rtcp", "../rtp_rtcp",

View File

@ -27,7 +27,6 @@ rtc_static_library("system_wrappers") {
"include/rw_lock_wrapper.h", "include/rw_lock_wrapper.h",
"include/sleep.h", "include/sleep.h",
"include/static_instance.h", "include/static_instance.h",
"include/stringize_macros.h",
"include/timestamp_extrapolator.h", "include/timestamp_extrapolator.h",
"include/trace.h", "include/trace.h",
"source/aligned_malloc.cc", "source/aligned_malloc.cc",
@ -211,7 +210,6 @@ if (rtc_include_tests) {
"source/metrics_unittest.cc", "source/metrics_unittest.cc",
"source/ntp_time_unittest.cc", "source/ntp_time_unittest.cc",
"source/rtp_to_ntp_estimator_unittest.cc", "source/rtp_to_ntp_estimator_unittest.cc",
"source/stringize_macros_unittest.cc",
] ]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

View File

@ -22,12 +22,17 @@ group("test") {
":field_trial", ":field_trial",
":rtp_test_utils", ":rtp_test_utils",
":test_common", ":test_common",
":test_main",
":test_renderer", ":test_renderer",
":test_support", ":test_support",
":test_support_unittests",
":video_test_common", ":video_test_common",
] ]
if (!build_with_chromium) {
deps += [
":test_main",
":test_support_unittests",
]
}
} }
rtc_source_set("video_test_common") { rtc_source_set("video_test_common") {
@ -96,23 +101,50 @@ rtc_source_set("field_trial") {
] ]
} }
test_support_unittests_resources = [ rtc_source_set("test_support") {
"//resources/foreman_cif_short.yuv", testonly = true
"//resources/video_coding/frame-ethernet-ii.pcap",
"//resources/video_coding/frame-loopback.pcap", sources = [
"//resources/video_coding/pltype103.rtp", "gmock.h",
"//resources/video_coding/pltype103_header_only.rtp", "gtest.h",
"//resources/video_coding/ssrcs-2.pcap", "testsupport/packet_reader.cc",
"//resources/video_coding/ssrcs-3.pcap", "testsupport/packet_reader.h",
"testsupport/perf_test.cc",
"testsupport/perf_test.h",
"testsupport/trace_to_stderr.cc",
"testsupport/trace_to_stderr.h",
"testsupport/unittest_utils.h",
] ]
if (is_ios) { deps = [
bundle_data("test_support_unittests_bundle_data") { "..:webrtc_common",
testonly = true "../base:gtest_prod",
sources = test_support_unittests_resources "../base:rtc_base_approved",
outputs = [ "../common_video",
"{{bundle_resources_dir}}/{{source_file_part}}", "../system_wrappers",
"//testing/gmock",
"//testing/gtest",
] ]
public_deps = [
":fileutils",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
if (is_android) {
deps += [ "//base:base" ]
}
if (is_ios && !build_with_chromium) {
deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ]
}
if (rtc_use_memcheck) {
data = valgrind_webrtc_dependencies
} }
} }
@ -186,52 +218,36 @@ if (!build_with_chromium) {
} }
} }
rtc_source_set("test_support") { rtc_source_set("test_support_isolated_output") {
testonly = true testonly = true
sources = [ sources = [
"gmock.h",
"gtest.h",
"testsupport/isolated_output.cc", "testsupport/isolated_output.cc",
"testsupport/isolated_output.h", "testsupport/isolated_output.h",
"testsupport/packet_reader.cc",
"testsupport/packet_reader.h",
"testsupport/perf_test.cc",
"testsupport/perf_test.h",
"testsupport/trace_to_stderr.cc",
"testsupport/trace_to_stderr.h",
"testsupport/unittest_utils.h",
] ]
deps = [ deps = [
"../base:gtest_prod", ":fileutils",
"../base:rtc_base_approved", "../base:rtc_base_approved",
"../common_video",
"../system_wrappers",
"//testing/gmock",
"//testing/gtest",
"//third_party/gflags", "//third_party/gflags",
] ]
}
public_deps = [ test_support_unittests_resources = [
":fileutils", "//resources/foreman_cif_short.yuv",
"//resources/video_coding/frame-ethernet-ii.pcap",
"//resources/video_coding/frame-loopback.pcap",
"//resources/video_coding/pltype103.rtp",
"//resources/video_coding/pltype103_header_only.rtp",
"//resources/video_coding/ssrcs-2.pcap",
"//resources/video_coding/ssrcs-3.pcap",
] ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
if (is_android) {
deps += [ "//base:base" ]
}
if (is_ios) { if (is_ios) {
deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] bundle_data("test_support_unittests_bundle_data") {
} testonly = true
sources = test_support_unittests_resources
if (rtc_use_memcheck) { outputs = [
data = valgrind_webrtc_dependencies "{{bundle_resources_dir}}/{{source_file_part}}",
]
} }
} }
@ -281,6 +297,7 @@ if (!build_with_chromium) {
":fileutils_unittests", ":fileutils_unittests",
":test_common", ":test_common",
":test_main", ":test_main",
":test_support_isolated_output",
":video_test_common", ":video_test_common",
":video_test_support", ":video_test_support",
"../modules/video_capture", "../modules/video_capture",
@ -423,7 +440,7 @@ rtc_source_set("test_common") {
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (!is_android) { if (!is_android && !build_with_chromium) {
deps += [ "../modules/video_capture:video_capture_internal_impl" ] deps += [ "../modules/video_capture:video_capture_internal_impl" ]
} }
} }

View File

@ -257,6 +257,8 @@ webrtc_fuzzer_test("neteq_rtp_fuzzer") {
"neteq_rtp_fuzzer.cc", "neteq_rtp_fuzzer.cc",
] ]
deps = [ deps = [
"../../base:rtc_base_approved",
"../../base:rtc_base_tests_utils",
"../../modules/audio_coding:neteq", "../../modules/audio_coding:neteq",
"../../modules/audio_coding:neteq_tools_minimal", "../../modules/audio_coding:neteq_tools_minimal",
"../../modules/audio_coding:pcm16b", "../../modules/audio_coding:pcm16b",

View File

@ -186,6 +186,7 @@ if (rtc_include_tests) {
":file_player", ":file_player",
":voice_engine", ":voice_engine",
"../base:rtc_base_approved", "../base:rtc_base_approved",
"../base:rtc_base_tests_utils",
"../modules:module_api", "../modules:module_api",
"../test:test_common", "../test:test_common",
"//testing/gmock", "//testing/gmock",