Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398
Review-Url: https://codereview.webrtc.org/2358993004
Cr-Original-Commit-Position: refs/heads/master@{#14425}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 77eab704707e03c74eda3126b92e4ef5e2b7eb4d
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 249c78c..94cf7be 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -106,6 +106,8 @@
testonly = true
sources = [
+ "gmock.h",
+ "gtest.h",
"testsupport/fileutils.cc",
"testsupport/fileutils.h",
"testsupport/frame_reader.cc",
@@ -127,6 +129,7 @@
deps = [
"../base:gtest_prod",
+ "../base:rtc_base_approved",
"../common_video",
"../system_wrappers",
"//testing/gmock",
diff --git a/test/DEPS b/test/DEPS
index e8ed18b..969a10c 100644
--- a/test/DEPS
+++ b/test/DEPS
@@ -12,3 +12,12 @@
"+webrtc/system_wrappers",
"+webrtc/voice_engine",
]
+
+specific_include_rules = {
+ "gmock\.h": [
+ "+testing/gmock/include/gmock",
+ ],
+ "gtest\.h": [
+ "+testing/gtest/include/gtest",
+ ],
+}
diff --git a/test/configurable_frame_size_encoder.cc b/test/configurable_frame_size_encoder.cc
index 831e481..1453418 100644
--- a/test/configurable_frame_size_encoder.cc
+++ b/test/configurable_frame_size_encoder.cc
@@ -12,7 +12,7 @@
#include <string.h>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/common_video/include/video_image.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
diff --git a/test/direct_transport.cc b/test/direct_transport.cc
index 591e154..28a67a4 100644
--- a/test/direct_transport.cc
+++ b/test/direct_transport.cc
@@ -9,7 +9,7 @@
*/
#include "webrtc/test/direct_transport.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/call.h"
#include "webrtc/system_wrappers/include/clock.h"
diff --git a/test/fake_audio_device.cc b/test/fake_audio_device.cc
index 43c2933..220755f 100644
--- a/test/fake_audio_device.cc
+++ b/test/fake_audio_device.cc
@@ -12,7 +12,7 @@
#include <algorithm>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/base/platform_thread.h"
#include "webrtc/modules/media_file/media_file_utility.h"
#include "webrtc/system_wrappers/include/clock.h"
diff --git a/test/fake_decoder.cc b/test/fake_decoder.cc
index ef8f887..103b41c 100644
--- a/test/fake_decoder.cc
+++ b/test/fake_decoder.cc
@@ -10,7 +10,7 @@
#include "webrtc/test/fake_decoder.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
namespace webrtc {
namespace test {
diff --git a/test/fake_encoder.cc b/test/fake_encoder.cc
index d015ab8..3a9ae4e 100644
--- a/test/fake_encoder.cc
+++ b/test/fake_encoder.cc
@@ -12,7 +12,7 @@
#include <algorithm>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/base/checks.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
diff --git a/test/fake_network_pipe_unittest.cc b/test/fake_network_pipe_unittest.cc
index fcc0c93..fa58bf5 100644
--- a/test/fake_network_pipe_unittest.cc
+++ b/test/fake_network_pipe_unittest.cc
@@ -10,8 +10,8 @@
#include <memory>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gmock.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/call.h"
#include "webrtc/system_wrappers/include/clock.h"
diff --git a/test/frame_generator_unittest.cc b/test/frame_generator_unittest.cc
index b375d04..4b90458 100644
--- a/test/frame_generator_unittest.cc
+++ b/test/frame_generator_unittest.cc
@@ -13,7 +13,7 @@
#include <memory>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/frame_generator.h"
#include "webrtc/test/testsupport/fileutils.h"
diff --git a/test/gmock.h b/test/gmock.h
new file mode 100644
index 0000000..bc12fb9
--- /dev/null
+++ b/test/gmock.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016 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.
+ */
+
+#ifndef WEBRTC_TEST_GMOCK_H_
+#define WEBRTC_TEST_GMOCK_H_
+
+#include "webrtc/base/ignore_wundef.h"
+
+RTC_PUSH_IGNORING_WUNDEF()
+#include "testing/gmock/include/gmock/gmock.h"
+RTC_POP_IGNORING_WUNDEF()
+
+#endif // WEBRTC_TEST_GMOCK_H_
diff --git a/test/gtest.h b/test/gtest.h
new file mode 100644
index 0000000..2d222cc
--- /dev/null
+++ b/test/gtest.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016 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.
+ */
+
+#ifndef WEBRTC_TEST_GTEST_H_
+#define WEBRTC_TEST_GTEST_H_
+
+#include "webrtc/base/ignore_wundef.h"
+
+RTC_PUSH_IGNORING_WUNDEF()
+#include "testing/gtest/include/gtest/gtest.h"
+RTC_POP_IGNORING_WUNDEF()
+
+// GTEST_HAS_DEATH_TEST is set to 1 when death tests are supported, but appears
+// to be left unset if they're not supported. Rather than depend on this, we
+// set it to 0 ourselves here.
+#ifndef GTEST_HAS_DEATH_TEST
+#define GTEST_HAS_DEATH_TEST 0
+#endif
+
+#endif // WEBRTC_TEST_GTEST_H_
diff --git a/test/mock_transport.h b/test/mock_transport.h
index 4937134..37a72b3 100644
--- a/test/mock_transport.h
+++ b/test/mock_transport.h
@@ -11,7 +11,7 @@
#ifndef WEBRTC_TEST_MOCK_TRANSPORT_H_
#define WEBRTC_TEST_MOCK_TRANSPORT_H_
-#include "testing/gmock/include/gmock/gmock.h"
+#include "webrtc/test/gmock.h"
#include "webrtc/transport.h"
namespace webrtc {
diff --git a/test/mock_voe_channel_proxy.h b/test/mock_voe_channel_proxy.h
index 069b4f1..40fee1b 100644
--- a/test/mock_voe_channel_proxy.h
+++ b/test/mock_voe_channel_proxy.h
@@ -12,7 +12,7 @@
#define WEBRTC_TEST_MOCK_VOE_CHANNEL_PROXY_H_
#include <string>
-#include "testing/gmock/include/gmock/gmock.h"
+#include "webrtc/test/gmock.h"
#include "webrtc/voice_engine/channel_proxy.h"
namespace webrtc {
diff --git a/test/mock_voice_engine.h b/test/mock_voice_engine.h
index 4118977..85d27bd 100644
--- a/test/mock_voice_engine.h
+++ b/test/mock_voice_engine.h
@@ -13,7 +13,7 @@
#include <memory>
-#include "testing/gmock/include/gmock/gmock.h"
+#include "webrtc/test/gmock.h"
#include "webrtc/test/mock_voe_channel_proxy.h"
#include "webrtc/voice_engine/voice_engine_impl.h"
diff --git a/test/rtp_file_reader_unittest.cc b/test/rtp_file_reader_unittest.cc
index fceac38..0a0d676 100644
--- a/test/rtp_file_reader_unittest.cc
+++ b/test/rtp_file_reader_unittest.cc
@@ -11,7 +11,7 @@
#include <map>
#include <memory>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
#include "webrtc/test/rtp_file_reader.h"
#include "webrtc/test/testsupport/fileutils.h"
diff --git a/test/rtp_file_writer_unittest.cc b/test/rtp_file_writer_unittest.cc
index 3287f97..fa7d79d 100644
--- a/test/rtp_file_writer_unittest.cc
+++ b/test/rtp_file_writer_unittest.cc
@@ -12,7 +12,7 @@
#include <memory>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/rtp_file_reader.h"
#include "webrtc/test/rtp_file_writer.h"
#include "webrtc/test/testsupport/fileutils.h"
diff --git a/test/rtp_rtcp_observer.h b/test/rtp_rtcp_observer.h
index ab86561..72bcdda 100644
--- a/test/rtp_rtcp_observer.h
+++ b/test/rtp_rtcp_observer.h
@@ -14,7 +14,7 @@
#include <memory>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/event.h"
diff --git a/test/test.gyp b/test/test.gyp
index ae36da8..1d476a9 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -78,10 +78,13 @@
'<(DEPTH)/testing/gtest.gyp:gtest',
'<(DEPTH)/testing/gmock.gyp:gmock',
'<(webrtc_root)/base/base.gyp:gtest_prod',
+ '<(webrtc_root)/base/base.gyp:rtc_base_approved',
'<(webrtc_root)/common_video/common_video.gyp:common_video',
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
],
'sources': [
+ 'gmock.h',
+ 'gtest.h',
'testsupport/fileutils.cc',
'testsupport/fileutils.h',
'testsupport/frame_reader.cc',
diff --git a/test/test_main.cc b/test/test_main.cc
index a92ad9f..df7a82f 100644
--- a/test/test_main.cc
+++ b/test/test_main.cc
@@ -9,7 +9,7 @@
*/
#include "gflags/gflags.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/base/logging.h"
#include "webrtc/system_wrappers/include/metrics_default.h"
#include "webrtc/test/field_trial.h"
diff --git a/test/test_suite.cc b/test/test_suite.cc
index 69e4a57..174de02 100644
--- a/test/test_suite.cc
+++ b/test/test_suite.cc
@@ -11,8 +11,8 @@
#include "webrtc/test/test_suite.h"
#include "gflags/gflags.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gmock.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/base/logging.h"
#include "webrtc/system_wrappers/include/metrics_default.h"
#include "webrtc/test/testsupport/fileutils.h"
diff --git a/test/testsupport/always_passing_unittest.cc b/test/testsupport/always_passing_unittest.cc
index afb80e6..79a4869 100644
--- a/test/testsupport/always_passing_unittest.cc
+++ b/test/testsupport/always_passing_unittest.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
namespace webrtc {
diff --git a/test/testsupport/fileutils_unittest.cc b/test/testsupport/fileutils_unittest.cc
index e205db3..2677b8c 100644
--- a/test/testsupport/fileutils_unittest.cc
+++ b/test/testsupport/fileutils_unittest.cc
@@ -15,7 +15,7 @@
#include <list>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#ifdef WIN32
#define chdir _chdir
diff --git a/test/testsupport/frame_reader_unittest.cc b/test/testsupport/frame_reader_unittest.cc
index 25ea913..8b16926 100644
--- a/test/testsupport/frame_reader_unittest.cc
+++ b/test/testsupport/frame_reader_unittest.cc
@@ -10,7 +10,7 @@
#include "webrtc/test/testsupport/frame_reader.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
namespace webrtc {
diff --git a/test/testsupport/frame_writer_unittest.cc b/test/testsupport/frame_writer_unittest.cc
index da1e268..59173bd 100644
--- a/test/testsupport/frame_writer_unittest.cc
+++ b/test/testsupport/frame_writer_unittest.cc
@@ -10,7 +10,7 @@
#include "webrtc/test/testsupport/frame_writer.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
namespace webrtc {
diff --git a/test/testsupport/metrics/video_metrics_unittest.cc b/test/testsupport/metrics/video_metrics_unittest.cc
index 0958dcf..83a34a3 100644
--- a/test/testsupport/metrics/video_metrics_unittest.cc
+++ b/test/testsupport/metrics/video_metrics_unittest.cc
@@ -10,7 +10,7 @@
#include "webrtc/test/testsupport/metrics/video_metrics.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
namespace webrtc {
diff --git a/test/testsupport/mock/mock_frame_reader.h b/test/testsupport/mock/mock_frame_reader.h
index f06750e..8d1c669 100644
--- a/test/testsupport/mock/mock_frame_reader.h
+++ b/test/testsupport/mock/mock_frame_reader.h
@@ -13,7 +13,7 @@
#include "webrtc/test/testsupport/frame_reader.h"
-#include "testing/gmock/include/gmock/gmock.h"
+#include "webrtc/test/gmock.h"
namespace webrtc {
namespace test {
diff --git a/test/testsupport/mock/mock_frame_writer.h b/test/testsupport/mock/mock_frame_writer.h
index 10f58fb..8ba96bc 100644
--- a/test/testsupport/mock/mock_frame_writer.h
+++ b/test/testsupport/mock/mock_frame_writer.h
@@ -13,7 +13,7 @@
#include "webrtc/test/testsupport/frame_writer.h"
-#include "testing/gmock/include/gmock/gmock.h"
+#include "webrtc/test/gmock.h"
namespace webrtc {
namespace test {
diff --git a/test/testsupport/packet_reader_unittest.cc b/test/testsupport/packet_reader_unittest.cc
index 2679be4..ded1db3 100644
--- a/test/testsupport/packet_reader_unittest.cc
+++ b/test/testsupport/packet_reader_unittest.cc
@@ -10,7 +10,7 @@
#include "webrtc/test/testsupport/packet_reader.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/unittest_utils.h"
namespace webrtc {
diff --git a/test/testsupport/perf_test_unittest.cc b/test/testsupport/perf_test_unittest.cc
index f7e50e1..4516b99 100644
--- a/test/testsupport/perf_test_unittest.cc
+++ b/test/testsupport/perf_test_unittest.cc
@@ -12,7 +12,7 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/gtest.h"
namespace webrtc {
namespace test {