VirtualBox

source: vbox/trunk/src/VBox/Storage/testcase/Makefile.kmk@ 52235

Last change on this file since 52235 was 52111, checked in by vboxsync, 10 years ago

Storage/testcases: Include the tests scripts into tstVDIo for automated testing

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1# $Id: Makefile.kmk 52111 2014-07-21 13:28:54Z vboxsync $
2## @file
3# Sub-Makefile for the storage device & driver testcases.
4#
5
6#
7# Copyright (C) 2006-2012 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# vditool - useful too for manipulating VDIs, but now pretty obsolete and
23# probably will go away soon. Testcase only now.
24#
25if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VDITOOL)
26 PROGRAMS += vditool
27 vditool_TEMPLATE = VBOXR3TSTEXE
28 vditool_LIBS = $(LIB_DDU)
29 vditool_SOURCES = vditool.cpp
30endif
31
32#
33# Basic testcases for the VD code.
34#
35ifdef VBOX_WITH_TESTCASES
36 PROGRAMS += tstVD tstVD-2 tstVDCopy tstVDSnap tstVDShareable
37
38 tstVD_TEMPLATE = VBOXR3TSTEXE
39 tstVD_SOURCES = tstVD.cpp
40 tstVD_LIBS = $(LIB_DDU)
41
42 tstVD-2_TEMPLATE = VBOXR3TSTEXE
43 tstVD-2_SOURCES = tstVD-2.cpp
44 tstVD-2_LIBS = $(LIB_DDU)
45
46 tstVDCopy_TEMPLATE = VBOXR3TSTEXE
47 tstVDCopy_SOURCES = tstVDCopy.cpp
48 tstVDCopy_LIBS = $(LIB_DDU)
49
50 ifn1of ($(KBUILD_TARGET),win)
51 PROGRAMS += tstVDIo
52
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)
66
67 # 1=name, 2=filter
68 TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
69 $(foreach testnm,$(filter $(2),$(TSTVDIO_BUILTIN_TEST_NAMES)), ' TSTVDIOTESTENTRY_GEN(g_ab$(testnm)),') \
70 '};' 'unsigned const g_c$(1) = RT_ELEMENTS(g_a$(1));' '' ''
71
72 $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
73 $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SPACE) ,$(test)))) \
74 $(VBOX_BIN2C) \
75 | $$(dir $$@)
76 $(QUIET)$(RM) -f -- $@ [email protected]
77 $(QUIET)$(APPEND) -n "$@" \
78 '' \
79 '#include "BuiltinTests.h"' \
80 ''
81 $(foreach test,$(TSTVDIO_BUILTIN_TESTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append \
82 "$(firstword $(subst =,$(SP) ,$(test)))" \
83 "$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SP) ,$(test)))" \
84 "$@")
85
86# Generate certificate lists.
87 $(QUIET)$(APPEND) -n "$@" '' \
88 $(call TSTVDIO_GEN_TEST_MACRO,VDIoTests,%) \
89
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) \
104 $(PATH_STAGE_LIB)/StorageDbgLib$(VBOX_SUFF_LIB)
105 endif
106
107 tstVDSetUuid_TEMPLATE = VBOXR3TSTEXE
108 tstVDSetUuid_LIBS = $(LIB_DDU)
109
110 tstVDShareable_TEMPLATE = VBOXR3TSTEXE
111 tstVDShareable_LIBS = $(LIB_DDU)
112 tstVDShareable_SOURCES = tstVDShareable.cpp
113
114 tstVDSnap_TEMPLATE = VBOXR3TSTEXE
115 tstVDSnap_LIBS = $(LIB_DDU)
116 tstVDSnap_SOURCES = tstVDSnap.cpp
117endif
118
119if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
120 PROGRAMS += vbox-img
121
122 #
123 # vbox-img - static because it migth be used as at standalone tool.
124 #
125 vbox-img_TEMPLATE = VBoxR3Static
126 vbox-img_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
127 vbox-img_SOURCES = \
128 vbox-img.cpp \
129 ../VD.cpp \
130 ../VDVfs.cpp \
131 ../VDI.cpp \
132 ../VMDK.cpp \
133 ../VHD.cpp \
134 ../DMG.cpp \
135 ../Parallels.cpp \
136 ../ISCSI.cpp \
137 ../RAW.cpp \
138 ../QED.cpp \
139 ../QCOW.cpp \
140 ../VHDX.cpp \
141 ../VCICache.cpp \
142 ../VDIfVfs.cpp
143 vbox-img_LIBS = \
144 $(VBOX_LIB_RUNTIME_STATIC)
145 if1of ($(KBUILD_TARGET),os2 win)
146 vbox-img_LIBS += \
147 $(PATH_STAGE_LIB)/VBox-liblzf-static$(VBOX_SUFF_LIB) \
148 $(PATH_STAGE_LIB)/VBox-zlib-static$(VBOX_SUFF_LIB)
149 else
150 vbox-img_LIBS += \
151 $(PATH_STAGE_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \
152 $(SDK_VBOX_ZLIB_LIBS)
153 endif
154 ifeq ($(KBUILD_TARGET),linux)
155 vbox-img_LIBS += crypt
156 ifdef SDK_VBOX_LIBXML2_LIBS
157 vbox-img_LIBS += xml2
158 endif
159 else if1of ($(KBUILD_TARGET),darwin freebsd)
160 vbox-img_LIBS += iconv
161 else ifeq ($(KBUILD_TARGET),win)
162 vbox-img_SDKS.win = VBOX_NTDLL
163 else ifeq ($(KBUILD_TARGET),solaris)
164 vbox-img_LIBS += kstat
165 endif
166
167endif
168
169include $(FILE_KBUILD_SUB_FOOTER)
170
Note: See TracBrowser for help on using the repository browser.

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