GN: Tighten up test target visibility + refactorings
Make all rtc_source_test target that contains tests that
are included in a test executable only be visible to the
rtc_test target. Doing this exposed a couple of errors and
dependency problems that were resolved. Having this could
have prevented duplicated execution of tests like the case that
was recently fixed by deadbeef@ in
https://codereview.webrtc.org/2820263004
New targets:
* //webrtc/modules/rtp_rtcp:fec_test_helper
* //webrtc/modules/rtp_rtcp:mock_rtp_rtcp
* //webrtc/modules/remote_bitrate_estimator:mock_remote_bitrate_observer
The mock files and targets should probably be moved into webrtc/test in
the future, but that's out of the scope of this CL.
BUG=webrtc:5716
NOTRY=True
Review-Url: https://codereview.webrtc.org/2828793003
Cr-Commit-Position: refs/heads/master@{#17863}
diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn
index 52afc93..20b5d10 100644
--- a/webrtc/video/BUILD.gn
+++ b/webrtc/video/BUILD.gn
@@ -82,6 +82,7 @@
if (rtc_include_tests) {
rtc_source_set("video_quality_test") {
testonly = true
+ visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = [
"video_quality_test.cc",
"video_quality_test.h",
@@ -114,6 +115,13 @@
rtc_source_set("video_full_stack_tests") {
testonly = true
+
+ # Skip restricting visibility on mobile platforms since the tests on those
+ # gets additional generated targets which would require many lines here to
+ # cover (which would be confusing to read and hard to maintain).
+ if (!is_android && !is_ios) {
+ visibility = [ "//webrtc:webrtc_perf_tests" ]
+ }
sources = [
"full_stack_tests.cc",
]
@@ -213,6 +221,13 @@
# TODO(pbos): Rename test suite.
rtc_source_set("video_tests") {
testonly = true
+
+ # Skip restricting visibility on mobile platforms since the tests on those
+ # gets additional generated targets which would require many lines here to
+ # cover (which would be confusing to read and hard to maintain).
+ if (!is_android && !is_ios) {
+ visibility = [ "//webrtc:video_engine_tests" ]
+ }
defines = []
sources = [
"call_stats_unittest.cc",
@@ -245,7 +260,7 @@
"../media:rtc_media_tests_utils",
"../modules/pacing",
"../modules/rtp_rtcp",
- "../modules/rtp_rtcp:rtp_rtcp_unittests",
+ "../modules/rtp_rtcp:mock_rtp_rtcp",
"../modules/utility",
"../modules/video_coding",
"../modules/video_coding:video_coding_utility",