From d8dd190a085ff02b83be600da7a0b2e844eb9ffe Mon Sep 17 00:00:00 2001 From: kjellander Date: Tue, 23 Aug 2016 04:52:11 -0700 Subject: [PATCH] GN: Fix test_support_unittests and MIPS compile issue. Move the webrtc/test/test_support/metrics sources into test_support[_unittests] targets. This is essentially reverting https://webrtc-codereview.appspot.com/5789004 and moving these sources back to the right target. Add missing foreman_cif.yuv resource needed for these tests. For MIPS, a compile error was surfacing for logcat_trace_context.h when flipping bot to GN, which was fixed. BUG=webrtc:5949 NOTRY=True Review-Url: https://codereview.webrtc.org/2267113002 Cr-Commit-Position: refs/heads/master@{#13860} --- all.gyp | 1 - webrtc/modules/modules.gyp | 1 - .../codecs/tools/video_codecs_tools.gypi | 2 +- .../modules/video_coding/codecs/vp8/vp8.gyp | 1 - .../include/logcat_trace_context.h | 4 +-- webrtc/test/BUILD.gn | 1 + webrtc/test/metrics.gyp | 32 ------------------- webrtc/test/test.gyp | 5 +++ webrtc/test/test_support_unittests.isolate | 1 + webrtc/webrtc_tests.gypi | 4 +-- 10 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 webrtc/test/metrics.gyp diff --git a/all.gyp b/all.gyp index 238229063e..c36bbfe586 100644 --- a/all.gyp +++ b/all.gyp @@ -49,7 +49,6 @@ 'webrtc/api/api_tests.gyp:*', 'webrtc/common_video/common_video_unittests.gyp:*', 'webrtc/system_wrappers/system_wrappers_tests.gyp:*', - 'webrtc/test/metrics.gyp:*', 'webrtc/test/test.gyp:*', ], }], diff --git a/webrtc/modules/modules.gyp b/webrtc/modules/modules.gyp index 6718d8ff63..93484036bd 100644 --- a/webrtc/modules/modules.gyp +++ b/webrtc/modules/modules.gyp @@ -65,7 +65,6 @@ '<(webrtc_root)/common_video/common_video.gyp:common_video', '<(webrtc_root)/modules/video_coding/codecs/vp8/vp8.gyp:webrtc_vp8', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', - '<(webrtc_root)/test/metrics.gyp:metrics', '<(webrtc_root)/test/test.gyp:test_support', '<(webrtc_root)/test/test.gyp:test_support_main', 'audio_coding_module', diff --git a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi index 53dc8e6d2a..813d3b83b4 100644 --- a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi +++ b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi @@ -19,7 +19,7 @@ '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', '<(webrtc_root)/common.gyp:webrtc_common', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default', - '<(webrtc_root)/test/metrics.gyp:metrics', + '<(webrtc_root)/test/test.gyp:test_support', '<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8', ], 'sources': [ diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp index 71abbd54e6..1d4f5a3343 100644 --- a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp +++ b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp @@ -58,7 +58,6 @@ 'dependencies': [ 'webrtc_vp8', '<(webrtc_root)/common_video/common_video.gyp:common_video', - '<(webrtc_root)/test/metrics.gyp:metrics', '<(DEPTH)/testing/gtest.gyp:gtest', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', '<(webrtc_root)/test/test.gyp:test_support_main', diff --git a/webrtc/system_wrappers/include/logcat_trace_context.h b/webrtc/system_wrappers/include/logcat_trace_context.h index 8bb01d8102..fc36386c70 100644 --- a/webrtc/system_wrappers/include/logcat_trace_context.h +++ b/webrtc/system_wrappers/include/logcat_trace_context.h @@ -24,10 +24,10 @@ namespace webrtc { class LogcatTraceContext : public webrtc::TraceCallback { public: LogcatTraceContext(); - virtual ~LogcatTraceContext(); + ~LogcatTraceContext() override; // TraceCallback impl. - virtual void Print(TraceLevel level, const char* message, int length); + void Print(TraceLevel level, const char* message, int length) override; }; } // namespace webrtc diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index a638fb6aea..91471039a6 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -318,6 +318,7 @@ test("test_support_unittests") { # This needs to be kept in sync with the test_support_unittests.isolate file. # TODO(kjellander); Move this to android_assets targets instead. data = [ + "//resources/foreman_cif_short.yuv", "//resources/video_coding/frame-ethernet-ii.pcap", "//resources/video_coding/frame-loopback.pcap", "//resources/video_coding/pltype103.rtp", diff --git a/webrtc/test/metrics.gyp b/webrtc/test/metrics.gyp deleted file mode 100644 index eda0b054ee..0000000000 --- a/webrtc/test/metrics.gyp +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -{ - 'includes': [ - '../build/common.gypi', - ], - 'targets': [ - { - # The metrics code must be kept in its own GYP file in order to - # avoid a circular dependency error due to the dependency on libyuv. - # If the code would be put in test.gyp a circular dependency error during - # GYP generation would occur, because the libyuv.gypi unittest target - # depends on test_support_main. See issue #160 for more info. - 'target_name': 'metrics', - 'type': 'static_library', - 'dependencies': [ - '<(webrtc_root)/common_video/common_video.gyp:common_video', - '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', - ], - 'sources': [ - 'testsupport/metrics/video_metrics.h', - 'testsupport/metrics/video_metrics.cc', - ], - }, - ], # targets -} diff --git a/webrtc/test/test.gyp b/webrtc/test/test.gyp index b7beffb1b4..fc9a2ad1db 100644 --- a/webrtc/test/test.gyp +++ b/webrtc/test/test.gyp @@ -127,6 +127,7 @@ '<(DEPTH)/testing/gtest.gyp:gtest', '<(DEPTH)/testing/gmock.gyp:gmock', '<(webrtc_root)/base/base.gyp:gtest_prod', + '<(webrtc_root)/common_video/common_video.gyp:common_video', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', ], 'sources': [ @@ -137,6 +138,8 @@ 'testsupport/frame_writer.cc', 'testsupport/frame_writer.h', 'testsupport/iosfileutils.mm', + 'testsupport/metrics/video_metrics.h', + 'testsupport/metrics/video_metrics.cc', 'testsupport/mock/mock_frame_reader.h', 'testsupport/mock/mock_frame_writer.h', 'testsupport/packet_reader.cc', @@ -207,6 +210,7 @@ '<(DEPTH)/testing/gtest.gyp:gtest', ], 'sources': [ + 'common_unittest.cc', 'fake_network_pipe_unittest.cc', 'frame_generator_unittest.cc', 'rtp_file_reader_unittest.cc', @@ -219,6 +223,7 @@ 'testsupport/fileutils_unittest.cc', 'testsupport/frame_reader_unittest.cc', 'testsupport/frame_writer_unittest.cc', + 'testsupport/metrics/video_metrics_unittest.cc', 'testsupport/packet_reader_unittest.cc', 'testsupport/perf_test_unittest.cc', ], diff --git a/webrtc/test/test_support_unittests.isolate b/webrtc/test/test_support_unittests.isolate index 32df0395a8..827d379dfd 100644 --- a/webrtc/test/test_support_unittests.isolate +++ b/webrtc/test/test_support_unittests.isolate @@ -10,6 +10,7 @@ ['OS=="linux" or OS=="mac" or OS=="win" or OS=="android"', { 'variables': { 'files': [ + '<(DEPTH)/resources/foreman_cif_short.yuv', '<(DEPTH)/resources/video_coding/frame-ethernet-ii.pcap', '<(DEPTH)/resources/video_coding/frame-loopback.pcap', '<(DEPTH)/resources/video_coding/pltype103.rtp', diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi index 6a7936cc5f..6d8ff6a145 100644 --- a/webrtc/webrtc_tests.gypi +++ b/webrtc/webrtc_tests.gypi @@ -366,8 +366,6 @@ 'call/call_unittest.cc', 'call/packet_injection_tests.cc', 'call/ringbuffer_unittest.cc', - 'test/common_unittest.cc', - 'test/testsupport/metrics/video_metrics_unittest.cc', 'video/call_stats_unittest.cc', 'video/encoder_state_feedback_unittest.cc', 'video/end_to_end_tests.cc', @@ -392,9 +390,9 @@ '<(webrtc_root)/modules/modules.gyp:video_capture', '<(webrtc_root)/test/test.gyp:channel_transport', '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine', - 'test/metrics.gyp:metrics', 'test/test.gyp:test_common', 'test/test.gyp:test_main', + 'test/test.gyp:test_support', 'webrtc', ], 'conditions': [