VirtualBox

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

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1# $Id: Makefile.kmk 96407 2022-08-22 17:43:14Z vboxsync $
2## @file
3# Sub-Makefile for the storage device & driver testcases.
4#
5
6#
7# Copyright (C) 2006-2022 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Basic testcases for the VD code.
33#
34ifdef VBOX_WITH_TESTCASES
35 PROGRAMS += tstVD tstVD-2 tstVDSnap tstVDFill
36
37 tstVD_TEMPLATE = VBOXR3TSTEXE
38 tstVD_SOURCES = tstVD.cpp
39 tstVD_LIBS = $(LIB_DDU)
40
41 tstVD-2_TEMPLATE = VBOXR3TSTEXE
42 tstVD-2_SOURCES = tstVD-2.cpp
43 tstVD-2_LIBS = $(LIB_DDU)
44
45 tstVDFill_TEMPLATE = VBOXR3TSTEXE
46 tstVDFill_SOURCES = tstVDFill.cpp
47 tstVDFill_LIBS = $(LIB_DDU)
48
49 PROGRAMS += tstVDIo
50
51 #
52 # VD I/O test scripts to built in -> .cpp
53 #
54 TSTVDIO_BUILTIN_TESTS_FILE = $(tstVDIo_0_OUTDIR)/BuiltinTests.cpp
55 TSTVDIO_BUILTIN_TESTS := \
56 tstVDIo=tstVDIo.vd \
57 tstVDResize=tstVDResize.vd \
58 tstVDCompact=tstVDCompact.vd \
59 tstVDCopy=tstVDCopy.vd \
60 tstVDDiscard=tstVDDiscard.vd \
61 tstVDShareable=tstVDShareable.vd
62 TSTVDIO_BUILTIN_TEST_NAMES := $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(firstword $(subst =,$(SPACE) ,$(test))))
63 TSTVDIO_PATH_TESTS := $(PATH_SUB_CURRENT)
64
65 # 1=name, 2=filter
66 TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
67 $(foreach testnm,$(filter $(2),$(TSTVDIO_BUILTIN_TEST_NAMES)), ' TSTVDIOTESTENTRY_GEN($(testnm), g_ab$(testnm)),') \
68 '};' 'unsigned const g_c$(1) = RT_ELEMENTS(g_a$(1));' '' ''
69
70 $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
71 $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SPACE) ,$(test)))) \
72 $(VBOX_BIN2C) \
73 | $$(dir $$@)
74 $(QUIET)$(RM) -f -- $@ $@.vd
75 $(QUIET)$(APPEND) -n "$@" \
76 '' \
77 '#include "BuiltinTests.h"' \
78 ''
79 $(foreach test,$(TSTVDIO_BUILTIN_TESTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append --no-size \
80 "$(firstword $(subst =,$(SP) ,$(test)))" \
81 "$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SP) ,$(test)))" \
82 "$@")
83
84# Generate test lists.
85 $(QUIET)$(APPEND) -n "$@" '' \
86 $(call TSTVDIO_GEN_TEST_MACRO,VDIoTests,%) \
87
88 tstVDIo_TEMPLATE = VBOXR3TSTEXE
89 tstVDIo_INCS := $(PATH_SUB_CURRENT)
90
91 ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
92 tstVDIo_DEFS += VBOX_TSTVDIO_WITH_LOG_REPLAY
93 endif
94
95 tstVDIo_SOURCES = \
96 tstVDIo.cpp \
97 VDIoBackend.cpp \
98 VDIoBackendMem.cpp \
99 VDMemDisk.cpp \
100 VDIoRnd.cpp \
101 VDScript.cpp \
102 VDScriptAst.cpp \
103 VDScriptChecker.cpp \
104 VDScriptInterp.cpp \
105 $(TSTVDIO_BUILTIN_TESTS_FILE)
106 tstVDIo_LIBS = \
107 $(LIB_DDU)
108 tstVDIo_CLEAN = \
109 $(TSTVDIO_BUILTIN_TESTS_FILE)
110 tstVDSnap_TEMPLATE = VBOXR3TSTEXE
111 tstVDSnap_LIBS = $(LIB_DDU)
112 tstVDSnap_SOURCES = tstVDSnap.cpp
113endif
114
115if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
116 PROGRAMS += vbox-img
117
118 #
119 # vbox-img - static because it might be used as a standalone tool.
120 #
121 vbox-img_TEMPLATE = VBoxR3Static
122 vbox-img_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
123 vbox-img_INCS += \
124 ../../Main/include
125 vbox-img_SOURCES = \
126 vbox-img.cpp \
127 ../VD.cpp \
128 ../VDPlugin.cpp \
129 ../VDVfs.cpp \
130 ../VDI.cpp \
131 ../VMDK.cpp \
132 ../VHD.cpp \
133 ../DMG.cpp \
134 ../Parallels.cpp \
135 ../ISCSI.cpp \
136 ../RAW.cpp \
137 ../QED.cpp \
138 ../QCOW.cpp \
139 ../VHDX.cpp \
140 ../CUE.cpp \
141 ../VISO.cpp \
142 ../VCICache.cpp \
143 ../VDIfVfs.cpp
144 vbox-img_SOURCES.win = \
145 vbox-img.rc
146 vbox-img_LIBS = \
147 $(VBOX_LIB_RUNTIME_STATIC)
148 if1of ($(KBUILD_TARGET),os2 win)
149 vbox-img_LIBS += \
150 $(SDK_VBOX_LZF_STATIC_LIBS) \
151 $(SDK_VBOX_ZLIB_STATIC_LIBS)
152 else
153 vbox-img_LIBS += \
154 $(SDK_VBOX_LZF_LIBS) \
155 $(SDK_VBOX_ZLIB_LIBS)
156 endif
157 ifeq ($(KBUILD_TARGET),linux)
158 ifdef SDK_VBOX_LIBXML2_LIBS
159 vbox-img_LIBS += xml2
160 endif
161 else ifeq ($(KBUILD_TARGET),freebsd)
162 vbox-img_LIBS += iconv geom bsdxml sbuf
163 ifdef SDK_VBOX_LIBXML2_LIBS
164 vbox-img_LIBS += xml2 lzma
165 endif
166 else ifeq ($(KBUILD_TARGET),darwin)
167 vbox-img_LIBS += iconv
168 else ifeq ($(KBUILD_TARGET),win)
169 vbox-img_SDKS.win = VBOX_NTDLL
170 else ifeq ($(KBUILD_TARGET),solaris)
171 vbox-img_LIBS += kstat efi
172 ifdef SDK_VBOX_LIBXML2_LIBS
173 vbox-img_LIBS += xml2
174 endif
175 endif
176
177endif
178
179if defined(VBOX_WITH_TESTCASES) && defined(VBOX_WITH_PLUGIN_CRYPT) \
180 && defined(VBOX_WITH_EXTPACK_PUEL) && defined(VBOX_WITH_EXTPACK_PUEL_BUILD) \
181 && defined(VBOX_WITH_VDKEYSTOREMGR)
182 PROGRAMS += vdkeystoremgr
183
184 #
185 # vdkeystoremgr - static because it might be used as a standalone tool.
186 #
187 vdkeystoremgr_TEMPLATE = VBoxR3Static
188 vdkeystoremgr_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
189 vdkeystoremgr_SOURCES = \
190 vdkeystoremgr.cpp \
191 ../VDKeyStore.cpp
192 vdkeystoremgr_SOURCES.win = \
193 vdkeystoremgr_SOURCES.rc
194 vdkeystoremgr_LIBS = \
195 $(VBOX_LIB_RUNTIME_STATIC) \
196 $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB)
197 if1of ($(KBUILD_TARGET),os2 win)
198 vdkeystoremgr_LIBS += \
199 $(SDK_VBOX_LZF_STATIC_LIBS) \
200 $(SDK_VBOX_ZLIB_STATIC_LIBS)
201 else
202 vdkeystoremgr_LIBS += \
203 $(SDK_VBOX_LZF_LIBS) \
204 $(SDK_VBOX_ZLIB_LIBS)
205 endif
206 ifeq ($(KBUILD_TARGET),linux)
207 ifdef SDK_VBOX_LIBXML2_LIBS
208 vdkeystoremgr_LIBS += xml2
209 endif
210 else if1of ($(KBUILD_TARGET),darwin freebsd)
211 vdkeystoremgr_LIBS += iconv
212 else ifeq ($(KBUILD_TARGET),win)
213 vdkeystoremgr_SDKS.win = VBOX_NTDLL
214 else ifeq ($(KBUILD_TARGET),solaris)
215 vdkeystoremgr_LIBS += kstat
216 endif
217endif
218
219include $(FILE_KBUILD_SUB_FOOTER)
220
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