1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the VBox API testcases.
#
#
# Copyright (C) 2004-2022 Oracle and/or its affiliates.
#
# This file is part of VirtualBox base platform packages, as
# available from https://www.virtualbox.org.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, in version 3 of the
# License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses>.
#
# SPDX-License-Identifier: GPL-3.0-only
#
SUB_DEPTH = ../../../..
include $(KBUILD_PATH)/subheader.kmk
#
# Target and globals (small mess)
#
ifndef VBOX_ONLY_SDK
if defined(VBOX_WITH_TESTCASES)
PROGRAMS += \
tstAPI \
tstVBoxAPI \
tstVBoxAPIPerf \
tstVBoxMultipleVM \
$(if $(VBOX_OSE),,tstOVF) \
$(if $(VBOX_WITH_XPCOM),tstVBoxAPIXPCOM,tstVBoxAPIWin msiDarwinDescriptorDecoder) \
$(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,) \
$(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) \
$(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlParseBuffer,) \
$(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlPaths,) \
tstMediumLock \
tstBstr \
tstGuid \
tstUnattendedScript \
tstVBoxCrypto
PROGRAMS.linux += \
$(if $(VBOX_WITH_USB),tstUSBProxyLinux,)
endif # !VBOX_WITH_TESTCASES
endif # !VBOX_ONLY_SDK
if defined(VBOX_ONLY_SDK) || !defined(VBOX_WITH_XPCOM)
INSTALLS += samplesMSCOM
endif
if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_XPCOM)
INSTALLS += samplesXPCOM
endif
#
# The samples
#
samplesMSCOM_MODE = a+r,u+w
samplesMSCOM_INST = $(INST_SDK)bindings/mscom/samples/
samplesMSCOM_SOURCES = tstVBoxAPIWin.cpp makefile.tstVBoxAPIWin=>Makefile
samplesXPCOM_MODE = a+r,u+w
samplesXPCOM_INST = $(INST_SDK)bindings/xpcom/samples/
samplesXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp makefile.tstVBoxAPIXPCOM=>Makefile
#
# tstVBoxMultipleVM
#
tstVBoxMultipleVM_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstVBoxMultipleVM_SOURCES = tstVBoxMultipleVM.cpp
#
# tstAPI
#
tstAPI_TEMPLATE = VBOXMAINCLIENTTSTEXE
#tstAPI_INST = $(INST_SDK)bindings/gluecom/samples/
tstAPI_SOURCES = tstAPI.cpp
#
# tstVBoxAPI
#
tstVBoxAPI_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstVBoxAPI_SOURCES = \
tstVBoxAPI.cpp
#
# tstVBoxAPIPerf
#
tstVBoxAPIPerf_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstVBoxAPIPerf_SOURCES = \
tstVBoxAPIPerf.cpp
#
# tstOVF
#
tstOVF_TEMPLATE = VBOXMAINCLIENTTSTEXE
#tstOVF_INST = $(INST_SDK)bindings/gluecom/samples/
tstOVF_SOURCES = tstOVF.cpp
ifndef VBOX_OSE
#
# OVF test data.
#
INSTALLS += ovf-testcases
ovf-testcases_MODE = a+r,u+w
ovf-testcases_INST = $(INST_TESTCASE)ovf-testcases/
ovf-testcases_SOURCES = \
ovf-dummy.vmdk \
ovf-joomla-0.9/joomla-1.1.4-ovf.ovf=>ovf-joomla-0.9/joomla-1.1.4-ovf.ovf \
ovf-winhost-audio-nodisks/WinXP.ovf=>ovf-winhost-audio-nodisks/WinXP.ovf \
ovf-winxp-vbox-sharedfolders/winxp.ovf=>ovf-winxp-vbox-sharedfolders/winxp.ovf
endif
#
# tstVBoxAPIXPCOM
#
# We only build the testcase here to make sure it builds.
# It comes with a custom makefile which should be tested as well!
#
# Use very generic template to make the build environment similar
# to the standalone case, to detect if IPRT or glue use sneaks in.
#
tstVBoxAPIXPCOM_TEMPLATE = VBOXR3EXE
tstVBoxAPIXPCOM_INST = $(INST_TESTCASE)
tstVBoxAPIXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp
tstVBoxAPIXPCOM_INCS = \
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/string \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
tstVBoxAPIXPCOM_LIBS = \
$(LIB_XPCOM) \
$(LIB_RUNTIME)
tstVBoxAPIXPCOM_CXXFLAGS = -fshort-wchar
ifdef VBOX_WITH_RUNPATH
tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBoxBldProg_LDFLAGS)
else ifdef VBOX_WITH_RELATIVE_RUNPATH
tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBoxBldProg_LDFLAGS)
endif
tstVBoxAPIXPCOM_INTERMEDIATES = \
$(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
tstVBoxAPIXPCOM_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
endif
#
# tstVBoxAPIWin
#
# Use very generic template to make the build environment similar
# to the standalone case, to detect if IPRT or glue use sneaks in.
#
tstVBoxAPIWin_TEMPLATE = VBOXR3EXE
tstVBoxAPIWin_INST = $(INST_TESTCASE)
tstVBoxAPIWin_SOURCES = \
tstVBoxAPIWin.cpp \
$(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
tstVBoxAPIWin_INCS = \
$(VBOX_PATH_SDK)/bindings/mscom/include
tstVBoxAPIWin_INTERMEDIATES = \
$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
#
# msiDarwinDescriptorDecoder
#
# Use very generic template to make the build environment similar
# to the standalone case, to detect if IPRT or glue use sneaks in.
#
msiDarwinDescriptorDecoder_TEMPLATE = VBOXR3EXE
msiDarwinDescriptorDecoder_INST = $(VBOX_INST_TOOLS)
msiDarwinDescriptorDecoder_SOURCES = \
msiDarwinDescriptorDecoder.cpp
#
# tstCollector
#
# Note! VBOX_MAIN_APIWRAPPER_GEN_HDRS is only defined if kmk is executed a
# parent directory. Since the rules for generating the files listed by
# the variable lives in the parent makefile, this is not a problem.
#
tstCollector_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstCollector_SOURCES = \
tstCollector.cpp \
../src-server/Performance.cpp
tstCollector_INCS = \
../include \
$(VBOX_MAIN_APIWRAPPER_INCS)
tstCollector_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
tstCollector_DEFS = VBOX_COLLECTOR_TEST_CASE
tstCollector_LDFLAGS.darwin = -lproc
tstCollector_LDFLAGS.solaris = -lkstat -lnvpair
tstCollector_LDFLAGS.win = psapi.lib powrprof.lib
#
# tstGuestCtrlContextID
#
tstGuestCtrlContextID_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstGuestCtrlContextID_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
tstGuestCtrlContextID_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
tstGuestCtrlContextID_SOURCES = \
tstGuestCtrlContextID.cpp \
../src-client/GuestCtrlPrivate.cpp
tstGuestCtrlContextID_INCS = ../include \
$(VBOX_MAIN_APIWRAPPER_INCS)
#
# tstGuestCtrlParseBuffer
#
tstGuestCtrlParseBuffer_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstGuestCtrlParseBuffer_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
tstGuestCtrlParseBuffer_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
tstGuestCtrlParseBuffer_SOURCES = \
tstGuestCtrlParseBuffer.cpp \
../src-client/GuestCtrlPrivate.cpp
tstGuestCtrlParseBuffer_INCS = ../include \
$(VBOX_MAIN_APIWRAPPER_INCS)
#
# tstGuestCtrlPaths
#
tstGuestCtrlPaths_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstGuestCtrlPaths_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
tstGuestCtrlPaths_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
tstGuestCtrlPaths_SOURCES = \
tstGuestCtrlPaths.cpp \
../src-client/GuestCtrlPrivate.cpp
tstGuestCtrlPaths_INCS = ../include \
$(VBOX_MAIN_APIWRAPPER_INCS)
if 0 # Enable this if you want automatic runs after compilation.
$$(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run: $$(tstGuestCtrlPaths_1_STAGE_TARGET)
export VBOX_LOG_DEST=nofile; $(tstGuestCtrlPaths_1_STAGE_TARGET) quiet
$(QUIET)$(APPEND) -t "$@" "done"
OTHERS += $(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run
endif
#
# tstUSBProxyLinux
#
tstUSBProxyLinux_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstUSBProxyLinux_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
tstUSBProxyLinux_SOURCES = \
tstUSBProxyLinux.cpp \
../src-server/linux/USBGetDevices.cpp
tstUSBProxyLinux_INCS = \
. \
../include \
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_MAIN_APIWRAPPER_INCS)
tstUSBProxyLinux_DEFS = \
UNIT_TEST \
VBOX_WITH_USB \
VBOX_USB_WITH_SYSFS \
VBOX_WITH_XPCOM
tstUSBProxyLinux_DEPS = \
$(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
tstUSBProxyLinux_LIBS += \
$(PATH_OUT)/lib/USBLib.a \
$(PATH_OUT)/lib/VBoxCOM.a
#
# tstMediumLock
#
tstMediumLock_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstMediumLock_SOURCES = tstMediumLock.cpp
#
# tstBstr
#
tstBstr_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstBstr_SOURCES = tstBstr.cpp
#
# tstGuid
#
tstGuid_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstGuid_SOURCES = tstGuid.cpp
#
# tstUnattendedScript
#
tstUnattendedScript_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstUnattendedScript_DEFS = VBOX_WITH_UNATTENDED IN_VBOXSVC IN_TST_UNATTENDED_SCRIPT
tstUnattendedScript_INTERMEDIATES = \
$(VBOX_MAIN_APIWRAPPER_GEN_HDRS) \
$(VBOX_XML_SCHEMADEFS_H)
tstUnattendedScript_INCS = \
../include \
$(VBOX_MAIN_APIWRAPPER_INCS) \
$(dir $(VBOX_XML_SCHEMADEFS_H))
tstUnattendedScript_SOURCES = \
tstUnattendedScript.cpp \
../src-server/UnattendedScript.cpp \
../src-all/TextScript.cpp \
../src-all/VirtualBoxBase.cpp \
../src-all/VirtualBoxErrorInfoImpl.cpp \
../src-all/AutoCaller.cpp \
../src-all/GlobalStatusConversion.cpp
tstUnattendedScript_LIBS = \
$(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
INSTALLS += tstUnattendedScriptFiles
tstUnattendedScriptFiles_TEMPLATE = VBOXMAINTSTEXE
tstUnattendedScriptFiles_SOURCES = \
tstUnattendedScript-1.template \
tstUnattendedScript-1.expected
#
# tstVBoxCrypto
#
tstVBoxCrypto_TEMPLATE = VBOXMAINCLIENTTSTEXE
tstVBoxCrypto_SOURCES = tstVBoxCrypto.cpp
# generate rules.
include $(FILE_KBUILD_SUB_FOOTER)
|