Adds all unittests to android NDK-APK framework.

BUG=N/A
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1872004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4474 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org
2013-08-02 16:53:47 +00:00
parent 51b2459d37
commit 89c674053e
24 changed files with 580 additions and 90 deletions

View File

@@ -25,6 +25,7 @@
#include "webrtc/modules/audio_coding/main/test/TwoWayCommunication.h"
#include "webrtc/system_wrappers/interface/trace.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
using webrtc::AudioCodingModule;
using webrtc::Trace;
@@ -136,7 +137,7 @@ TEST(AudioCodingModuleTest, TestOpus) {
Trace::ReturnTrace();
}
TEST(AudioCodingModuleTest, RunAllTests) {
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(RunAllTests)) {
std::vector<ACMTest*> tests;
PopulateTests(&tests);
std::vector<ACMTest*>::iterator it;

View File

@@ -16,6 +16,7 @@
#include "scoped_ptr.h"
#include "testsupport/fileutils.h"
#include "typedefs.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
@@ -383,91 +384,105 @@ int32_t DualStreamTest::SendData(FrameType frameType, uint8_t payload_type,
}
// Mono input, mono primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimaryWb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb20Ms)) {
InitializeSender(20, 1, 16000);
Perform(true, 1);
}
// Mono input, stereo primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncMonoInput_StereoPrimaryWb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInput_StereoPrimaryWb20Ms)) {
InitializeSender(20, 2, 16000);
Perform(true, 1);
}
// Mono input, mono primary SWB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimarySwb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimarySwb20Ms)) {
InitializeSender(20, 1, 32000);
Perform(true, 1);
}
// Mono input, stereo primary SWB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncMonoInputStereoPrimarySwb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimarySwb20Ms)) {
InitializeSender(20, 2, 32000);
Perform(true, 1);
}
// Mono input, mono primary WB 40 ms frame.
TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimaryWb40Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb40Ms)) {
InitializeSender(40, 1, 16000);
Perform(true, 1);
}
// Mono input, stereo primary WB 40 ms frame
TEST_F(DualStreamTest, BitExactSyncMonoInputStereoPrimaryWb40Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimaryWb40Ms)) {
InitializeSender(40, 2, 16000);
Perform(true, 1);
}
// Stereo input, mono primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimaryWb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb20Ms)) {
InitializeSender(20, 1, 16000);
Perform(true, 2);
}
// Stereo input, stereo primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimaryWb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb20Ms)) {
InitializeSender(20, 2, 16000);
Perform(true, 2);
}
// Stereo input, mono primary SWB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimarySwb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimarySwb20Ms)) {
InitializeSender(20, 1, 32000);
Perform(true, 2);
}
// Stereo input, stereo primary SWB 20 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimarySwb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimarySwb20Ms)) {
InitializeSender(20, 2, 32000);
Perform(true, 2);
}
// Stereo input, mono primary WB 40 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimaryWb40Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb40Ms)) {
InitializeSender(40, 1, 16000);
Perform(true, 2);
}
// Stereo input, stereo primary WB 40 ms frame.
TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimaryWb40Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb40Ms)) {
InitializeSender(40, 2, 16000);
Perform(true, 2);
}
// Asynchronous test, ACM is fed with data then secondary coder is registered.
// Mono input, mono primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactAsyncMonoInputMonoPrimaryWb20Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb20Ms)) {
InitializeSender(20, 1, 16000);
Perform(false, 1);
}
// Mono input, mono primary WB 20 ms frame.
TEST_F(DualStreamTest, BitExactAsyncMonoInputMonoPrimaryWb40Ms) {
TEST_F(DualStreamTest,
DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb40Ms)) {
InitializeSender(40, 1, 16000);
Perform(false, 1);
}
TEST_F(DualStreamTest, Api) {
TEST_F(DualStreamTest, DISABLED_ON_ANDROID(Api)) {
PopulateCodecInstances(20, 1, 16000);
CodecInst my_codec;
ASSERT_EQ(0, acm_dual_stream_->InitializeSender());

View File

@@ -25,6 +25,7 @@
#include "webrtc/modules/audio_coding/main/test/utility.h"
#include "webrtc/system_wrappers/interface/event_wrapper.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
@@ -129,38 +130,38 @@ class InitialPlayoutDelayTest : public ::testing::Test {
Channel* channel_a2b_;
};
TEST_F( InitialPlayoutDelayTest, NbMono) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(NbMono)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 8000, 1);
Run(codec, 3000);
}
TEST_F( InitialPlayoutDelayTest, WbMono) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(WbMono)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 16000, 1);
Run(codec, 3000);
}
TEST_F( InitialPlayoutDelayTest, SwbMono) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(SwbMono)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 32000, 1);
Run(codec, 2000); // NetEq buffer is not sufficiently large for 3 sec of
// PCM16 super-wideband.
}
TEST_F( InitialPlayoutDelayTest, NbStereo) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(NbStereo)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 8000, 2);
Run(codec, 3000);
}
TEST_F( InitialPlayoutDelayTest, WbStereo) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(WbStereo)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 16000, 2);
Run(codec, 3000);
}
TEST_F( InitialPlayoutDelayTest, SwbStereo) {
TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(SwbStereo)) {
CodecInst codec;
AudioCodingModule::Codec("L16", &codec, 32000, 2);
Run(codec, 2000); // NetEq buffer is not sufficiently large for 3 sec of

View File

@@ -14,6 +14,7 @@
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/system_wrappers/interface/sleep.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
class TargetDelayTest : public ::testing::Test {
@@ -107,12 +108,12 @@ class TargetDelayTest : public ::testing::Test {
WebRtcRTPHeader rtp_info_;
};
TEST_F(TargetDelayTest, OutOfRangeInput) {
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(OutOfRangeInput)) {
EXPECT_EQ(-1, SetMinimumDelay(-1));
EXPECT_EQ(-1, SetMinimumDelay(10001));
}
TEST_F(TargetDelayTest, NoTargetDelayBufferSizeChanges) {
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(NoTargetDelayBufferSizeChanges)) {
for (int n = 0; n < 30; ++n) // Run enough iterations.
Run(true);
int clean_optimal_delay = GetCurrentOptimalDelayMs();
@@ -124,7 +125,7 @@ TEST_F(TargetDelayTest, NoTargetDelayBufferSizeChanges) {
EXPECT_NEAR(required_delay, jittery_optimal_delay, 1);
}
TEST_F(TargetDelayTest, WithTargetDelayBufferNotChanging) {
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(WithTargetDelayBufferNotChanging)) {
// A target delay that is one packet larger than jitter.
const int kTargetDelayMs = (kInterarrivalJitterPacket + 1) *
kNum10msPerFrame * 10;
@@ -138,7 +139,7 @@ TEST_F(TargetDelayTest, WithTargetDelayBufferNotChanging) {
EXPECT_EQ(jittery_optimal_delay, clean_optimal_delay);
}
TEST_F(TargetDelayTest, RequiredDelayAtCorrectRange) {
TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(RequiredDelayAtCorrectRange)) {
for (int n = 0; n < 30; ++n) // Run clean and store delay.
Run(true);
int clean_optimal_delay = GetCurrentOptimalDelayMs();

View File

@@ -89,7 +89,7 @@
'targets': [
{
'target_name': 'neteq_unittests',
'type': 'executable',
'type': '<(gtest_target_type)',
'dependencies': [
'NetEq',
'NetEqTestTools',
@@ -104,6 +104,15 @@
'msvs_disabled_warnings': [
4267, # size_t to int truncation.
],
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are
# using Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'dependencies': [
'<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
],
}],
],
}, # neteq_unittests
{
'target_name': 'NetEqRTPplay',
@@ -208,6 +217,21 @@
],
},
], # targets
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are using
# Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'targets': [
{
'target_name': 'neteq_unittests_apk_target',
'type': 'none',
'dependencies': [
'<(apk_tests_path):neteq_unittests_apk',
],
},
],
}],
],
}], # include_tests
], # conditions
}

