From d492f72e4362554456963534f00a8cf4f4efba74 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Thu, 24 Nov 2011 07:20:00 +0000 Subject: [PATCH] Added empty unit tests to get code coverage measured. In order to get code coverage recorded, there must be an executing test that is linked to the code to measure. These projects are currently not showing up in the code coverage. Review URL: http://webrtc-codereview.appspot.com/293002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1010 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../source/audio_conference_mixer.gypi | 21 ++++++++++++++++++- .../source/audio_conference_mixer_unittest.cc | 17 +++++++++++++++ src/modules/media_file/source/media_file.gypi | 20 +++++++++++++++++- .../media_file/source/media_file_unittest.cc | 17 +++++++++++++++ .../udp_transport/source/udp_transport.gypi | 18 ++++++++++++++++ .../source/udp_transport_unittest.cc | 17 +++++++++++++++ .../utility/source/file_player_unittest.cc | 17 +++++++++++++++ src/modules/utility/source/utility.gypi | 20 +++++++++++++++++- 8 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 src/modules/audio_conference_mixer/source/audio_conference_mixer_unittest.cc create mode 100644 src/modules/media_file/source/media_file_unittest.cc create mode 100644 src/modules/udp_transport/source/udp_transport_unittest.cc create mode 100644 src/modules/utility/source/file_player_unittest.cc diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer.gypi b/src/modules/audio_conference_mixer/source/audio_conference_mixer.gypi index 6292b1c74..fd116c65a 100644 --- a/src/modules/audio_conference_mixer/source/audio_conference_mixer.gypi +++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer.gypi @@ -41,7 +41,26 @@ 'time_scheduler.h', ], }, - ], + ], # targets + 'conditions': [ + ['build_with_chromium==0', { + 'targets': [ + { + 'target_name': 'audio_conference_mixer_unittests', + 'type': 'executable', + 'dependencies': [ + 'audio_conference_mixer', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support_main', + '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', + ], + 'sources': [ + 'audio_conference_mixer_unittest.cc', + ], + }, # audio_conference_mixer_unittests + ], # targets + }], # build_with_chromium + ], # conditions } # Local Variables: diff --git a/src/modules/audio_conference_mixer/source/audio_conference_mixer_unittest.cc b/src/modules/audio_conference_mixer/source/audio_conference_mixer_unittest.cc new file mode 100644 index 000000000..f895fbd6e --- /dev/null +++ b/src/modules/audio_conference_mixer/source/audio_conference_mixer_unittest.cc @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* + * Empty test just to get code coverage metrics for this dir. + */ +#include "audio_conference_mixer.h" +#include "gtest/gtest.h" + +TEST(AudioConferenceMixerTest, EmptyTestToGetCodeCoverage) {} diff --git a/src/modules/media_file/source/media_file.gypi b/src/modules/media_file/source/media_file.gypi index c94679fb8..2f9ffe926 100644 --- a/src/modules/media_file/source/media_file.gypi +++ b/src/modules/media_file/source/media_file.gypi @@ -39,7 +39,25 @@ 'media_file_utility.h', ], # source }, - ], + ], # targets + 'conditions': [ + ['build_with_chromium==0', { + 'targets': [ + { + 'target_name': 'media_file_unittests', + 'type': 'executable', + 'dependencies': [ + 'media_file', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support_main', + ], + 'sources': [ + 'media_file_unittest.cc', + ], + }, # media_file_unittests + ], # targets + }], # build_with_chromium + ], # conditions } # Local Variables: diff --git a/src/modules/media_file/source/media_file_unittest.cc b/src/modules/media_file/source/media_file_unittest.cc new file mode 100644 index 000000000..86f37f3f1 --- /dev/null +++ b/src/modules/media_file/source/media_file_unittest.cc @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* + * Empty test just to get code coverage metrics for this dir. + */ +#include "media_file.h" +#include "gtest/gtest.h" + +TEST(MediaFileTest, EmptyTestToGetCodeCoverage) {} diff --git a/src/modules/udp_transport/source/udp_transport.gypi b/src/modules/udp_transport/source/udp_transport.gypi index 54a19d38b..c30e167ab 100644 --- a/src/modules/udp_transport/source/udp_transport.gypi +++ b/src/modules/udp_transport/source/udp_transport.gypi @@ -93,6 +93,24 @@ ] # conditions }, ], # targets + 'conditions': [ + ['build_with_chromium==0', { + 'targets': [ + { + 'target_name': 'udp_transport_unittests', + 'type': 'executable', + 'dependencies': [ + 'udp_transport', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support_main', + ], + 'sources': [ + 'udp_transport_unittest.cc', + ], + }, # udp_transport_unittests + ], # targets + }], # build_with_chromium + ], # conditions } # Local Variables: diff --git a/src/modules/udp_transport/source/udp_transport_unittest.cc b/src/modules/udp_transport/source/udp_transport_unittest.cc new file mode 100644 index 000000000..b8944355c --- /dev/null +++ b/src/modules/udp_transport/source/udp_transport_unittest.cc @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* + * Empty test just to get code coverage metrics for this dir. + */ +#include "udp_transport.h" +#include "gtest/gtest.h" + +TEST(UDPTransportTest, EmptyTestToGetCodeCoverage) {} diff --git a/src/modules/utility/source/file_player_unittest.cc b/src/modules/utility/source/file_player_unittest.cc new file mode 100644 index 000000000..2e76905d8 --- /dev/null +++ b/src/modules/utility/source/file_player_unittest.cc @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* + * Empty test just to get code coverage metrics for this dir. + */ +#include "file_player.h" +#include "gtest/gtest.h" + +TEST(FilePlayerTest, EmptyTestToGetCodeCoverage) {} diff --git a/src/modules/utility/source/utility.gypi b/src/modules/utility/source/utility.gypi index 8230d7e7c..ab8af6833 100644 --- a/src/modules/utility/source/utility.gypi +++ b/src/modules/utility/source/utility.gypi @@ -65,7 +65,25 @@ }], ], }, - ], + ], # targets + 'conditions': [ + ['build_with_chromium==0', { + 'targets': [ + { + 'target_name': 'webrtc_utility_unittests', + 'type': 'executable', + 'dependencies': [ + 'webrtc_utility', + '<(webrtc_root)/../testing/gtest.gyp:gtest', + '<(webrtc_root)/../test/test.gyp:test_support_main', + ], + 'sources': [ + 'file_player_unittest.cc', + ], + }, # webrtc_utility_unittests + ], # targets + }], # build_with_chromium + ], # conditions } # Local Variables: