OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/voice_engine/test/auto_test/voe_standard_test.h" | 11 #include "webrtc/voice_engine/test/auto_test/voe_standard_test.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 #include "webrtc/system_wrappers/include/event_wrapper.h" | 17 #include "webrtc/system_wrappers/include/event_wrapper.h" |
18 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
19 #include "webrtc/voice_engine/include/voe_neteq_stats.h" | 19 #include "webrtc/voice_engine/include/voe_neteq_stats.h" |
20 #include "webrtc/voice_engine/test/auto_test/automated_mode.h" | 20 #include "webrtc/voice_engine/test/auto_test/automated_mode.h" |
21 #include "webrtc/voice_engine/test/auto_test/voe_cpu_test.h" | |
22 #include "webrtc/voice_engine/test/auto_test/voe_stress_test.h" | 21 #include "webrtc/voice_engine/test/auto_test/voe_stress_test.h" |
23 #include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" | 22 #include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" |
24 #include "webrtc/voice_engine/voice_engine_defines.h" | 23 #include "webrtc/voice_engine/voice_engine_defines.h" |
25 | 24 |
26 DEFINE_bool(include_timing_dependent_tests, true, | 25 DEFINE_bool(include_timing_dependent_tests, true, |
27 "If true, we will include tests / parts of tests that are known " | 26 "If true, we will include tests / parts of tests that are known " |
28 "to break in slow execution environments (such as valgrind)."); | 27 "to break in slow execution environments (such as valgrind)."); |
29 DEFINE_bool(automated, false, | 28 DEFINE_bool(automated, false, |
30 "If true, we'll run the automated tests we have in noninteractive " | 29 "If true, we'll run the automated tests we have in noninteractive " |
31 "mode."); | 30 "mode."); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 voetest::VoETestManager test_manager; | 220 voetest::VoETestManager test_manager; |
222 if (!test_manager.Init()) { | 221 if (!test_manager.Init()) { |
223 return -1; | 222 return -1; |
224 } | 223 } |
225 test_manager.GetInterfaces(); | 224 test_manager.GetInterfaces(); |
226 | 225 |
227 int result = -1; | 226 int result = -1; |
228 if (test_type == Stress) { | 227 if (test_type == Stress) { |
229 VoEStressTest stressTest(test_manager); | 228 VoEStressTest stressTest(test_manager); |
230 result = stressTest.DoTest(); | 229 result = stressTest.DoTest(); |
231 } else if (test_type == CPU) { | |
232 VoECpuTest cpuTest(test_manager); | |
233 result = cpuTest.DoTest(); | |
234 } else { | 230 } else { |
235 // Should never end up here | 231 // Should never end up here |
236 assert(false); | 232 assert(false); |
237 } | 233 } |
238 | 234 |
239 ////////////////// | 235 ////////////////// |
240 // Release/Delete | 236 // Release/Delete |
241 | 237 |
242 int release_ok = test_manager.ReleaseInterfaces(); | 238 int release_ok = test_manager.ReleaseInterfaces(); |
243 | 239 |
(...skipping 13 matching lines...) Expand all Loading... |
257 SubAPIManager api_manager; | 253 SubAPIManager api_manager; |
258 api_manager.DisplayStatus(); | 254 api_manager.DisplayStatus(); |
259 | 255 |
260 printf("----------------------------\n"); | 256 printf("----------------------------\n"); |
261 printf("Select type of test\n\n"); | 257 printf("Select type of test\n\n"); |
262 printf(" (0) Quit\n"); | 258 printf(" (0) Quit\n"); |
263 printf(" (1) Standard test\n"); | 259 printf(" (1) Standard test\n"); |
264 printf(" (2) [OBSOLETE: Extended test(s)...]\n"); | 260 printf(" (2) [OBSOLETE: Extended test(s)...]\n"); |
265 printf(" (3) Stress test(s)...\n"); | 261 printf(" (3) Stress test(s)...\n"); |
266 printf(" (4) [OBSOLETE: Unit test(s)...]\n"); | 262 printf(" (4) [OBSOLETE: Unit test(s)...]\n"); |
267 printf(" (5) CPU & memory reference test [Windows]...\n"); | |
268 printf("\n: "); | 263 printf("\n: "); |
269 | 264 |
270 int selection(0); | 265 int selection(0); |
271 dummy = scanf("%d", &selection); | 266 dummy = scanf("%d", &selection); |
272 | 267 |
273 TestType test_type = Invalid; | 268 TestType test_type = Invalid; |
274 switch (selection) { | 269 switch (selection) { |
275 case 0: | 270 case 0: |
276 return 0; | 271 return 0; |
277 case 1: | 272 case 1: |
278 test_type = Standard; | 273 test_type = Standard; |
279 break; | 274 break; |
280 case 2: | 275 case 2: |
281 break; | 276 break; |
282 case 3: | 277 case 3: |
283 test_type = Stress; | 278 test_type = Stress; |
284 break; | 279 break; |
285 case 4: | 280 case 4: |
286 break; | 281 break; |
287 case 5: | |
288 test_type = CPU; | |
289 break; | |
290 default: | 282 default: |
291 TEST_LOG("Invalid selection!\n"); | 283 TEST_LOG("Invalid selection!\n"); |
292 return 0; | 284 return 0; |
293 } | 285 } |
294 | 286 |
295 if (test_type == Standard) { | 287 if (test_type == Standard) { |
296 TEST_LOG("\n\n+++ Running standard tests +++\n\n"); | 288 TEST_LOG("\n\n+++ Running standard tests +++\n\n"); |
297 | 289 |
298 // Currently, all googletest-rewritten tests are in the "automated" suite. | 290 // Currently, all googletest-rewritten tests are in the "automated" suite. |
299 return RunInAutomatedMode(); | 291 return RunInAutomatedMode(); |
(...skipping 17 matching lines...) Expand all Loading... |
317 google::AllowCommandLineReparsing(); | 309 google::AllowCommandLineReparsing(); |
318 google::ParseCommandLineFlags(&argc, &argv, true); | 310 google::ParseCommandLineFlags(&argc, &argv, true); |
319 | 311 |
320 if (FLAGS_automated) { | 312 if (FLAGS_automated) { |
321 return RunInAutomatedMode(); | 313 return RunInAutomatedMode(); |
322 } | 314 } |
323 | 315 |
324 return RunInManualMode(); | 316 return RunInManualMode(); |
325 } | 317 } |
326 #endif //#if !defined(WEBRTC_IOS) | 318 #endif //#if !defined(WEBRTC_IOS) |
OLD | NEW |