blob: 90bd18a84a6f6b59545339deaef8772876d19642 (
plain)
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
|
# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Shared Clipboard Host Service testcases.
#
#
# Copyright (C) 2011-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
if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK)
#
# Testcase which mocks HGCM to also test the VbglR3-side of Shared Clipboard.
#
# Goal is to use and test as much guest side code as possible as a self-contained
# binary on the host here.
#
# Note: No #ifdef TESTCASE hacks or similar allowed, has to run
# without #ifdef modifications to the core code!
#
tstClipboardMockHGCM_TEMPLATE = VBOXR3TSTEXE
tstClipboardMockHGCM_DEFS = VBOX_WITH_HGCM VBOX_WITH_SHARED_CLIPBOARD
tstClipboardMockHGCM_SOURCES = \
../VBoxSharedClipboardSvc.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \
$(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp \
$(PATH_ROOT)/src/VBox/HostServices/common/message.cpp \
tstClipboardMockHGCM.cpp
tstClipboardMockHGCM_LIBS = $(LIB_RUNTIME)
if1of ($(KBUILD_TARGET), linux solaris)
PROGRAMS += tstClipboardMockHGCM
tstClipboardMockHGCM_SOURCES += \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp \
../VBoxSharedClipboardSvc-x11.cpp
tstClipboardMockHGCM_LIBPATH = \
$(VBOX_LIBPATH_X11)
tstClipboardMockHGCM_LIBS += \
Xt \
X11
endif
if1of ($(KBUILD_TARGET), win)
PROGRAMS += tstClipboardMockHGCM
tstClipboardMockHGCM_SOURCES += \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp \
../VBoxSharedClipboardSvc-win.cpp
endif
tstClipboardMockHGCM_CLEAN = $(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run
if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS)
tstClipboardMockHGCM_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
tstClipboardMockHGCM_SOURCES += \
../VBoxSharedClipboardSvc-transfers.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
endif
if 0 # Enable this if you want automatic runs after compilation.
$$(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run: $$(tstClipboardMockHGCM_1_STAGE_TARGET)
export VBOX_LOG_DEST=nofile; $(tstClipboardMockHGCM_1_STAGE_TARGET) quiet
$(QUIET)$(APPEND) -t "$@" "done"
OTHERS += $(tstClipboardMockHGCM_0_OUTDIR)/tstClipboardMockHGCM.run
endif
#
#
#
PROGRAMS += tstClipboardServiceHost
tstClipboardServiceHost_TEMPLATE = VBOXR3TSTEXE
tstClipboardServiceHost_DEFS = VBOX_WITH_HGCM UNIT_TEST
tstClipboardServiceHost_SOURCES = \
../VBoxSharedClipboardSvc.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \
$(PATH_ROOT)/src/VBox/HostServices/common/message.cpp \
tstClipboardServiceHost.cpp
tstClipboardServiceHost_LIBS = $(LIB_RUNTIME)
tstClipboardServiceHost_CLEAN = $(tstClipboardServiceHost_0_OUTDIR)/tstClipboardServiceHost.run
if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS)
tstClipboardServiceHost_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
tstClipboardServiceHost_SOURCES += \
../VBoxSharedClipboardSvc-transfers.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
endif
#
#
#
PROGRAMS += tstClipboardServiceImpl
tstClipboardServiceImpl_TEMPLATE = VBOXR3TSTEXE
tstClipboardServiceImpl_DEFS = VBOX_WITH_HGCM UNIT_TEST
tstClipboardServiceImpl_SOURCES = \
../VBoxSharedClipboardSvc.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \
$(PATH_ROOT)/src/VBox/HostServices/common/message.cpp \
tstClipboardServiceImpl.cpp
tstClipboardServiceImpl_SOURCES.win = \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp
tstClipboardServiceImpl_LIBS = $(LIB_RUNTIME)
tstClipboardServiceImpl_CLEAN = $(tstClipboardServiceImpl_0_OUTDIR)/tstClipboardServiceImpl.run
if defined(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS)
#
#
#
PROGRAMS += tstClipboardTransfers
tstClipboardTransfers_TEMPLATE = VBOXR3TSTEXE
tstClipboardTransfers_DEFS = VBOX_WITH_HGCM UNIT_TEST VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
tstClipboardTransfers_SOURCES = \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp \
$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp \
tstClipboardTransfers.cpp
endif
endif
#
# List of above testcases that will be included in the ValKit.
#
ifdef VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
if1of ($(KBUILD_TARGET), linux solaris win)
VALKIT_UNITTESTS_WHITELIST_GUEST_ADDITIONS += \
tstClipboardMockHGCM
endif
endif # VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
include $(FILE_KBUILD_SUB_FOOTER)
|