poppler: Upgrade 24.05.0
[LibreOffice.git] / solenv / gbuild / CppunitTest.mk
blobcfca2bbbf570ad41fd4acf467bd14c62911beade
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # CppunitTest class
22 gb_CppunitTest_UNITTESTFAILED ?= $(GBUILDDIR)/platform/unittest-failed-default.sh
23 gb_CppunitTest_PYTHONDEPS ?= $(call gb_Library_get_target,pyuno_wrapper) $(if $(SYSTEM_PYTHON),,$(call gb_Package_get_target,python3))
25 ifeq ($(WITH_COREDUMPCTL),)
26 gb_CppunitTest_coredumpctl_setup :=
27 gb_CppunitTest_coredumpctl_run :=
28 else
29 gb_CppunitTest_coredumpctl_setup = \
30 export LIBO_TEST_UNIT=$$($(SYSTEMD_ESCAPE) "$1:$$(date -u +%Y%m%d%H%M%S):$$$$$(if $2,:$2)" | cut -b -249) &&
31 gb_CppunitTest_coredumpctl_run := $(SYSTEMD_RUN) --scope --user --unit="$$LIBO_TEST_UNIT"
32 endif
34 ifneq ($(strip $(CPPUNITTRACE)),)
35 ifneq ($(filter gdb,$(CPPUNITTRACE)),)
36 # sneak (a) setting the LD_LIBRARY_PATH, and (b) setting malloc debug flags, into the "gdb --args" command line
37 gb_CppunitTest_GDBTRACE := $(subst gdb,\
38 gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\
39 $(CPPUNITTRACE))
40 gb_PythonTest_GDBTRACE := $(subst gdb,\
41 gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_PythonTest_PRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\
42 $(CPPUNITTRACE))
43 else ifneq ($(filter lldb,$(CPPUNITTRACE)),)
44 gb_CppunitTest_GDBTRACE := $(subst lldb,\
45 lldb -o "env $(gb_CppunitTest_CPPTESTPRECOMMAND)" $(gb_CppunitTest_malloc_check),\
46 $(CPPUNITTRACE))
47 gb_PythonTest_GDBTRACE := $(gb_CppunitTest_GDBTRACE)
48 else
49 gb_CppunitTest_GDBTRACE := $(CPPUNITTRACE)
50 gb_PythonTest_GDBTRACE := $(gb_CppunitTest_GDBTRACE)
51 endif
52 ifneq ($(strip $(DEBUGCPPUNIT)),TRUE)
53 gb_CppunitTest__interactive := $(true)
54 endif
55 endif
57 ifneq ($(strip $(VALGRIND)),)
58 gb_CppunitTest_VALGRINDTOOL := valgrind --tool=$(VALGRIND) --num-callers=50 --error-exitcode=1 --trace-children=yes --trace-children-skip='*/java,*/gij'
59 ifneq ($(strip $(VALGRIND_GDB)),)
60 gb_CppunitTest_VALGRINDTOOL += --vgdb=yes --vgdb-error=0
61 endif
62 ifeq ($(strip $(VALGRIND)),memcheck)
63 G_SLICE := always-malloc
64 GLIBCXX_FORCE_NEW := 1
65 endif
66 endif
68 ifneq (,$(filter perfcheck,$(MAKECMDGOALS)))
69 $(if $(ENABLE_VALGRIND),,$(call gb_Output_error,Running performance tests with empty $$(ENABLE_VALGRIND) does not make sense. Please install valgrind-dev and re-run autogen.))
70 gb_CppunitTest_VALGRINDTOOL := valgrind --tool=callgrind --dump-instr=yes --instr-atstart=no --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes
71 ifneq ($(strip $(VALGRIND_GDB)),)
72 gb_CppunitTest_VALGRINDTOOL += --vgdb=yes --vgdb-error=0
73 endif
74 endif
76 ifneq ($(strip $(RR)),)
77 gb_CppunitTest_RR := rr record
78 endif
80 # defined by platform
81 # gb_CppunitTest_get_filename
82 gb_CppunitTest_RUNTIMEDEPS := $(call gb_Executable_get_runtime_dependencies,cppunittester)
83 gb_CppunitTest_CPPTESTCOMMAND := $(call gb_Executable_get_target_for_build,cppunittester)
85 # i18npool dlopens localedata_* libraries.
86 gb_CppunitTest_RUNTIMEDEPS += \
87 $(call gb_Library_get_target,localedata_en) \
88 $(call gb_Library_get_target,localedata_es) \
89 $(call gb_Library_get_target,localedata_euro) \
90 $(call gb_Library_get_target,localedata_others) \
91 $(call gb_Package_get_target,test_unittest) \
93 define gb_CppunitTest__make_args
94 $(HEADLESS) \
95 "-env:BRAND_BASE_DIR=$(call gb_Helper_make_url,$(INSTROOT))" \
96 "-env:BRAND_SHARE_SUBDIR=$(LIBO_SHARE_FOLDER)" \
97 "-env:BRAND_SHARE_RESOURCE_SUBDIR=$(LIBO_SHARE_RESOURCE_FOLDER)" \
98 "-env:UserInstallation=$(call gb_Helper_make_url,$(call gb_CppunitTest_get_target,$*).user)" \
99 $(if $(URE),\
100 $(if $(strip $(CONFIGURATION_LAYERS)),\
101 "-env:CONFIGURATION_LAYERS=$(strip $(CONFIGURATION_LAYERS))") \
102 $(if $(strip $(UNO_TYPES)),\
103 "-env:UNO_TYPES=$(foreach item,$(UNO_TYPES),$(call gb_Helper_make_url,$(item)))") \
104 $(if $(strip $(UNO_SERVICES)),\
105 "-env:UNO_SERVICES=$(foreach item,$(UNO_SERVICES),$(call gb_Helper_make_url,$(item)))" -env:URE_BIN_DIR=$(call gb_Helper_make_url,$(INSTROOT)/$(LIBO_URE_BIN_FOLDER))) \
106 -env:URE_INTERNAL_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT)/$(LIBO_URE_LIB_FOLDER)) \
107 -env:LO_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT)/$(LIBO_LIB_FOLDER)) \
108 -env:LO_JAVA_DIR=$(call gb_Helper_make_url,$(INSTROOT)/$(LIBO_SHARE_JAVA_FOLDER)) \
109 --protector $(call gb_Library_get_target,unoexceptionprotector) unoexceptionprotector \
110 --protector $(call gb_Library_get_target,unobootstrapprotector) unobootstrapprotector \
112 $(if $(VCL),\
113 --protector $(call gb_Library_get_target,vclbootstrapprotector) vclbootstrapprotector \
115 $(ARGS)
116 endef
118 .PHONY : $(call gb_CppunitTest_get_clean_target,%)
119 $(call gb_CppunitTest_get_clean_target,%) :
120 $(call gb_Helper_abbreviate_dirs,\
121 rm -f $(call gb_CppunitTest_get_target,$*) $(call gb_CppunitTest_get_target,$*).log)
123 .PHONY : $(call gb_CppunitTest_get_target,%)
124 $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_RUNTIMEDEPS)
125 ifneq ($(gb_SUPPRESS_TESTS),)
126 @true
127 else
128 $(call gb_Output_announce,$*,$(true),CUT,2)
129 $(call gb_Trace_StartRange,$*,CUT)
130 $(call gb_Helper_abbreviate_dirs,\
131 mkdir -p $(dir $@) && \
132 rm -fr $@.user && cp -r $(WORKDIR)/unittest $@.user && \
133 $(if $(gb_CppunitTest__use_confpreinit), \
134 $(INSTDIR)/program/lokconf_init $(call gb_CppunitTest__make_args) &&) \
135 $(if $(gb_CppunitTest__interactive),, \
136 $(if $(value gb_CppunitTest_postprocess), \
137 rm -fr $@.core && mkdir $@.core && cd $@.core &&)) \
138 $(if $(gb_CppunitTest_localized),for l in $(WITH_LANG_LIST) ; do) \
139 $(call gb_CppunitTest_coredumpctl_setup,$@,$(if $(gb_CppunitTest_localized),$$l)) \
141 $(if $(gb_CppunitTest_localized),printf 'LO_TEST_LOCALE=%s\n' "$$l" && ) \
142 $(if $(gb_CppunitTest_localized),LO_TEST_LOCALE="$$l") \
143 $(if $(gb_CppunitTest__vcl_no_svp), \
144 $(filter-out SAL_USE_VCLPLUGIN=svp,$(gb_TEST_ENV_VARS)),$(gb_TEST_ENV_VARS)) \
145 $(EXTRA_ENV_VARS) \
146 $(if $(filter allow,$(NON_APPLICATION_FONT_USE)),, \
147 $(if $(filter abort,$(NON_APPLICATION_FONT_USE)),SAL_NON_APPLICATION_FONT_USE=abort, \
148 $(if $(filter deny,$(NON_APPLICATION_FONT_USE)),SAL_NON_APPLICATION_FONT_USE=deny))) \
149 $(if $(filter gdb,$(gb_CppunitTest_GDBTRACE)),,$(gb_CppunitTest_CPPTESTPRECOMMAND)) \
150 $(if $(G_SLICE),G_SLICE=$(G_SLICE)) \
151 $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \
152 $(if $(strip $(PYTHON_URE)),\
153 PYTHONDONTWRITEBYTECODE=1) \
154 $(if $(filter gdb,$(CPPUNITTRACE)),\
155 PYTHONWARNINGS=default) \
156 $(ICECREAM_RUN) $(gb_CppunitTest_coredumpctl_run) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \
157 $(gb_CppunitTest_CPPTESTCOMMAND) \
158 $(call gb_CppunitTest_get_linktarget_target,$*) \
159 $(call gb_CppunitTest__make_args) "-env:CPPUNITTESTTARGET=$@" \
161 $(if $(gb_CppunitTest__interactive),$(if $(gb_CppunitTest_localized),|| exit $$?), \
162 > $@.$(if $(gb_CppunitTest_localized),$$l.)log 2>&1 \
163 || { $(if $(value gb_CppunitTest_postprocess), \
164 RET=$$?; \
165 $(call gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core,$$RET) >> $@.$(if $(gb_CppunitTest_localized),$$l.)log 2>&1;) \
166 cat $@.$(if $(gb_CppunitTest_localized),$$l.)log; $(gb_CppunitTest_UNITTESTFAILED) Cppunit $*; \
167 $(if $(gb_CppunitTest_localized),exit $$RET;) } ) \
168 $(if $(gb_CppunitTest_localized),; done))
169 $(call gb_Trace_EndRange,$*,CUT)
170 endif
172 define gb_CppunitTest_CppunitTest
173 $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1)))
175 endef
177 define gb_CppunitTest_CppunitScreenShot
178 $(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest_localized := $(true)
179 $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1)))
181 endef
183 define gb_CppunitTest_register_target
184 endef
186 # call gb_CppunitTest__CppunitTest_impl,cppunittest,linktarget
187 define gb_CppunitTest__CppunitTest_impl
188 $(call gb_CppunitTest_register_target, $(1), $(2), "test")
189 $(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1),NONE)
190 $(call gb_LinkTarget_set_targettype,$(2),CppunitTest)
191 $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
192 $(call gb_LinkTarget_add_defs,$(2),\
193 $(gb_CppunitTest_DEFS) \
195 $(call gb_LinkTarget_use_external,$(2),cppunit)
196 $(call gb_LinkTarget_set_include,$(2),\
197 $$(INCLUDE) \
198 $(filter -I%,$(CPPUNIT_CFLAGS)) \
200 $(call gb_LinkTarget_add_defs,$(2), \
201 $(filter-out -I%,$(CPPUNIT_CFLAGS)) \
202 -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT' \
204 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
205 $(call gb_CppunitTest_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
206 $(call gb_CppunitTest_CppunitTest_platform,$(1),$(2),$(gb_CppunitTest_DLLDIR)/$(call gb_CppunitTest_get_ilibfilename,$(1)))
207 $(call gb_CppunitTest_get_target,$(1)) : ARGS :=
208 $(call gb_CppunitTest_get_target,$(1)) : CONFIGURATION_LAYERS :=
209 $(call gb_CppunitTest_get_target,$(1)) : PYTHON_URE := $(false)
210 $(call gb_CppunitTest_get_target,$(1)) : URE := $(false)
211 $(call gb_CppunitTest_get_target,$(1)) : VCL := $(false)
212 $(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES :=
213 $(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES :=
214 $(call gb_CppunitTest_get_target,$(1)) : HEADLESS := --headless
215 $(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS :=
216 $(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE :=
217 $$(eval $$(call gb_Module_register_target,$(call gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1))))
218 $(call gb_Helper_make_userfriendly_targets,$(1),CppunitTest)
220 endef
222 # Add additional command line arguments for the test.
224 # You should practically never need to use this, as there are special
225 # functions for adding many commonly used arguments.
226 define gb_CppunitTest_add_arguments
227 $(call gb_CppunitTest_get_target,$(1)) : ARGS += $(2)
229 endef
231 define gb_CppunitTest_use_ure
232 $(call gb_CppunitTest_use_rdb,$(1),ure/services)
233 $(call gb_CppunitTest_get_target,$(1)) : URE := $(true)
234 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,$(CPPU_ENV)_uno)
235 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,affine_uno)
236 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unobootstrapprotector)
237 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unoexceptionprotector)
239 endef
241 # $(2) == $(true) if headless:
242 define gb_CppunitTest__use_vcl
243 $(call gb_CppunitTest_get_target,$(1)) : VCL := $(true)
244 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,vclbootstrapprotector)
245 ifeq ($(USING_X11),TRUE)
246 $(call gb_CppunitTest_get_target,$(1)) : $(if $(filter $(2),$(true)),, \
247 $(call gb_Library_get_target,vclplug_gen) \
248 $(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \
249 $(if $(ENABLE_GTK4),$(call gb_Library_get_target,vclplug_gtk4)) \
250 $(if $(ENABLE_QT5),$(call gb_Library_get_target,vclplug_qt5)) \
251 $(if $(ENABLE_QT6),$(call gb_Library_get_target,vclplug_qt6)) \
253 else ifeq ($(OS),MACOSX)
254 $(call gb_CppunitTest_get_target,$(1)): $(call gb_Library_get_target,vclplug_osx)
255 else ifeq ($(OS),WNT)
256 $(call gb_CppunitTest_get_target,$(1)): $(call gb_Library_get_target,vclplug_win)
257 endif
259 endef
261 define gb_CppunitTest_use_confpreinit
262 $(call gb_CppunitTest_use_executable,$(1),lokconf_init)
263 $(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__use_confpreinit := TRUE
265 endef
267 define gb_CppunitTest_use_vcl
268 $(call gb_CppunitTest__use_vcl,$(1),$(true))
270 endef
272 define gb_CppunitTest_use_vcl_non_headless
273 $(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true)
274 $(call gb_CppunitTest__use_vcl,$(1),$(false))
276 endef
278 define gb_CppunitTest_use_vcl_non_headless_with_windows
279 $(call gb_CppunitTest_get_target,$(1)) : HEADLESS :=
280 $(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true)
281 $(call gb_CppunitTest__use_vcl,$(1),$(false))
283 endef
285 define gb_CppunitTest__use_api
286 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_UnoApi_get_target,$(2))
287 $(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES += $(call gb_UnoApi_get_target,$(2))
289 endef
291 define gb_CppunitTest_use_api
292 $(call gb_LinkTarget_use_api,$(call gb_CppunitTest_get_linktarget,$(1)),$(2))
293 $(foreach rdb,$(2),$(call gb_CppunitTest__use_api,$(1),$(rdb)))
295 endef
297 define gb_CppunitTest_use_udk_api
298 $(call gb_CppunitTest_use_api,$(1),udkapi)
300 endef
302 define gb_CppunitTest_use_sdk_api
303 $(call gb_CppunitTest_use_api,$(1),udkapi offapi)
305 endef
307 define gb_CppunitTest_use_rdb
308 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Rdb_get_target_for_build,$(2))
309 $(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES += $(call gb_Rdb_get_target_for_build,$(2))
311 endef
313 define gb_CppunitTest_use_rdbs
314 $(foreach rdb,$(2),$(call gb_CppunitTest_use_rdb,$(1),$(rdb)))
316 endef
318 define gb_CppunitTest_use_component
319 $(call gb_CppunitTest_get_target,$(1)) : \
320 $(call gb_ComponentTarget_get_target,$(2))
321 $(call gb_CppunitTest_get_target,$(1)) : \
322 UNO_SERVICES += $(call gb_ComponentTarget_get_target,$(2))
324 endef
326 define gb_CppunitTest_set_componentfile
327 $(call gb_ComponentTarget_ComponentTarget,CppunitTest/$(2),\
328 $(call gb_Helper_make_url,$(gb_CppunitTest_DLLDIR))/,\
329 $(call gb_CppunitTest_get_filename,$(1)))
330 $(call gb_CppunitTest_get_target,$(1)) : \
331 $(call gb_ComponentTarget_get_target,CppunitTest/$(2))
332 $(call gb_CppunitTest_get_clean_target,$(1)) : \
333 $(call gb_ComponentTarget_get_clean_target,CppunitTest/$(2))
334 $(call gb_CppunitTest_use_component,$(1),CppunitTest/$(2))
336 endef
338 # Given a list of component files, filter out those corresponding
339 # to libraries not built in this configuration.
340 define gb_CppunitTest__filter_not_built_components
341 $(filter-out \
342 $(if $(filter SCRIPTING,$(BUILD_TYPE)),, \
343 basic/util/sb \
344 sw/util/vbaswobj \
345 scripting/source/basprov/basprov \
346 scripting/util/scriptframe) \
347 $(if $(filter DBCONNECTIVITY,$(BUILD_TYPE)),, \
348 dbaccess/util/dba \
349 forms/util/frm),$(1))
350 endef
352 define gb_CppunitTest_use_components
353 $(foreach component,$(call gb_CppunitTest__filter_not_built_components,$(2)),$(call gb_CppunitTest_use_component,$(1),$(component)))
355 endef
357 define gb_CppunitTest__use_configuration
358 $(call gb_CppunitTest_get_target,$(1)) : CONFIGURATION_LAYERS += $(2):$(call gb_Helper_make_url,$(3))
360 endef
362 # Use instdir configuration
363 define gb_CppunitTest_use_instdir_configuration
364 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,postprocess_registry)
365 $(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry)
367 endef
369 # Use configuration in $(WORKDIR)/unittest/registry-common.
370 define gb_CppunitTest_use_common_configuration
371 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,test_unittest)
372 $(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(WORKDIR)/unittest/registry-common)
374 endef
376 # Use configuration in $(WORKDIR)/unittest/registry-user-ui
377 define gb_CppunitTest_use_user_ui_configuration
378 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,test_unittest)
379 $(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(WORKDIR)/unittest/registry-user-ui)
381 endef
383 # Use standard configuration: instdir config + common + user-ui config (in this order!)
384 define gb_CppunitTest_use_configuration
385 $(call gb_CppunitTest_use_instdir_configuration,$(1))
386 $(call gb_CppunitTest_use_common_configuration,$(1))
387 $(call gb_CppunitTest_use_user_ui_configuration,$(1))
389 endef
391 define gb_CppunitTest_use_executable
392 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Executable_get_target,$(2))
394 endef
396 # One of allow, deny, abort:
397 define gb_CppunitTest_set_non_application_font_use
398 $(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE += $(2)
400 endef
402 define gb_CppunitTest_use_more_fonts
403 ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
404 $(call gb_CppunitTest_get_target,$(1)) : \
405 $(foreach font,$(gb_Package_MODULE_ooo_fonts),$(call gb_Package_get_target,$(font)))
406 $(call gb_CppunitTest_set_non_application_font_use,$(1),deny)
407 endif
409 endef
411 define gb_CppunitTest__use_java_ure
412 $(call gb_CppunitTest_get_target,$(1)) : \
413 $(foreach jar,java_uno libreoffice unoloader,$(call gb_Jar_get_target,$(jar))) \
414 $(call gb_Library_get_target,affine_uno_uno) \
415 $(call gb_Library_get_target,java_uno) \
416 $(call gb_Library_get_target,jpipe) \
417 $(call gb_Library_get_target,juhx) \
418 $(call gb_Library_get_target,juhx) \
419 $(call gb_Library_get_target,jvmaccess) \
420 $(call gb_Library_get_target,jvmfwk) \
421 $(call gb_Package_get_target,jvmfwk_javavendors) \
422 $(call gb_Package_get_target,jvmfwk_jreproperties) \
423 $(call gb_Package_get_target,jvmfwk_jvmfwk3_ini) \
425 endef
427 define gb_CppunitTest_use_jar
428 $(call gb_CppunitTest__use_java_ure,$(1))
429 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_Jar_get_target,$(2))
431 endef
433 define gb_CppunitTest_use_jars
434 $(foreach jar,$(2),$(call gb_CppunitTest_use_jar,$(1),$(jar)))
436 endef
438 define gb_CppunitTest_use_python_ure
439 $(call gb_CppunitTest_get_target,$(1)) : PYTHON_URE := $(true)
440 $(call gb_CppunitTest_get_target,$(1)) :\
441 $(call gb_Library_get_target,pythonloader) \
442 $(call gb_Library_get_target,pyuno) \
443 $(gb_CppunitTest_PYTHONDEPS) \
444 $(call gb_Package_get_target,pyuno_python_scripts)
446 endef
448 define gb_CppunitTest_use_uiconfig
449 $(call gb_CppunitTest_get_target,$(1)) : $(call gb_UIConfig_get_target,$(2))
451 endef
453 define gb_CppunitTest_use_uiconfigs
454 $(foreach uiconfig,$(2),$(call gb_CppunitTest_use_uiconfig,$(1),$(uiconfig)))
456 endef
458 # forward the call to the gb_LinkTarget implementation
459 # (note: because the function name is in $(1), the other args are shifted by 1)
460 define gb_CppunitTest__forward_to_Linktarget
461 $(call gb_LinkTarget_$(subst gb_CppunitTest_,,$(1)),$(call gb_CppunitTest_get_linktarget,$(2)),$(3),$(4),CppunitTest_$(2))
463 endef
465 # copy pasta for forwarding: this could be (and was) done more elegantly, but
466 # these here can be found by both git grep and ctags
467 gb_CppunitTest_add_cobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
468 gb_CppunitTest_add_cobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
469 gb_CppunitTest_add_cxxobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
470 gb_CppunitTest_add_cxxobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
471 gb_CppunitTest_add_exception_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
472 gb_CppunitTest_use_executable_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
473 gb_CppunitTest_use_library_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
474 gb_CppunitTest_use_libraries = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
475 gb_CppunitTest_use_static_libraries = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
476 gb_CppunitTest_add_objcobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
477 gb_CppunitTest_add_objcobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
478 gb_CppunitTest_add_objcxxobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
479 gb_CppunitTest_add_objcxxobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
480 gb_CppunitTest_add_cxxclrobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
481 gb_CppunitTest_add_cxxclrobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
482 gb_CppunitTest_add_asmobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
483 gb_CppunitTest_add_asmobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
484 gb_CppunitTest_use_package = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
485 gb_CppunitTest_use_packages = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
486 gb_CppunitTest_set_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
487 gb_CppunitTest_reuse_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
488 gb_CppunitTest_use_common_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
489 gb_CppunitTest_add_sdi_headers = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
490 gb_CppunitTest_add_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
491 gb_CppunitTest_set_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
492 gb_CppunitTest_add_cxxflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
493 gb_CppunitTest_set_yaccflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
494 gb_CppunitTest_add_objcflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
495 gb_CppunitTest_add_objcxxflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
496 gb_CppunitTest_add_cxxclrflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
497 gb_CppunitTest_add_defs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
498 gb_CppunitTest_set_include = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
499 gb_CppunitTest_add_ldflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
500 gb_CppunitTest_set_ldflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
501 gb_CppunitTest_add_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
502 gb_CppunitTest_disable_standard_system_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
503 gb_CppunitTest_use_system_darwin_frameworks = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
504 gb_CppunitTest_use_system_win32_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
505 gb_CppunitTest_use_internal_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
506 gb_CppunitTest_use_internal_bootstrap_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
507 gb_CppunitTest_use_internal_comprehensive_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
508 gb_CppunitTest_set_library_path_flags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
509 gb_CppunitTest_use_external = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
510 gb_CppunitTest_use_externals = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
511 gb_CppunitTest_use_custom_headers = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
512 gb_CppunitTest_set_visibility_default = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
513 gb_CppunitTest_set_warnings_not_errors = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
514 gb_CppunitTest_set_warnings_disabled = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
515 gb_CppunitTest_set_external_code = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
516 gb_CppunitTest_set_generated_cxx_suffix = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
517 gb_CppunitTest_use_clang = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
518 gb_CppunitTest_set_clang_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
519 gb_CppunitTest_use_vclmain = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
520 gb_CppunitTest_add_prejs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3))
522 # vim: set noet sw=4: