VirtualBox

Ignore:
Timestamp:
Oct 25, 2021 10:10:32 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Added "--no-audio-ok" switch to VKAT to enable running on hosts which do not have any audio hardware (e.g. servers). ​bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r92004 r92019  
    127127    VKAT_TEST_OPT_HOST_ATS_PORT,
    128128    VKAT_TEST_OPT_MODE,
     129    VKAT_TEST_OPT_NO_AUDIO_OK,
    129130    VKAT_TEST_OPT_NO_VERIFY,
    130131    VKAT_TEST_OPT_OUTDIR,
     
    194195    { "--probe-backends",    VKAT_TEST_OPT_PROBE_BACKENDS,      RTGETOPT_REQ_NOTHING },
    195196    { "--mode",              VKAT_TEST_OPT_MODE,                RTGETOPT_REQ_STRING  },
     197    { "--no-audio-ok",       VKAT_TEST_OPT_NO_AUDIO_OK,         RTGETOPT_REQ_NOTHING },
    196198    { "--no-verify",         VKAT_TEST_OPT_NO_VERIFY,           RTGETOPT_REQ_NOTHING },
    197199    { "--tag",               VKAT_TEST_OPT_TAG,                 RTGETOPT_REQ_STRING  },
     
    717719                                                       "    Default: 6052"; /* ATS_TCP_DEF_BIND_PORT_VALKIT */
    718720        case VKAT_TEST_OPT_MODE:                return "Test mode to use when running the tests";
     721        case VKAT_TEST_OPT_NO_AUDIO_OK:         return "Enables running without any found audio hardware (e.g. servers)";
    719722        case VKAT_TEST_OPT_NO_VERIFY:           return "Skips the verification step";
    720723        case VKAT_TEST_OPT_OUTDIR:              return "Output directory to use";
     
    761764    bool        fPcmSigned     = true;
    762765    bool        fProbeBackends = false;
     766    bool        fNoAudioOk     = false;
    763767
    764768    const char *pszGuestTcpAddr  = NULL;
     
    816820                break;
    817821
     822            case VKAT_TEST_OPT_NO_AUDIO_OK:
     823                fNoAudioOk = true;
     824                break;
     825
    818826            case VKAT_TEST_OPT_NO_VERIFY:
    819827                TstEnv.fSkipVerify = true;
     
    942950    rc = AudioTestDriverStackPerformSelftest();
    943951    if (RT_FAILURE(rc))
    944         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Testing driver stack failed: %Rrc\n", rc);
     952    {
     953        if (!fNoAudioOk)
     954            return RTMsgErrorExit(RTEXITCODE_FAILURE, "Testing driver stack failed: %Rrc\n", rc);
     955        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Warning: Testing driver stack not possible (%Rrc), but --no-audio-ok was specified. Running on a server without audio hardware?\n");
     956    }
    945957
    946958    AUDIOTESTDRVSTACK DrvStack;
     
    952964                                        true /* fEnabledIn */, true /* fEnabledOut */, TstEnv.IoOpts.fWithDrvAudio); /** @todo Make in/out configurable, too. */
    953965    if (RT_FAILURE(rc))
    954         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unable to init driver stack: %Rrc\n", rc);
     966    {
     967        if (!fNoAudioOk)
     968            return RTMsgErrorExit(RTEXITCODE_FAILURE, "Unable to init driver stack: %Rrc\n", rc);
     969        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Warning: Initializing driver stack not possible (%Rrc), but --no-audio-ok was specified. Running on a server without audio hardware?\n");
     970    }
    955971
    956972    PPDMAUDIOHOSTDEV pDev;
    957973    rc = audioTestDevicesEnumerateAndCheck(&DrvStack, TstEnv.szDev, &pDev);
    958974    if (RT_FAILURE(rc))
    959         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Enumerating device(s) failed: %Rrc\n", rc);
     975    {
     976        if (!fNoAudioOk)
     977            return RTMsgErrorExit(RTEXITCODE_FAILURE, "Enumerating device(s) failed: %Rrc\n", rc);
     978    }
    960979
    961980    /* For now all tests have the same test environment and driver stack. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette