diff --git a/src/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi b/src/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi index b096d4d4d9..3e511c8fa6 100644 --- a/src/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi +++ b/src/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi @@ -9,49 +9,20 @@ { 'targets': [ { - 'target_name': 'rtp_format_vp8_unittest', - 'type': 'executable', - 'dependencies': [ - 'rtp_rtcp', - '../../testing/gtest.gyp:gtest', - '../../testing/gtest.gyp:gtest_main', - ], - 'include_dirs': [ - '.', - ], - 'sources': [ - 'rtp_format_vp8_unittest.cc', - ], - }, - { - 'target_name': 'rtcp_format_remb_unittest', + 'target_name': 'rtp_rtcp_unittests', 'type': 'executable', 'dependencies': [ 'rtp_rtcp', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support_main', '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', - '../../testing/gtest.gyp:gtest', - '../../testing/gtest.gyp:gtest_main', ], 'include_dirs': [ - '.', '../../../', ], 'sources': [ + 'rtp_format_vp8_unittest.cc', 'rtcp_format_remb_unittest.cc', - ], - }, - { - 'target_name': 'rtp_utility_test', - 'type': 'executable', - 'dependencies': [ - 'rtp_rtcp', - '../../testing/gtest.gyp:gtest', - '../../testing/gtest.gyp:gtest_main', - ], - 'include_dirs': [ - '.', - ], - 'sources': [ 'rtp_utility_test.cc', ], }, diff --git a/src/modules/rtp_rtcp/test/test_bwe/test_bwe.gypi b/src/modules/rtp_rtcp/test/test_bwe/test_bwe.gypi index 1165b7d560..d165e7d501 100644 --- a/src/modules/rtp_rtcp/test/test_bwe/test_bwe.gypi +++ b/src/modules/rtp_rtcp/test/test_bwe/test_bwe.gypi @@ -13,9 +13,9 @@ 'type': 'executable', 'dependencies': [ 'rtp_rtcp', - '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', + '<(webrtc_root)/../test/test.gyp:test_support_main', '<(webrtc_root)/../testing/gtest.gyp:gtest', - '<(webrtc_root)/../testing/gtest.gyp:gtest_main', + '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', ], 'include_dirs': [ '../../source', 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 298c75e18f..65cdd30688 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 @@ -23,12 +23,10 @@ 'include_dirs': [ '../interface', '<(webrtc_root)/common_video/interface', - '<(webrtc_root)/../testing/gtest/include', ], 'direct_dependent_settings': { 'include_dirs': [ '../interface', - '<(webrtc_root)/../testing/gtest/include', ], }, 'sources': [ diff --git a/src/modules/video_coding/main/source/video_coding_test.gypi b/src/modules/video_coding/main/source/video_coding_test.gypi index 0d004fcec6..91c8c6472c 100644 --- a/src/modules/video_coding/main/source/video_coding_test.gypi +++ b/src/modules/video_coding/main/source/video_coding_test.gypi @@ -11,10 +11,6 @@ { 'target_name': 'video_coding_test_lib', 'type': '<(library)', - 'dependencies': [ - ], - 'include_dirs': [ - ], 'direct_dependent_settings': { 'include_dirs': [ '../test', @@ -46,7 +42,6 @@ '../source', ], 'sources': [ - # headers '../test/codec_database_test.h', '../test/generic_codec_test.h', @@ -80,27 +75,23 @@ '../test/video_rtp_play_mt.cc', '../test/video_rtp_play.cc', '../test/video_source.cc', - ], # source - 'conditions': [ - ['OS=="linux"', { 'cflags': [ '-fexceptions', ], }], - ], # conditions }, { - 'target_name': 'video_coding_unit_test', + 'target_name': 'video_coding_unittests', 'type': 'executable', 'dependencies': [ 'webrtc_video_coding', - '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', + '<(webrtc_root)/../test/test.gyp:test_support_main', '<(webrtc_root)/../testing/gtest.gyp:gtest', - '<(webrtc_root)/../testing/gtest.gyp:gtest_main', + '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', ], 'include_dirs': [ '../../../interface', diff --git a/src/modules/video_processing/main/test/unit_test/unit_test.cc b/src/modules/video_processing/main/test/unit_test/unit_test.cc index 1ce06541c2..ba6c7c621c 100644 --- a/src/modules/video_processing/main/test/unit_test/unit_test.cc +++ b/src/modules/video_processing/main/test/unit_test/unit_test.cc @@ -372,6 +372,9 @@ void TestSize(VideoFrame& sourceFrame, WebRtc_UWord32 targetWidth, fclose(standAloneFile); } +// TODO(kjellander): Get rid of this main and use test_support_main instead +// This can be done by inheriting TestSuite instead of testing::Test and +// override Initialize(). int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/src/modules/video_processing/main/test/vpm_tests.gypi b/src/modules/video_processing/main/test/vpm_tests.gypi index 92b47ae751..cabce77252 100644 --- a/src/modules/video_processing/main/test/vpm_tests.gypi +++ b/src/modules/video_processing/main/test/vpm_tests.gypi @@ -9,22 +9,19 @@ { 'targets': [ { - 'target_name': 'VPMUnitTest', + 'target_name': 'video_processing_unittests', 'type': 'executable', 'dependencies': [ - 'video_processing', - 'webrtc_utility', - # The tests are based on gtest - '../../testing/gtest.gyp:gtest', - '../../testing/gtest.gyp:gtest_main', + 'video_processing', + 'webrtc_utility', + '<(webrtc_root)/../testing/gtest.gyp:gtest', ], 'include_dirs': [ - '../../../../system_wrappers/interface', - '../../../../common_video/vplib/main/interface', - '../../../../modules/video_processing/main/source', + '../../../../system_wrappers/interface', + '../../../../common_video/vplib/main/interface', + '../../../../modules/video_processing/main/source', ], 'sources': [ - # headers 'unit_test/unit_test.h', @@ -35,17 +32,13 @@ 'unit_test/deflickering_test.cc', 'unit_test/denoising_test.cc', 'unit_test/unit_test.cc', - ], # source - 'conditions': [ - ['OS=="linux"', { 'cflags': [ '-fexceptions', ], }], - ], # conditions }, ], diff --git a/test/test.gyp b/test/test.gyp index a55f56c8ff..5177fa2497 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -18,7 +18,7 @@ 'dependencies': [ '<(webrtc_root)/../testing/gtest.gyp:gtest', ], - 'direct_dependent_settings': { + 'all_dependent_settings': { 'include_dirs': [ '.', ], @@ -30,15 +30,26 @@ 'testsupport/fileutils.cc', ], }, + { + # Depend on this target when you want to have test_support but also the + # main method needed for gtest to execute! + 'target_name': 'test_support_main', + 'type': 'static_library', + 'dependencies': [ + 'test_support', + ], + 'sources': [ + 'run_all_unittests.cc', + ], + }, { 'target_name': 'test_support_unittests', 'type': 'executable', 'dependencies': [ - 'test_support', + 'test_support_main', '<(webrtc_root)/../testing/gtest.gyp:gtest', ], - 'sources': [ - 'run_all_unittests.cc', + 'sources': [ 'testsupport/fileutils_unittest.cc', ], },