diff --git a/src/common_audio/common_audio.gyp b/src/common_audio/common_audio.gyp index e9e23caa74..f64dfbf1d3 100644 --- a/src/common_audio/common_audio.gyp +++ b/src/common_audio/common_audio.gyp @@ -20,13 +20,12 @@ 'target_name': 'common_audio_unittests', 'type': 'executable', 'dependencies': [ - '<(webrtc_root)/../test/test.gyp:test_support', + '<(webrtc_root)/../test/test.gyp:test_support_main', '<(webrtc_root)/../testing/gtest.gyp:gtest', 'resampler', 'vad', ], 'sources': [ - '<(webrtc_root)/../test/run_all_unittests.cc', 'resampler/main/source/resampler_unittest.cc', 'vad/test/vad_unittest.cc', ], diff --git a/src/modules/video_coding/codecs/test/run_all_unittests.cc b/src/modules/video_coding/codecs/test/run_all_unittests.cc deleted file mode 100644 index e6a5c09576..0000000000 --- a/src/modules/video_coding/codecs/test/run_all_unittests.cc +++ /dev/null @@ -1,17 +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. - */ -#include "gmock/gmock.h" -#include "test/test_suite.h" - -int main(int argc, char** argv) { - ::testing::InitGoogleMock(&argc, argv); - webrtc::TestSuite test_suite(argc, argv); - return test_suite.Run(); -} diff --git a/src/modules/video_coding/codecs/test/video_codecs_test_framework.gypi b/src/modules/video_coding/codecs/test/video_codecs_test_framework.gypi index 65cdd30688..f3560a6f73 100644 --- a/src/modules/video_coding/codecs/test/video_codecs_test_framework.gypi +++ b/src/modules/video_coding/codecs/test/video_codecs_test_framework.gypi @@ -55,12 +55,12 @@ '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', '<(webrtc_root)/common_video/common_video.gyp:webrtc_vplib', '<(webrtc_root)/../testing/gmock.gyp:gmock', - '<(webrtc_root)/../test/test.gyp:test_support', + '<(webrtc_root)/../test/test.gyp:test_support_main', ], 'include_dirs': [ '<(webrtc_root)/common_video/interface', - ], - 'sources': [ + ], + 'sources': [ # header files 'mocks.h', @@ -68,8 +68,6 @@ 'file_handler_unittest.cc', 'packet_manipulator_unittest.cc', 'packet_reader_unittest.cc', - # cannot use the global run all file until it supports gmock: - 'run_all_unittests.cc', 'stats_unittest.cc', 'videoprocessor_unittest.cc', ], diff --git a/test/run_all_unittests.cc b/test/run_all_unittests.cc index d8f3dd8442..0cdf0cd030 100644 --- a/test/run_all_unittests.cc +++ b/test/run_all_unittests.cc @@ -11,6 +11,6 @@ #include "test/test_suite.h" int main(int argc, char** argv) { - webrtc::TestSuite test_suite(argc, argv); + webrtc::test::TestSuite test_suite(argc, argv); return test_suite.Run(); } diff --git a/test/test.gyp b/test/test.gyp index 5177fa2497..b010f1eb96 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -17,6 +17,7 @@ 'type': 'static_library', 'dependencies': [ '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../testing/gmock.gyp:gmock', ], 'all_dependent_settings': { 'include_dirs': [ diff --git a/test/test_suite.cc b/test/test_suite.cc index 05cfcc43da..ac3f3a23c7 100644 --- a/test/test_suite.cc +++ b/test/test_suite.cc @@ -10,11 +10,13 @@ #include "test/test_suite.h" +#include "gmock/gmock.h" #include "gtest/gtest.h" namespace webrtc { +namespace test { TestSuite::TestSuite(int argc, char** argv) { - testing::InitGoogleTest(&argc, argv); + testing::InitGoogleMock(&argc, argv); // Runs InitGoogleTest() internally. } TestSuite::~TestSuite() { @@ -33,4 +35,5 @@ void TestSuite::Initialize() { void TestSuite::Shutdown() { } +} // namespace test } // namespace webrtc diff --git a/test/test_suite.h b/test/test_suite.h index 580565c174..f500daaec3 100644 --- a/test/test_suite.h +++ b/test/test_suite.h @@ -20,6 +20,7 @@ #include "src/system_wrappers/interface/constructor_magic.h" namespace webrtc { +namespace test { class TestSuite { public: TestSuite(int argc, char** argv); @@ -35,6 +36,7 @@ class TestSuite { DISALLOW_COPY_AND_ASSIGN(TestSuite); }; +} // namespace test } // namespace webrtc #endif // TEST_TEST_SUITE_H_ diff --git a/test/testsupport/fileutils.h b/test/testsupport/fileutils.h index f6149de6e3..becf56aa9d 100644 --- a/test/testsupport/fileutils.h +++ b/test/testsupport/fileutils.h @@ -19,7 +19,7 @@ // // Example use: // Assume we have the following code being used in a test source file: -// const std::string kInputFile = webrtc::testing::GetProjectRootPath() + +// const std::string kInputFile = webrtc::test::GetProjectRootPath() + // "test/data/voice_engine/audio_long16.wav"; // // Use the kInputFile for the tests... //