VirtualBox

Changeset 107012 in vbox for trunk


Ignore:
Timestamp:
Nov 15, 2024 9:35:45 AM (2 weeks ago)
Author:
vboxsync
Message:

Main/cbinding/tstCAPIGlue: Don't run interactively (i.e. by requiring user input) by default. This will cause timeouts on the testboxes if we forgot to blacklist testcases for whatever reason.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/tstCAPIGlue.c

    r106061 r107012  
    846846 * List the registered VMs.
    847847 *
    848  * @param   argv0       executable name
     848 * @param   argc        number of arguments
     849 * @param   argv        argument vector
    849850 * @param   virtualBox  ptr to IVirtualBox object
    850851 * @param   session     ptr to ISession object
    851852 */
    852 static void listVMs(const char *argv0, IVirtualBox *virtualBox, ISession *session)
    853 {
     853static void listVMs(int argc, char **argv, IVirtualBox *virtualBox, ISession *session)
     854{
     855    const char *argv0 = argv[0];
     856
    854857    HRESULT hrc;
    855858    SAFEARRAY *machinesSA = g_pVBoxFuncs->pfnSafeArrayOutParamAlloc();
     
    970973    /*
    971974     * Let the user chose a machine to start.
     975     *
     976     * Note! Testcases need to run without interaction required by default,
     977     *       so only do this if manually specifying the 'start' command.
    972978     */
    973     printf("Type Machine# to start (0 - %u) or 'quit' to do nothing: ",
    974            (unsigned)(machineCnt - 1));
    975     fflush(stdout);
    976 
    977     if (scanf("%u", &start_id) == 1 && start_id < machineCnt)
    978     {
    979         IMachine *machine = machines[start_id];
    980 
    981         if (machine)
     979    if (    argc >= 2
     980        && !stricmp(argv[1], "start"))
     981    {
     982        printf("Type Machine# to start (0 - %u) or 'quit' to do nothing: ",
     983               (unsigned)(machineCnt - 1));
     984        fflush(stdout);
     985
     986        if (scanf("%u", &start_id) == 1 && start_id < machineCnt)
    982987        {
    983             BSTR uuidUtf16 = NULL;
    984 
    985             IMachine_get_Id(machine, &uuidUtf16);
    986             startVM(argv0, virtualBox, session, uuidUtf16);
    987             g_pVBoxFuncs->pfnComUnallocString(uuidUtf16);
     988            IMachine *machine = machines[start_id];
     989
     990            if (machine)
     991            {
     992                BSTR uuidUtf16 = NULL;
     993
     994                IMachine_get_Id(machine, &uuidUtf16);
     995                startVM(argv0, virtualBox, session, uuidUtf16);
     996                g_pVBoxFuncs->pfnComUnallocString(uuidUtf16);
     997            }
    988998        }
    989999    }
     1000    else
     1001        printf("Note: Use 'start' to start a VM when running interactively.\n\n");
    9901002
    9911003    /*
     
    11031115        PrintErrorInfo(argv[0], "GetHomeFolder() failed", hrc);
    11041116
    1105     listVMs(argv[0], vbox, session);
     1117    listVMs(argc, argv, vbox, session);
    11061118    ISession_UnlockMachine(session);
    11071119
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