Changeset 89174 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- May 19, 2021 3:05:29 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144515
- Location:
- trunk/src/VBox/ValidationKit/utils/audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/Makefile.kmk
r89126 r89174 61 61 $(VKAT_PATH_AUDIO)/AudioHlp.cpp 62 62 63 # Self-test stuff. 64 AudioTest_SOURCES += \ 65 $(VKAT_PATH_AUDIO)/DrvHostAudioValidationKit.cpp \ 66 $(VKAT_PATH_AUDIO)/AudioTestService.cpp \ 67 $(VKAT_PATH_AUDIO)/AudioTestServiceProtocol.cpp \ 68 $(VKAT_PATH_AUDIO)/AudioTestServiceTcp.cpp 69 63 70 ifdef VBOX_WITH_AUDIO_PULSE 64 71 AudioTest_DEFS += VBOX_WITH_AUDIO_PULSE -
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r89143 r89174 65 65 #include "../../../Devices/Audio/AudioHlp.h" 66 66 #include "../../../Devices/Audio/AudioTest.h" 67 #include "../../../Devices/Audio/AudioTestService.h" 67 68 #include "VBoxDD.h" 68 69 … … 2460 2461 } 2461 2462 2463 /** 2464 * Command line parameters for self-test mode. 2465 */ 2466 static const RTGETOPTDEF g_aCmdSelftestOptions[] = 2467 { 2468 { "--backend", 'b', RTGETOPT_REQ_STRING }, 2469 { "--with-drv-audio", 'd', RTGETOPT_REQ_NOTHING }, 2470 }; 2471 2472 /** the 'selftest' command option help. */ 2473 static DECLCALLBACK(const char *) audioTestCmdSelftestHelp(PCRTGETOPTDEF pOpt) 2474 { 2475 switch (pOpt->iShort) 2476 { 2477 case 'b': return "The audio backend to use."; 2478 case 'd': return "Go via DrvAudio instead of directly interfacing with the backend."; 2479 default: return NULL; 2480 } 2481 } 2482 2483 /** 2484 * Main function for performing the self-tests. 2485 * 2486 * @returns VBox status code. 2487 */ 2488 static int audioTestDoSelftest(void) 2489 { 2490 int rc = atsInit(); 2491 if (RT_SUCCESS(rc)) 2492 { 2493 if (RT_SUCCESS(rc)) 2494 rc = atsStart(); 2495 } 2496 2497 return rc; 2498 } 2499 2500 /** 2501 * The 'selftest' command handler. 2502 * 2503 * @returns Program exit code. 2504 * @param pGetState RTGetOpt state. 2505 */ 2506 static DECLCALLBACK(RTEXITCODE) audioTestCmdSelftestHandler(PRTGETOPTSTATE pGetState) 2507 { 2508 /* Option values: */ 2509 PCPDMDRVREG pDrvReg = g_aBackends[0].pDrvReg; 2510 bool fWithDrvAudio = false; 2511 2512 /* Argument processing loop: */ 2513 int rc; 2514 RTGETOPTUNION ValueUnion; 2515 while ((rc = RTGetOpt(pGetState, &ValueUnion)) != 0) 2516 { 2517 switch (rc) 2518 { 2519 case 'b': 2520 pDrvReg = NULL; 2521 for (uintptr_t i = 0; i < RT_ELEMENTS(g_aBackends); i++) 2522 if ( strcmp(ValueUnion.psz, g_aBackends[i].pszName) == 0 2523 || strcmp(ValueUnion.psz, g_aBackends[i].pDrvReg->szName) == 0) 2524 { 2525 pDrvReg = g_aBackends[i].pDrvReg; 2526 break; 2527 } 2528 if (pDrvReg == NULL) 2529 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Unknown backend: '%s'", ValueUnion.psz); 2530 break; 2531 2532 case 'd': 2533 fWithDrvAudio = true; 2534 break; 2535 2536 case VINF_GETOPT_NOT_OPTION: 2537 { 2538 break; 2539 } 2540 2541 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion); 2542 2543 default: 2544 return RTGetOptPrintError(rc, &ValueUnion); 2545 } 2546 } 2547 2548 rc = audioTestDoSelftest(); 2549 2550 return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 2551 } 2552 2462 2553 2463 2554 /** … … 2496 2587 g_aCmdPlayOptions, RT_ELEMENTS(g_aCmdPlayOptions), audioTestCmdPlayHelp, 2497 2588 }, 2589 { 2590 "selftest", audioTestCmdSelftestHandler, 2591 "Performs self-tests.", 2592 g_aCmdSelftestOptions, RT_ELEMENTS(g_aCmdSelftestOptions), audioTestCmdSelftestHelp, 2593 } 2498 2594 }; 2499 2595
Note:
See TracChangeset
for help on using the changeset viewer.