Changing usage of gtest_main target, to use test_support_main instead.

Review URL: http://webrtc-codereview.appspot.com/252002

git-svn-id: http://webrtc.googlecode.com/svn/trunk@884 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org
2011-11-03 23:28:47 +00:00
parent 89088b963e
commit 1a8d08ad76
7 changed files with 34 additions and 67 deletions

View File

@ -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',
],
},

View File

@ -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',

View File

@ -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': [

View File

@ -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',

View File

@ -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);

View File

@ -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
},
],

View File

@ -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',
],
},