niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tina.legrand@webrtc.org | 16b6b90 | 2012-04-12 11:02:38 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <stdio.h> |
kjellander@webrtc.org | 5490c71 | 2011-12-21 13:34:18 +0000 | [diff] [blame] | 12 | #include <string> |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | #include <vector> |
| 14 | |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 15 | #include "testing/gtest/include/gtest/gtest.h" |
| 16 | #include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h" |
| 17 | #include "webrtc/modules/audio_coding/main/test/APITest.h" |
| 18 | #include "webrtc/modules/audio_coding/main/test/EncodeDecodeTest.h" |
| 19 | #include "webrtc/modules/audio_coding/main/test/iSACTest.h" |
| 20 | #include "webrtc/modules/audio_coding/main/test/opus_test.h" |
| 21 | #include "webrtc/modules/audio_coding/main/test/TestAllCodecs.h" |
| 22 | #include "webrtc/modules/audio_coding/main/test/TestFEC.h" |
| 23 | #include "webrtc/modules/audio_coding/main/test/TestStereo.h" |
| 24 | #include "webrtc/modules/audio_coding/main/test/TestVADDTX.h" |
| 25 | #include "webrtc/modules/audio_coding/main/test/TwoWayCommunication.h" |
| 26 | #include "webrtc/system_wrappers/interface/trace.h" |
| 27 | #include "webrtc/test/testsupport/fileutils.h" |
henrike@webrtc.org | 89c6740 | 2013-08-02 16:53:47 +0000 | [diff] [blame] | 28 | #include "webrtc/test/testsupport/gtest_disable.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 30 | using webrtc::AudioCodingModule; |
| 31 | using webrtc::Trace; |
| 32 | |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 33 | // This parameter is used to describe how to run the tests. It is normally |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame^] | 34 | // set to 0, and all tests are run in quite mode. |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 35 | #define ACM_TEST_MODE 0 |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 37 | TEST(AudioCodingModuleTest, TestAllCodecs) { |
| 38 | Trace::CreateTrace(); |
| 39 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame] | 40 | "acm_allcodecs_trace.txt").c_str()); |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 41 | webrtc::TestAllCodecs(ACM_TEST_MODE).Perform(); |
| 42 | Trace::ReturnTrace(); |
| 43 | } |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame^] | 44 | |
| 45 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestEncodeDecode)) { |
| 46 | Trace::CreateTrace(); |
| 47 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 48 | "acm_encodedecode_trace.txt").c_str()); |
| 49 | webrtc::EncodeDecodeTest(ACM_TEST_MODE).Perform(); |
| 50 | Trace::ReturnTrace(); |
| 51 | } |
| 52 | |
| 53 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestFEC)) { |
| 54 | Trace::CreateTrace(); |
| 55 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 56 | "acm_fec_trace.txt").c_str()); |
| 57 | webrtc::TestFEC().Perform(); |
| 58 | Trace::ReturnTrace(); |
| 59 | } |
| 60 | |
| 61 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestIsac)) { |
| 62 | Trace::CreateTrace(); |
| 63 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 64 | "acm_isac_trace.txt").c_str()); |
| 65 | webrtc::ISACTest(ACM_TEST_MODE).Perform(); |
| 66 | Trace::ReturnTrace(); |
| 67 | } |
| 68 | |
| 69 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TwoWayCommunication)) { |
| 70 | Trace::CreateTrace(); |
| 71 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 72 | "acm_twowaycom_trace.txt").c_str()); |
| 73 | webrtc::TwoWayCommunication(ACM_TEST_MODE).Perform(); |
| 74 | Trace::ReturnTrace(); |
| 75 | } |
| 76 | |
| 77 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestStereo)) { |
| 78 | Trace::CreateTrace(); |
| 79 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 80 | "acm_stereo_trace.txt").c_str()); |
| 81 | webrtc::TestStereo(ACM_TEST_MODE).Perform(); |
| 82 | Trace::ReturnTrace(); |
| 83 | } |
| 84 | |
| 85 | TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestVADDTX)) { |
| 86 | Trace::CreateTrace(); |
| 87 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 88 | "acm_vaddtx_trace.txt").c_str()); |
| 89 | webrtc::TestVADDTX().Perform(); |
| 90 | Trace::ReturnTrace(); |
| 91 | } |
tina.legrand@webrtc.org | 50d5ca5 | 2012-06-18 13:35:52 +0000 | [diff] [blame] | 92 | |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 93 | TEST(AudioCodingModuleTest, TestOpus) { |
| 94 | Trace::CreateTrace(); |
| 95 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame^] | 96 | "acm_opus_trace.txt").c_str()); |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 97 | webrtc::OpusTest().Perform(); |
| 98 | Trace::ReturnTrace(); |
| 99 | } |
| 100 | |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame^] | 101 | // The full API test is too long to run automatically on bots, but can be used |
| 102 | // for offline testing. User interaction is needed. |
| 103 | #ifdef ACM_TEST_FULL_API |
| 104 | TEST(AudioCodingModuleTest, TestAPI) { |
| 105 | Trace::CreateTrace(); |
| 106 | Trace::SetTraceFile((webrtc::test::OutputPath() + |
| 107 | "acm_apitest_trace.txt").c_str()); |
| 108 | webrtc::APITest().Perform(); |
| 109 | Trace::ReturnTrace(); |
tina.legrand@webrtc.org | 5e7ca60 | 2012-06-12 07:16:24 +0000 | [diff] [blame] | 110 | } |
tina.legrand@webrtc.org | ee92b66 | 2013-08-27 07:33:51 +0000 | [diff] [blame^] | 111 | #endif |