VirtualBox

source: vbox/trunk/src/VBox/Main/testcase/Makefile.kmk

Last change on this file was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.5 KB
Line 
1# $Id: Makefile.kmk 106061 2024-09-16 14:03:52Z vboxsync $
2## @file
3# Sub-Makefile for the VBox API testcases.
4#
5
6#
7# Copyright (C) 2004-2024 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#
33# Target and globals (small mess)
34#
35ifndef VBOX_ONLY_SDK
36 if defined(VBOX_WITH_TESTCASES)
37 PROGRAMS += \
38 tstAPI \
39 tstVBoxAPI \
40 tstVBoxAPIPerf \
41 tstVBoxMultipleVM \
42 $(if $(VBOX_OSE),,tstOVF) \
43 $(if $(VBOX_WITH_XPCOM),tstVBoxAPIXPCOM,tstVBoxAPIWin msiDarwinDescriptorDecoder) \
44 $(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,) \
45 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) \
46 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlParseBuffer,) \
47 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlPaths,) \
48 tstMediumLock \
49 tstSafeArray \
50 tstRecording \
51 tstSettings \
52 tstBstr \
53 tstGuid \
54 tstUnattendedScript \
55 tstVBoxCrypto
56 PROGRAMS.linux += \
57 $(if $(VBOX_WITH_USB),tstUSBProxyLinux,)
58 endif # !VBOX_WITH_TESTCASES
59endif # !VBOX_ONLY_SDK
60if defined(VBOX_ONLY_SDK) || !defined(VBOX_WITH_XPCOM)
61 INSTALLS += samplesMSCOM
62endif
63if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_XPCOM)
64 INSTALLS += samplesXPCOM
65endif
66
67
68#
69# The samples
70#
71samplesMSCOM_MODE = a+r,u+w
72samplesMSCOM_INST = $(INST_SDK)bindings/mscom/samples/
73samplesMSCOM_SOURCES = tstVBoxAPIWin.cpp makefile.tstVBoxAPIWin=>Makefile
74
75samplesXPCOM_MODE = a+r,u+w
76samplesXPCOM_INST = $(INST_SDK)bindings/xpcom/samples/
77samplesXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp makefile.tstVBoxAPIXPCOM=>Makefile
78
79#
80# tstVBoxMultipleVM
81#
82tstVBoxMultipleVM_TEMPLATE = VBoxMainClientTstExe
83tstVBoxMultipleVM_SOURCES = tstVBoxMultipleVM.cpp
84
85#
86# tstAPI
87#
88tstAPI_TEMPLATE = VBoxMainClientTstExe
89#tstAPI_INST = $(INST_SDK)bindings/gluecom/samples/
90tstAPI_SOURCES = tstAPI.cpp
91
92#
93# tstVBoxAPI
94#
95tstVBoxAPI_TEMPLATE = VBoxMainClientTstExe
96tstVBoxAPI_SOURCES = \
97 tstVBoxAPI.cpp
98
99#
100# tstVBoxAPIPerf
101#
102tstVBoxAPIPerf_TEMPLATE = VBoxMainClientTstExe
103tstVBoxAPIPerf_SOURCES = \
104 tstVBoxAPIPerf.cpp
105
106#
107# tstOVF
108#
109tstOVF_TEMPLATE = VBoxMainClientTstExe
110#tstOVF_INST = $(INST_SDK)bindings/gluecom/samples/
111tstOVF_SOURCES = tstOVF.cpp
112
113ifndef VBOX_OSE
114 #
115 # OVF test data.
116 #
117 INSTALLS += ovf-testcases
118 ovf-testcases_MODE = a+r,u+w
119 ovf-testcases_INST = $(INST_TESTCASE)ovf-testcases/
120 ovf-testcases_SOURCES = \
121 ovf-dummy.vmdk \
122 ovf-joomla-0.9/joomla-1.1.4-ovf.ovf=>ovf-joomla-0.9/joomla-1.1.4-ovf.ovf \
123 ovf-winhost-audio-nodisks/WinXP.ovf=>ovf-winhost-audio-nodisks/WinXP.ovf \
124 ovf-winxp-vbox-sharedfolders/winxp.ovf=>ovf-winxp-vbox-sharedfolders/winxp.ovf
125endif
126
127
128#
129# tstVBoxAPIXPCOM
130#
131# We only build the testcase here to make sure it builds.
132# It comes with a custom makefile which should be tested as well!
133#
134# Use very generic template to make the build environment similar
135# to the standalone case, to detect if IPRT or glue use sneaks in.
136#
137tstVBoxAPIXPCOM_TEMPLATE = VBoxR3Exe
138tstVBoxAPIXPCOM_INST = $(INST_TESTCASE)
139tstVBoxAPIXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp
140tstVBoxAPIXPCOM_INCS = \
141 $(VBOX_PATH_SDK)/bindings/xpcom/include \
142 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
143 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
144 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
145 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
146tstVBoxAPIXPCOM_LIBS = \
147 $(LIB_XPCOM) \
148 $(LIB_RUNTIME)
149tstVBoxAPIXPCOM_CXXFLAGS = -fshort-wchar
150ifdef VBOX_WITH_RUNPATH
151 tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBoxBldProg_LDFLAGS)
152else ifdef VBOX_WITH_RELATIVE_RUNPATH
153 tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBoxBldProg_LDFLAGS)
154endif
155tstVBoxAPIXPCOM_INTERMEDIATES = \
156 $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
157ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
158 tstVBoxAPIXPCOM_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
159endif
160
161
162#
163# tstVBoxAPIWin
164#
165# Use very generic template to make the build environment similar
166# to the standalone case, to detect if IPRT or glue use sneaks in.
167#
168tstVBoxAPIWin_TEMPLATE = VBoxR3Exe
169tstVBoxAPIWin_INST = $(INST_TESTCASE)
170tstVBoxAPIWin_SOURCES = \
171 tstVBoxAPIWin.cpp \
172 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
173tstVBoxAPIWin_INCS = \
174 $(VBOX_PATH_SDK)/bindings/mscom/include
175tstVBoxAPIWin_INTERMEDIATES = \
176 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
177
178
179#
180# msiDarwinDescriptorDecoder
181#
182# Use very generic template to make the build environment similar
183# to the standalone case, to detect if IPRT or glue use sneaks in.
184#
185msiDarwinDescriptorDecoder_TEMPLATE = VBoxR3Exe
186msiDarwinDescriptorDecoder_INST = $(VBOX_INST_TOOLS)
187msiDarwinDescriptorDecoder_SOURCES = \
188 msiDarwinDescriptorDecoder.cpp
189
190
191#
192# tstCollector
193#
194# Note! VBOX_MAIN_APIWRAPPER_GEN_HDRS is only defined if kmk is executed a
195# parent directory. Since the rules for generating the files listed by
196# the variable lives in the parent makefile, as does the rules for making
197# VirtualBox.h, so it's not really a problem.
198#
199tstCollector_TEMPLATE = VBoxMainClientTstExe
200tstCollector_SOURCES = \
201 tstCollector.cpp \
202 ../src-server/Performance.cpp
203tstCollector_INCS = \
204 ../include \
205 $(VBOX_MAIN_APIWRAPPER_INCS)
206tstCollector_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
207tstCollector_DEFS = VBOX_COLLECTOR_TEST_CASE
208tstCollector_LDFLAGS.darwin = -lproc
209tstCollector_LDFLAGS.solaris = -lkstat -lnvpair
210tstCollector_LDFLAGS.win = psapi.lib powrprof.lib
211
212
213#
214# tstGuestCtrlContextID
215#
216# Note! See notes on tstCollector.
217#
218tstGuestCtrlContextID_TEMPLATE = VBoxMainClientTstExe
219tstGuestCtrlContextID_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
220tstGuestCtrlContextID_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
221tstGuestCtrlContextID_SOURCES = \
222 tstGuestCtrlContextID.cpp \
223 ../src-client/GuestCtrlPrivate.cpp
224tstGuestCtrlContextID_INCS = ../include \
225 $(VBOX_MAIN_APIWRAPPER_INCS)
226
227
228#
229# tstGuestCtrlParseBuffer
230#
231# Note! See notes on tstCollector.
232#
233tstGuestCtrlParseBuffer_TEMPLATE = VBoxMainClientTstExe
234tstGuestCtrlParseBuffer_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
235tstGuestCtrlParseBuffer_DEFS += VBOX_WITH_HGCM VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
236tstGuestCtrlParseBuffer_SOURCES = \
237 tstGuestCtrlParseBuffer.cpp \
238 ../src-client/GuestCtrlPrivate.cpp
239tstGuestCtrlParseBuffer_INCS = ../include \
240 $(VBOX_MAIN_APIWRAPPER_INCS)
241
242
243#
244# tstGuestCtrlPaths
245#
246# Note! See notes on tstCollector.
247#
248tstGuestCtrlPaths_TEMPLATE = VBoxMainClientTstExe
249tstGuestCtrlPaths_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
250tstGuestCtrlPaths_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
251tstGuestCtrlPaths_SOURCES = \
252 tstGuestCtrlPaths.cpp \
253 ../src-client/GuestCtrlPrivate.cpp
254tstGuestCtrlPaths_INCS = ../include \
255 $(VBOX_MAIN_APIWRAPPER_INCS)
256
257if 0 # Enable this if you want automatic runs after compilation.
258 $$(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run: $$(tstGuestCtrlPaths_1_STAGE_TARGET)
259 export VBOX_LOG_DEST=nofile; $(tstGuestCtrlPaths_1_STAGE_TARGET) quiet
260 $(QUIET)$(APPEND) -t "$@" "done"
261 OTHERS += $(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run
262endif
263
264
265#
266# tstUSBProxyLinux
267#
268# Note! See notes on tstCollector.
269#
270tstUSBProxyLinux_TEMPLATE = VBoxMainClientTstExe
271tstUSBProxyLinux_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
272tstUSBProxyLinux_SOURCES = \
273 tstUSBProxyLinux.cpp \
274 ../src-server/linux/USBGetDevices.cpp
275tstUSBProxyLinux_INCS = \
276 . \
277 ../include \
278 $(VBOX_PATH_SDK)/bindings/xpcom/include \
279 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
280 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
281 $(VBOX_MAIN_APIWRAPPER_INCS)
282tstUSBProxyLinux_DEFS = \
283 UNIT_TEST \
284 VBOX_WITH_USB \
285 VBOX_USB_WITH_SYSFS \
286 VBOX_WITH_XPCOM
287tstUSBProxyLinux_DEPS = \
288 $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
289tstUSBProxyLinux_LIBS += \
290 $(PATH_OUT)/lib/USBLib.a \
291 $(PATH_OUT)/lib/VBoxCOM.a
292
293
294#
295# tstMediumLock
296#
297tstMediumLock_TEMPLATE = VBoxMainClientTstExe
298tstMediumLock_SOURCES = tstMediumLock.cpp
299
300
301#
302# tstSafeArray
303#
304tstSafeArray_TEMPLATE = VBoxMainClientTstExe
305tstSafeArray_SOURCES = tstSafeArray.cpp
306
307
308#
309# tstRecording
310#
311tstRecording_TEMPLATE = VBoxMainClientTstExe
312tstRecording_SOURCES = \
313 tstRecording.cpp \
314 ../src-client/RecordingUtils.cpp
315tstRecording_INCS = \
316 ../include
317
318#
319# tstSettings
320#
321# Note! See notes on tstCollector.
322#
323tstSettings_TEMPLATE = VBoxMainClientTstExe
324tstSettings_INTERMEDIATES = \
325 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS) \
326 $(VBOX_XML_SCHEMADEFS_H)
327tstSettings_INCS = \
328 ../include \
329 $(VBOX_MAIN_APIWRAPPER_INCS) \
330 $(dir $(VBOX_XML_SCHEMADEFS_H))
331tstSettings_SOURCES = \
332 tstSettings.cpp \
333 ../src-all/HashedPw.cpp \
334 ../xml/Settings.cpp
335
336#
337# tstBstr
338#
339tstBstr_TEMPLATE = VBoxMainClientTstExe
340tstBstr_SOURCES = tstBstr.cpp
341
342
343#
344# tstGuid
345#
346tstGuid_TEMPLATE = VBoxMainClientTstExe
347tstGuid_SOURCES = tstGuid.cpp
348
349
350#
351# tstUnattendedScript
352#
353# Note! See notes on tstCollector.
354#
355tstUnattendedScript_TEMPLATE = VBoxMainClientTstExe
356tstUnattendedScript_DEFS = VBOX_WITH_UNATTENDED IN_VBOXSVC IN_TST_UNATTENDED_SCRIPT
357tstUnattendedScript_INTERMEDIATES = \
358 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS) \
359 $(VBOX_XML_SCHEMADEFS_H)
360tstUnattendedScript_INCS = \
361 ../include \
362 $(VBOX_MAIN_APIWRAPPER_INCS) \
363 $(dir $(VBOX_XML_SCHEMADEFS_H))
364tstUnattendedScript_SOURCES = \
365 tstUnattendedScript.cpp \
366 ../src-server/UnattendedScript.cpp \
367 ../src-all/TextScript.cpp \
368 ../src-all/VirtualBoxBase.cpp \
369 ../src-all/VirtualBoxErrorInfoImpl.cpp \
370 ../src-all/AutoCaller.cpp \
371 ../src-all/GlobalStatusConversion.cpp
372tstUnattendedScript_LIBS = \
373 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
374
375INSTALLS += tstUnattendedScriptFiles
376tstUnattendedScriptFiles_TEMPLATE = VBoxMainTstExe
377tstUnattendedScriptFiles_SOURCES = \
378 tstUnattendedScript-1.template \
379 tstUnattendedScript-1.expected
380
381
382#
383# tstVBoxCrypto
384#
385tstVBoxCrypto_TEMPLATE = VBoxMainClientTstExe
386tstVBoxCrypto_SOURCES = tstVBoxCrypto.cpp
387
388
389
390# generate rules.
391include $(FILE_KBUILD_SUB_FOOTER)
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