From 988d31eb9bf60d1cbe563d64f88f7e0132ca143a Mon Sep 17 00:00:00 2001 From: kjellander Date: Fri, 5 Feb 2016 00:23:50 -0800 Subject: [PATCH] Move gtest_prod_util.h out of webrtc/test tree. This is needed because the target is defined in webrtc/common.gyp and its current location crosses package boundaries when generating projects for some build systems. NOTRY=True Review URL: https://codereview.webrtc.org/1665603003 Cr-Commit-Position: refs/heads/master@{#11496} --- webrtc/BUILD.gn | 6 ------ webrtc/base/BUILD.gn | 6 ++++++ webrtc/base/base.gyp | 7 +++++++ webrtc/{test/testsupport => base}/gtest_prod_util.h | 6 +++--- webrtc/common.gyp | 7 ------- webrtc/common_audio/channel_buffer.h | 2 +- webrtc/common_audio/resampler/sinc_resampler.h | 2 +- webrtc/modules/audio_coding/neteq/nack.h | 2 +- .../audio_processing/transient/transient_suppressor.h | 2 +- webrtc/modules/remote_bitrate_estimator/test/bwe.h | 2 +- .../remote_bitrate_estimator/test/metric_recorder.h | 2 +- webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h | 2 +- webrtc/test/BUILD.gn | 2 +- webrtc/test/test.gyp | 2 +- webrtc/tools/BUILD.gn | 2 +- webrtc/tools/internal_tools.gyp | 2 +- webrtc/tools/simple_command_line_parser.h | 2 +- 17 files changed, 28 insertions(+), 28 deletions(-) rename webrtc/{test/testsupport => base}/gtest_prod_util.h (89%) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index be824b7bc7..6d84c504a3 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -246,12 +246,6 @@ source_set("webrtc_common") { } } -source_set("gtest_prod") { - sources = [ - "test/testsupport/gtest_prod_util.h", - ] -} - if (rtc_enable_protobuf) { proto_library("rtc_event_log_proto") { sources = [ diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index c3a3f0ddbb..bebef8e525 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -643,3 +643,9 @@ if (is_ios) { ] } } + +source_set("gtest_prod") { + sources = [ + "gtest_prod_util.h", + ] +} diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index b5ee37e396..3ae76dbe45 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -746,5 +746,12 @@ }], ], }, + { + 'target_name': 'gtest_prod', + 'type': 'static_library', + 'sources': [ + 'gtest_prod_util.h', + ], + }, ], } diff --git a/webrtc/test/testsupport/gtest_prod_util.h b/webrtc/base/gtest_prod_util.h similarity index 89% rename from webrtc/test/testsupport/gtest_prod_util.h rename to webrtc/base/gtest_prod_util.h index 5370589899..f0cb1145f9 100644 --- a/webrtc/test/testsupport/gtest_prod_util.h +++ b/webrtc/base/gtest_prod_util.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_ -#define WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_ +#ifndef WEBRTC_BASE_GTEST_PROD_UTIL_H_ +#define WEBRTC_BASE_GTEST_PROD_UTIL_H_ // Define our own version of FRIEND_TEST here rather than including // gtest_prod.h to avoid depending on any part of GTest in production code. @@ -35,4 +35,4 @@ friend class test_case_name##_##test_name##_Test FRIEND_TEST_WEBRTC(test_case_name, FLAKY_##test_name); \ FRIEND_TEST_WEBRTC(test_case_name, FAILS_##test_name) -#endif // WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_ +#endif // WEBRTC_BASE_GTEST_PROD_UTIL_H_ diff --git a/webrtc/common.gyp b/webrtc/common.gyp index efffe1312c..3b5fe902dd 100644 --- a/webrtc/common.gyp +++ b/webrtc/common.gyp @@ -20,12 +20,5 @@ 'typedefs.h', ], }, - { - 'target_name': 'gtest_prod', - 'type': 'static_library', - 'sources': [ - 'test/testsupport/gtest_prod_util.h', - ], - }, ], } diff --git a/webrtc/common_audio/channel_buffer.h b/webrtc/common_audio/channel_buffer.h index d9069163fa..9f2fb96357 100644 --- a/webrtc/common_audio/channel_buffer.h +++ b/webrtc/common_audio/channel_buffer.h @@ -14,9 +14,9 @@ #include #include "webrtc/base/checks.h" +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/common_audio/include/audio_util.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" namespace webrtc { diff --git a/webrtc/common_audio/resampler/sinc_resampler.h b/webrtc/common_audio/resampler/sinc_resampler.h index 45ade0cc69..0980e2d756 100644 --- a/webrtc/common_audio/resampler/sinc_resampler.h +++ b/webrtc/common_audio/resampler/sinc_resampler.h @@ -15,9 +15,9 @@ #define WEBRTC_COMMON_AUDIO_RESAMPLER_SINC_RESAMPLER_H_ #include "webrtc/base/constructormagic.h" +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/system_wrappers/include/aligned_malloc.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/audio_coding/neteq/nack.h b/webrtc/modules/audio_coding/neteq/nack.h index 17fef46464..f30e459d88 100644 --- a/webrtc/modules/audio_coding/neteq/nack.h +++ b/webrtc/modules/audio_coding/neteq/nack.h @@ -14,9 +14,9 @@ #include #include +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" // // The Nack class keeps track of the lost packets, an estimate of time-to-play diff --git a/webrtc/modules/audio_processing/transient/transient_suppressor.h b/webrtc/modules/audio_processing/transient/transient_suppressor.h index 5a6f117629..489d71b93e 100644 --- a/webrtc/modules/audio_processing/transient/transient_suppressor.h +++ b/webrtc/modules/audio_processing/transient/transient_suppressor.h @@ -14,8 +14,8 @@ #include #include +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/base/scoped_ptr.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe.h b/webrtc/modules/remote_bitrate_estimator/test/bwe.h index 8d29de2619..bd016cf318 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe.h @@ -16,7 +16,7 @@ #include #include -#include "webrtc/test/testsupport/gtest_prod_util.h" +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/modules/remote_bitrate_estimator/test/packet.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h b/webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h index 2be13e0b0b..81df2783dc 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h +++ b/webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h @@ -17,7 +17,7 @@ #include #include "webrtc/base/common.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" +#include "webrtc/base/gtest_prod_util.h" namespace webrtc { namespace testing { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h index 82e2837bbb..3621f9bdfd 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -16,13 +16,13 @@ #include #include +#include "webrtc/base/gtest_prod_util.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" namespace webrtc { diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 3ecd903522..54694b8b64 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -70,7 +70,7 @@ source_set("test_support") { ] deps = [ - "..:gtest_prod", + "../base:gtest_prod", "../system_wrappers", "//testing/gmock", "//testing/gtest", diff --git a/webrtc/test/test.gyp b/webrtc/test/test.gyp index 5bb7793842..5b1e24d2e4 100644 --- a/webrtc/test/test.gyp +++ b/webrtc/test/test.gyp @@ -133,7 +133,7 @@ 'dependencies': [ '<(DEPTH)/testing/gtest.gyp:gtest', '<(DEPTH)/testing/gmock.gyp:gmock', - '<(webrtc_root)/common.gyp:gtest_prod', + '<(webrtc_root)/base/base.gyp:gtest_prod', '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers', ], 'sources': [ diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn index 0daba4d6c8..603e99944c 100644 --- a/webrtc/tools/BUILD.gn +++ b/webrtc/tools/BUILD.gn @@ -20,7 +20,7 @@ source_set("command_line_parser") { "simple_command_line_parser.h", ] deps = [ - "..:gtest_prod", + "../base:gtest_prod", ] configs += [ "..:common_config" ] public_configs = [ "..:common_inherited_config" ] diff --git a/webrtc/tools/internal_tools.gyp b/webrtc/tools/internal_tools.gyp index 61000d1bba..bee8a8bf0e 100644 --- a/webrtc/tools/internal_tools.gyp +++ b/webrtc/tools/internal_tools.gyp @@ -21,7 +21,7 @@ 'simple_command_line_parser.cc', ], 'dependencies': [ - '<(webrtc_root)/common.gyp:gtest_prod', + '<(webrtc_root)/base/base.gyp:gtest_prod', ], }, # command_line_parser ], diff --git a/webrtc/tools/simple_command_line_parser.h b/webrtc/tools/simple_command_line_parser.h index c7bed5cd3a..960038bd9c 100644 --- a/webrtc/tools/simple_command_line_parser.h +++ b/webrtc/tools/simple_command_line_parser.h @@ -16,7 +16,7 @@ #include #include "webrtc/base/constructormagic.h" -#include "webrtc/test/testsupport/gtest_prod_util.h" +#include "webrtc/base/gtest_prod_util.h" // This is a very basic command line parsing class. We pass the command line // arguments and their number and the class forms a vector out of these. Than we