View File

@@ -375,7 +375,7 @@ void NetEqDecodingTest::PopulateCng(int frame_index,
*payload_len = 1; // Only noise level, no spectral parameters.
}
#if defined(_WIN32) && defined(WEBRTC_ARCH_64_BITS)
#if (defined(_WIN32) && defined(WEBRTC_ARCH_64_BITS)) || defined(WEBRTC_ANDROID)
// Disabled for Windows 64-bit until webrtc:1460 is fixed.
#define MAYBE_TestBitExactness DISABLED_TestBitExactness
#else

View File

@@ -124,7 +124,7 @@
'targets': [
{
'target_name': 'audio_decoder_unittests',
'type': 'executable',
'type': '<(gtest_target_type)',
'dependencies': [
'<@(neteq_dependencies)',
'<(DEPTH)/testing/gtest.gyp:gtest',
@@ -147,6 +147,15 @@
'audio_decoder.cc',
'interface/audio_decoder.h',
],
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are
# using Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'dependencies': [
'<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
],
}],
],
# Disable warnings to enable Win64 build, issue 1323.
'msvs_disabled_warnings': [
4267, # size_t to int truncation.
@@ -181,6 +190,21 @@
],
}, # neteq_unittest_tools
], # targets
'conditions': [
# TODO(henrike): remove build_with_chromium==1 when the bots are using
# Chromium's buildbots.
['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
'targets': [
{
'target_name': 'audio_decoder_unittests_apk_target',
'type': 'none',
'dependencies': [
'<(apk_tests_path):audio_decoder_unittests_apk',
],
},
],
}],
],
}], # include_tests
], # conditions
}