Chromium Code Reviews| Index: webrtc/test/BUILD.gn |
| diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn |
| index 9f40c0959ca3d25f07a95655bbb66f79ddf4ec9e..fe4a74d45bbb4e455f64f85a1daab191b99eb3e2 100644 |
| --- a/webrtc/test/BUILD.gn |
| +++ b/webrtc/test/BUILD.gn |
| @@ -96,22 +96,29 @@ rtc_source_set("field_trial") { |
| ] |
| } |
| -rtc_source_set("test_main") { |
| - testonly = true |
| - sources = [ |
| - "test_main.cc", |
| - ] |
| +if (!build_with_chromium) { |
| + # This target depends on //third_party/gflags and since chromium does not |
| + # have gflags it causes an error when Gn parses this BUILD.gn file. |
| + # It seems that Gn eagerly tries to understand if all the targets are |
| + # buildable (even deps). Obviously gflags is not buildable in chromium |
| + # so if a target depends on this BUILD.gn file we hit this error. |
| + rtc_source_set("test_main") { |
| + testonly = true |
| + sources = [ |
| + "test_main.cc", |
| + ] |
| - public_deps = [ |
| - ":test_support", |
| - ] |
| - deps = [ |
| - ":field_trial", |
| - "../system_wrappers:metrics_default", |
| - "//testing/gmock", |
| - "//testing/gtest", |
| - "//third_party/gflags", |
| - ] |
| + public_deps = [ |
| + ":test_support", |
| + ] |
| + deps = [ |
| + ":field_trial", |
| + "../system_wrappers:metrics_default", |
| + "//testing/gmock", |
| + "//testing/gtest", |
| + "//third_party/gflags", |
| + ] |
| + } |
| } |
| rtc_source_set("fileutils") { |
| @@ -126,98 +133,112 @@ rtc_source_set("fileutils") { |
| visibility = [ ":*" ] |
| } |
| -rtc_source_set("video_test_support") { |
| - testonly = true |
| +if (!build_with_chromium) { |
|
kjellander_webrtc
2017/04/27 12:39:44
Let's move the lower targets up so we can avoid ha
mbonadei
2017/04/27 12:46:43
Done.
|
| + # This target depends on //third_party/gflags and since chromium does not |
| + # have gflags it causes an error when Gn parses this BUILD.gn file. |
| + # It seems that Gn eagerly tries to understand if all the targets are |
| + # buildable (even deps). Obviously gflags is not buildable in chromium |
| + # so if a target depends on this BUILD.gn file we hit this error. |
| + rtc_source_set("video_test_support") { |
| + testonly = true |
| - sources = [ |
| - "testsupport/frame_reader.h", |
| - "testsupport/frame_writer.h", |
| - "testsupport/metrics/video_metrics.cc", |
| - "testsupport/metrics/video_metrics.h", |
| - "testsupport/mock/mock_frame_reader.h", |
| - "testsupport/mock/mock_frame_writer.h", |
| - "testsupport/y4m_frame_writer.cc", |
| - "testsupport/yuv_frame_reader.cc", |
| - "testsupport/yuv_frame_writer.cc", |
| - ] |
| + sources = [ |
| + "testsupport/frame_reader.h", |
| + "testsupport/frame_writer.h", |
| + "testsupport/metrics/video_metrics.cc", |
| + "testsupport/metrics/video_metrics.h", |
| + "testsupport/mock/mock_frame_reader.h", |
| + "testsupport/mock/mock_frame_writer.h", |
| + "testsupport/y4m_frame_writer.cc", |
| + "testsupport/yuv_frame_reader.cc", |
| + "testsupport/yuv_frame_writer.cc", |
| + ] |
| - deps = [ |
| - "../base:rtc_base_approved", |
| - "../common_video", |
| - "../system_wrappers", |
| - "//testing/gmock", |
| - "//testing/gtest", |
| - "//third_party/gflags", |
| - ] |
| + deps = [ |
| + "../base:rtc_base_approved", |
| + "../common_video", |
| + "../system_wrappers", |
| + "//testing/gmock", |
| + "//testing/gtest", |
| + "//third_party/gflags", |
| + ] |
| - public_deps = [ |
| - ":fileutils", |
| - ] |
| + 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 (!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_android) { |
| + deps += [ "//base:base" ] |
| + } |
| - if (is_ios) { |
| - deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| - } |
| + if (is_ios) { |
| + deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| + } |
| - if (rtc_use_memcheck) { |
| - data = valgrind_webrtc_dependencies |
| + if (rtc_use_memcheck) { |
| + data = valgrind_webrtc_dependencies |
| + } |
| } |
| } |
| -rtc_source_set("test_support") { |
| - testonly = true |
| +if (!build_with_chromium) { |
| + # This target depends on //third_party/gflags and since chromium does not |
| + # have gflags it causes an error when Gn parses this BUILD.gn file. |
| + # It seems that Gn eagerly tries to understand if all the targets are |
| + # buildable (even deps). Obviously gflags is not buildable in chromium |
| + # so if a target depends on this BUILD.gn file we hit this error. |
| + rtc_source_set("test_support") { |
| + testonly = true |
| - sources = [ |
| - "gmock.h", |
| - "gtest.h", |
| - "testsupport/isolated_output.cc", |
| - "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", |
| - ] |
| + sources = [ |
| + "gmock.h", |
| + "gtest.h", |
| + "testsupport/isolated_output.cc", |
| + "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 = [ |
| - "../base:gtest_prod", |
| - "../base:rtc_base_approved", |
| - "../common_video", |
| - "../system_wrappers", |
| - "//testing/gmock", |
| - "//testing/gtest", |
| - "//third_party/gflags", |
| - ] |
| + deps = [ |
| + "../base:gtest_prod", |
| + "../base:rtc_base_approved", |
| + "../common_video", |
| + "../system_wrappers", |
| + "//testing/gmock", |
| + "//testing/gtest", |
| + "//third_party/gflags", |
| + ] |
| - public_deps = [ |
| - ":fileutils", |
| - ] |
| + 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 (!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_android) { |
| + deps += [ "//base:base" ] |
| + } |
| - if (is_ios) { |
| - deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| - } |
| + if (is_ios) { |
| + deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| + } |
| - if (rtc_use_memcheck) { |
| - data = valgrind_webrtc_dependencies |
| + if (rtc_use_memcheck) { |
| + data = valgrind_webrtc_dependencies |
| + } |
| } |
| } |
| @@ -253,59 +274,67 @@ if (is_ios) { |
| } |
| } |
| -rtc_test("test_support_unittests") { |
| - deps = [] |
| - sources = [ |
| - "fake_audio_device_unittest.cc", |
| - "fake_network_pipe_unittest.cc", |
| - "frame_generator_unittest.cc", |
| - "rtp_file_reader_unittest.cc", |
| - "rtp_file_writer_unittest.cc", |
| - "testsupport/always_passing_unittest.cc", |
| - "testsupport/isolated_output_unittest.cc", |
| - "testsupport/metrics/video_metrics_unittest.cc", |
| - "testsupport/packet_reader_unittest.cc", |
| - "testsupport/perf_test_unittest.cc", |
| - "testsupport/y4m_frame_writer_unittest.cc", |
| - "testsupport/yuv_frame_reader_unittest.cc", |
| - "testsupport/yuv_frame_writer_unittest.cc", |
| - ] |
| - |
| - # TODO(jschuh): Bug 1348: fix this warning. |
| - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| - |
| - if (is_win) { |
| - cflags = [ "/wd4373" ] # virtual override w/different const/volatile signature. |
| - } |
| - |
| - 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" ] |
| - } |
| - |
| - data = test_support_unittests_resources |
| - if (is_android) { |
| - deps += [ "//testing/android/native_test:native_test_support" ] |
| - shard_timeout = 900 |
| - } |
| +if (!build_with_chromium) { |
| + # This target depends on //third_party/gflags and since chromium does not |
| + # have gflags it causes an error when Gn parses this BUILD.gn file. |
| + # It seems that Gn eagerly tries to understand if all the targets are |
| + # buildable (even deps). Obviously gflags is not buildable in chromium |
| + # so if a target depends on this BUILD.gn file we hit this error. |
| + rtc_test("test_support_unittests") { |
| + deps = [] |
| + sources = [ |
| + "fake_audio_device_unittest.cc", |
| + "fake_network_pipe_unittest.cc", |
| + "frame_generator_unittest.cc", |
| + "rtp_file_reader_unittest.cc", |
| + "rtp_file_writer_unittest.cc", |
| + "testsupport/always_passing_unittest.cc", |
| + "testsupport/isolated_output_unittest.cc", |
| + "testsupport/metrics/video_metrics_unittest.cc", |
| + "testsupport/packet_reader_unittest.cc", |
| + "testsupport/perf_test_unittest.cc", |
| + "testsupport/y4m_frame_writer_unittest.cc", |
| + "testsupport/yuv_frame_reader_unittest.cc", |
| + "testsupport/yuv_frame_writer_unittest.cc", |
| + ] |
| - if (is_ios) { |
| - deps += [ ":test_support_unittests_bundle_data" ] |
| + # TODO(jschuh): Bug 1348: fix this warning. |
| + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| + |
| + if (is_win) { |
| + cflags = [ "/wd4373" ] # virtual override w/different const/volatile signature. |
| + } |
| + |
| + 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" ] |
| + } |
| + |
| + data = test_support_unittests_resources |
| + if (is_android) { |
| + deps += [ "//testing/android/native_test:native_test_support" ] |
| + shard_timeout = 900 |
| + } |
| + |
| + if (is_ios) { |
| + deps += [ ":test_support_unittests_bundle_data" ] |
| + } |
| + |
| + deps += [ |
| + ":direct_transport", |
| + ":fileutils_unittests", |
| + ":test_common", |
| + ":test_main", |
| + ":video_test_common", |
| + ":video_test_support", |
| + "../modules/video_capture", |
| + "//testing/gmock", |
| + "//testing/gtest", |
| + "//third_party/gflags", |
| + ] |
| } |
| - |
| - deps += [ |
| - ":direct_transport", |
| - ":fileutils_unittests", |
| - ":test_common", |
| - ":test_main", |
| - ":video_test_common", |
| - ":video_test_support", |
| - "../modules/video_capture", |
| - "//testing/gmock", |
| - "//testing/gtest", |
| - "//third_party/gflags", |
| - ] |
| } |
| + |
| rtc_source_set("fileutils_unittests") { |
| testonly = true |
| visibility = [ ":*" ] # Only targets in this file can depend on this. |