VirtualBox

Changeset 14991 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Dec 4, 2008 3:17:33 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40362
Message:

Main: rework the Linux host drive code to use libdbus-1 directly instead of libhal

Location:
trunk/src/VBox/Main/testcase
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r14730 r14991  
    3333        $(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,)
    3434  PROGRAMS.linux += \
    35         $(if $(VBOX_OSE),,$(if $(VBOX_USB_WITH_SYSFS),tstUSBLinux,))
     35        $(if $(VBOX_OSE),,tstHostHardwareLinux)
    3636 endif # !VBOX_WITH_TESTCASES
    3737endif # !VBOX_ONLY_SDK
     
    120120
    121121#
    122 # tstUSBLinux
     122# tstHostHardwareLinux
    123123#
    124 tstUSBLinux_TEMPLATE  = VBOXR3TSTEXE
    125 tstUSBLinux_SOURCES   = \
    126         tstUSBLinux.cpp \
    127         ../linux/USBProxyServiceLinux.cpp
    128 tstUSBLinux_INCS      = . ../include
    129 tstUSBLinux_DEFS      = \
     124tstHostHardwareLinux_TEMPLATE  = VBOXR3TSTEXE
     125tstHostHardwareLinux_SOURCES   = \
     126        tstHostHardwareLinux.cpp \
     127        ../linux/USBProxyServiceLinux.cpp \
     128        ../linux/HostHardwareLinux.cpp
     129tstHostHardwareLinux_INCS      = . ../include
     130tstHostHardwareLinux_DEFS      = \
    130131        VBOX_TEST_USB_LINUX \
    131132        $(if $(VBOX_WITHOUT_LINUX_COMPILER_H),VBOX_WITHOUT_LINUX_COMPILER_H,) \
     133        $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
    132134        $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,)
    133 tstUSBLinux_LIBS     += $(PATH_OUT)/lib/USBLib.a
    134 tstUSBLinux_CFLAGS   += $(if $(VBOX_WITH_LIBHAL),$(VBOX_LIBHAL_CFLAGS),)
    135 tstUSBLinux_CXXFLAGS += $(if $(VBOX_WITH_LIBHAL),$(VBOX_LIBHAL_CXXFLAGS),)
    136 tstUSBLinux_LDFLAGS  += $(if $(VBOX_WITH_LIBHAL),$(VBOX_LIBHAL_LDFLAGS),)
     135tstHostHardwareLinux_LIBS     += $(PATH_OUT)/lib/USBLib.a
     136tstHostHardwareLinux_CFLAGS   += $(if $(VBOX_WITH_DBUS),$(VBOX_DBUS_CFLAGS),)
     137tstHostHardwareLinux_CXXFLAGS += $(if $(VBOX_WITH_DBUS),$(VBOX_DBUS_CXXFLAGS),)
     138tstHostHardwareLinux_LDFLAGS  += $(if $(VBOX_WITH_DBUS),$(VBOX_DBUS_LDFLAGS),)
    137139
    138140
  • trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp

    r14933 r14991  
    1414 */
    1515
    16 #include "tstUSBLinux.h"
     16#ifdef VBOX_USB_WITH_SYSFS
     17# include "tstUSBLinux.h"
     18#endif
     19
     20#include <HostHardwareLinux.h>
    1721
    1822#include <VBox/err.h>
     
    2731{
    2832    RTR3Init();
     33#ifdef VBOX_USB_WITH_SYSFS
    2934    USBProxyServiceLinux service;
    3035    service.initSysfs();
     
    7479        }
    7580    }
     81#endif  /* VBOX_USB_WITH_SYSFS */
     82    VBoxMainDriveInfo driveInfo;
     83    g_testHostHardwareLinux = true;
     84    int rc = driveInfo.updateFloppies();
     85    if (RT_SUCCESS (rc))
     86        rc = driveInfo.updateDVDs();
     87    if (RT_FAILURE (rc))
     88    {
     89        RTPrintf("Failed to update the host drive information, error %Rrc\n",
     90                 rc);
     91        return 1;
     92    }
     93    RTPrintf ("Listing floppy drives detected:\n");
     94    for (VBoxMainDriveInfo::DriveInfoList::const_iterator it = driveInfo.FloppyBegin();
     95         it != driveInfo.FloppyEnd(); ++it)
     96    {
     97        RTPrintf ("  device: %s", it->mDevice.c_str());
     98        if (!it->mUdi.empty())
     99            RTPrintf (", udi: %s", it->mUdi.c_str());
     100        if (!it->mDescription.empty())
     101            RTPrintf (", description: %s", it->mDescription.c_str());
     102        RTPrintf ("\n");
     103    }
     104    RTPrintf ("Listing DVD drives detected:\n");
     105    for (VBoxMainDriveInfo::DriveInfoList::const_iterator it = driveInfo.DVDBegin();
     106         it != driveInfo.DVDEnd(); ++it)
     107    {
     108        RTPrintf ("  device: %s", it->mDevice.c_str());
     109        if (!it->mUdi.empty())
     110            RTPrintf (", udi: %s", it->mUdi.c_str());
     111        if (!it->mDescription.empty())
     112            RTPrintf (", description: %s", it->mDescription.c_str());
     113        RTPrintf ("\n");
     114    }
    76115    return 0;
    77116}
  • trunk/src/VBox/Main/testcase/tstUSBLinux.h

    r14711 r14991  
    2424
    2525#ifdef VBOX_USB_WITH_SYSFS
    26 # include "libhal.h"
     26# include <libhal.h>
    2727#endif
    2828
Note: See TracChangeset for help on using the changeset viewer.

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