VirtualBox

Changeset 52379 in vbox for trunk/src/VBox/Storage/testcase


Ignore:
Timestamp:
Aug 14, 2014 12:08:18 PM (10 years ago)
Author:
vboxsync
Message:

Storage/tstVDIo: make it build on Windows, excluding the I/O log replay functionality

Location:
trunk/src/VBox/Storage/testcase
Files:
2 edited

Legend:

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

    r52111 r52379  
    4848 tstVDCopy_LIBS = $(LIB_DDU)
    4949
    50  ifn1of ($(KBUILD_TARGET),win)
    51   PROGRAMS += tstVDIo
     50 PROGRAMS += tstVDIo
    5251
    53   #
    54   # VD I/O test scripts to built in -> .cpp
    55   #
    56   TSTVDIO_BUILTIN_TESTS_FILE = $(tstVDIo_0_OUTDIR)/BuiltinTests.cpp
    57   TSTVDIO_BUILTIN_TESTS := \
    58          tstVDIo=tstVDIo.vd \
    59          tstVDResize=tstVDResize.vd \
    60          tstVDCompact=tstVDCompact.vd \
    61          tstVDCopy=tstVDCopy.vd \
    62          tstVDDiscard=tstVDDiscard.vd \
    63          tstVDShareable=tstVDShareable.vd
    64   TSTVDIO_BUILTIN_TEST_NAMES := $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(firstword $(subst =,$(SPACE) ,$(test))))
    65   TSTVDIO_PATH_TESTS := $(PATH_SUB_CURRENT)
     52 #
     53 # VD I/O test scripts to built in -> .cpp
     54 #
     55 TSTVDIO_BUILTIN_TESTS_FILE = $(tstVDIo_0_OUTDIR)/BuiltinTests.cpp
     56 TSTVDIO_BUILTIN_TESTS := \
     57        tstVDIo=tstVDIo.vd \
     58        tstVDResize=tstVDResize.vd \
     59        tstVDCompact=tstVDCompact.vd \
     60        tstVDCopy=tstVDCopy.vd \
     61        tstVDDiscard=tstVDDiscard.vd \
     62        tstVDShareable=tstVDShareable.vd
     63 TSTVDIO_BUILTIN_TEST_NAMES := $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(firstword $(subst =,$(SPACE) ,$(test))))
     64 TSTVDIO_PATH_TESTS := $(PATH_SUB_CURRENT)
    6665
    67   # 1=name, 2=filter
    68   TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
     66 # 1=name, 2=filter
     67 TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
    6968        $(foreach testnm,$(filter $(2),$(TSTVDIO_BUILTIN_TEST_NAMES)), '    TSTVDIOTESTENTRY_GEN(g_ab$(testnm)),') \
    7069        '};' 'unsigned const g_c$(1) = RT_ELEMENTS(g_a$(1));' '' ''
    7170
    72   $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
     71 $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
    7372                $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SPACE) ,$(test)))) \
    7473                $(VBOX_BIN2C) \
     
    7675        $(QUIET)$(RM) -f -- $@ [email protected]
    7776        $(QUIET)$(APPEND) -n "$@" \
    78         '' \
    79         '#include "BuiltinTests.h"' \
     77        '' \
     78        '#include "BuiltinTests.h"' \
    8079               ''
    8180        $(foreach test,$(TSTVDIO_BUILTIN_TESTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append \
     
    8483                "$@")
    8584
    86 # Generate certificate lists.
     85# Generate test lists.
    8786        $(QUIET)$(APPEND) -n "$@" '' \
    8887               $(call TSTVDIO_GEN_TEST_MACRO,VDIoTests,%) \
    8988
    90   tstVDIo_TEMPLATE = VBOXR3TSTEXE
    91   tstVDIo_INCS := $(PATH_SUB_CURRENT)
    92   tstVDIo_SOURCES  = tstVDIo.cpp \
    93         VDIoBackend.cpp \
    94         VDIoBackendMem.cpp \
    95         VDMemDisk.cpp \
    96         VDIoRnd.cpp \
    97         VDScript.cpp \
    98         VDScriptAst.cpp \
    99         VDScriptChecker.cpp \
    100         VDScriptInterp.cpp \
    101         $(TSTVDIO_BUILTIN_TESTS_FILE)
    102   tstVDIo_LIBS = \
    103         $(LIB_DDU) \
     89 ifn1of ($(KBUILD_TARGET), win)
     90  VBOX_TSTVDIO_WITH_LOG_REPLAY = 1
     91 endif
     92
     93 tstVDIo_TEMPLATE = VBOXR3TSTEXE
     94 tstVDIo_INCS := $(PATH_SUB_CURRENT)
     95
     96 ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
     97  tstVDIo_DEFS += VBOX_TSTVDIO_WITH_LOG_REPLAY
     98 endif
     99
     100 tstVDIo_SOURCES  = tstVDIo.cpp \
     101        VDIoBackend.cpp \
     102        VDIoBackendMem.cpp \
     103        VDMemDisk.cpp \
     104        VDIoRnd.cpp \
     105        VDScript.cpp \
     106        VDScriptAst.cpp \
     107        VDScriptChecker.cpp \
     108        VDScriptInterp.cpp \
     109        $(TSTVDIO_BUILTIN_TESTS_FILE)
     110 tstVDIo_LIBS = \
     111        $(LIB_DDU)
     112
     113 ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
     114  tstVDIo_LIBS += \
    104115        $(PATH_STAGE_LIB)/StorageDbgLib$(VBOX_SUFF_LIB)
    105116 endif
  • trunk/src/VBox/Storage/testcase/tstVDIo.cpp

    r52378 r52379  
    1818#define LOGGROUP LOGGROUP_DEFAULT
    1919#include <VBox/vd.h>
    20 #include <VBox/vddbg.h>
    2120#include <VBox/err.h>
    2221#include <VBox/log.h>
     
    3534#include <iprt/test.h>
    3635#include <iprt/system.h>
     36
     37#ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
     38# include <VBox/vddbg.h>
     39#endif
    3740
    3841#include "VDMemDisk.h"
     
    238241static DECLCALLBACK(int) vdScriptHandlerClose(PVDSCRIPTARG paScriptArgs, void *pvUser);
    239242static DECLCALLBACK(int) vdScriptHandlerPrintFileSize(PVDSCRIPTARG paScriptArgs, void *pvUser);
    240 static DECLCALLBACK(int) vdScriptHandlerIoLogReplay(PVDSCRIPTARG paScriptArgs, void *pvUser);
    241243static DECLCALLBACK(int) vdScriptHandlerIoRngCreate(PVDSCRIPTARG paScriptArgs, void *pvUser);
    242244static DECLCALLBACK(int) vdScriptHandlerIoRngDestroy(PVDSCRIPTARG paScriptArgs, void *pvUser);
     
    256258static DECLCALLBACK(int) vdScriptHandlerSetFileBackend(PVDSCRIPTARG paScriptArgs, void *pvUser);
    257259
     260#ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
     261static DECLCALLBACK(int) vdScriptHandlerIoLogReplay(PVDSCRIPTARG paScriptArgs, void *pvUser);
     262#endif
     263
    258264/* create action */
    259265const VDSCRIPTTYPE g_aArgCreate[] =
     
    357363};
    358364
     365#ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
    359366/* print file size action */
    360367const VDSCRIPTTYPE g_aArgIoLogReplay[] =
     
    363370    VDSCRIPTTYPE_STRING  /* iolog */
    364371};
     372#endif
    365373
    366374/* I/O RNG create action */
     
    472480    {"close",                      VDSCRIPTTYPE_VOID, g_aArgClose,                       RT_ELEMENTS(g_aArgClose),                      vdScriptHandlerClose},
    473481    {"printfilesize",              VDSCRIPTTYPE_VOID, g_aArgPrintFileSize,               RT_ELEMENTS(g_aArgPrintFileSize),              vdScriptHandlerPrintFileSize},
     482#ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
    474483    {"ioreplay",                   VDSCRIPTTYPE_VOID, g_aArgIoLogReplay,                 RT_ELEMENTS(g_aArgIoLogReplay),                vdScriptHandlerIoLogReplay},
     484#endif
    475485    {"merge",                      VDSCRIPTTYPE_VOID, g_aArgMerge,                       RT_ELEMENTS(g_aArgMerge),                      vdScriptHandlerMerge},
    476486    {"compact",                    VDSCRIPTTYPE_VOID, g_aArgCompact,                     RT_ELEMENTS(g_aArgCompact),                    vdScriptHandlerCompact},
     
    13931403
    13941404
     1405#ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
    13951406static DECLCALLBACK(int) vdScriptHandlerIoLogReplay(PVDSCRIPTARG paScriptArgs, void *pvUser)
    13961407{
     
    15431554    return rc;
    15441555}
     1556#endif
    15451557
    15461558
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