| 1 |
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 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/. |
| 8 |
# |
| 9 |
# This file incorporates work covered by the following license notice: |
| 10 |
# |
| 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 . |
| 18 |
# |
| 19 |
|
| 20 |
# CppunitTest class |
| 21 |
|
| 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)) |
| 24 |
|
| 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 |
| 33 |
|
| 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 |
| 56 |
|
| 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 |
| 67 |
|
| 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 |
| 75 |
|
| 76 |
ifneq ($(strip $(RR)),) |
| 77 |
gb_CppunitTest_RR := rr record |
| 78 |
endif |
| 79 |
|
| 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) |
| 84 |
|
| 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) \ |
| 92 |
|
| 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 \ |
| 111 |
) \ |
| 112 |
$(if $(VCL),\ |
| 113 |
--protector $(call gb_Library_get_target,vclbootstrapprotector) vclbootstrapprotector \ |
| 114 |
) \ |
| 115 |
$(ARGS) |
| 116 |
endef |
| 117 |
|
| 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) |
| 122 |
|
| 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 [email protected] && cp -r $(WORKDIR)/unittest [email protected] && \ |
| 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 [email protected] && mkdir [email protected] && cd [email protected] &&)) \ |
| 138 |
$(if $(gb_CppunitTest_localized),for l in $(WITH_LANG_LIST) ; do) \ |
| 139 |
$(call gb_CppunitTest_coredumpctl_setup,$@,$(if $(gb_CppunitTest_localized),$$l)) \ |
| 140 |
( \ |
| 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 $(G_SLICE),G_SLICE=$(G_SLICE)) \ |
| 147 |
$(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ |
| 148 |
$(if $(strip $(PYTHON_URE)),\ |
| 149 |
PYTHONDONTWRITEBYTECODE=1) \ |
| 150 |
$(if $(filter gdb,$(CPPUNITTRACE)),\ |
| 151 |
PYTHONWARNINGS=default) \ |
| 152 |
LO_RUNNING_UNIT_TEST=1 \ |
| 153 |
$(ICECREAM_RUN) $(gb_CppunitTest_coredumpctl_run) \ |
| 154 |
$(if $(filter gdb,$(gb_CppunitTest_GDBTRACE)),,\ |
| 155 |
$(if $(filter lldb,$(gb_CppunitTest_GDBTRACE)),,\ |
| 156 |
env $(gb_CppunitTest_CPPTESTPRECOMMAND))) \ |
| 157 |
$(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \ |
| 158 |
$(gb_CppunitTest_CPPTESTCOMMAND) \ |
| 159 |
$(call gb_CppunitTest_get_linktarget_target,$*) \ |
| 160 |
$(call gb_CppunitTest__make_args) "-env:CPPUNITTESTTARGET=$@" \ |
| 161 |
) \ |
| 162 |
$(if $(gb_CppunitTest__interactive),$(if $(gb_CppunitTest_localized),|| exit $$?), \ |
| 163 |
2>&1 ) \ |
| 164 |
$(if $(gb_CppunitTest_localized),; done)) |
| 165 |
$(call gb_Trace_EndRange,$*,CUT) |
| 166 |
endif |
| 167 |
|
| 168 |
define gb_CppunitTest_CppunitTest |
| 169 |
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1))) |
| 170 |
|
| 171 |
endef |
| 172 |
|
| 173 |
define gb_CppunitTest_CppunitScreenShot |
| 174 |
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest_localized := $(true) |
| 175 |
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest_get_linktarget,$(1))) |
| 176 |
|
| 177 |
endef |
| 178 |
|
| 179 |
define gb_CppunitTest_register_target |
| 180 |
endef |
| 181 |
|
| 182 |
# call gb_CppunitTest__CppunitTest_impl,cppunittest,linktarget |
| 183 |
define gb_CppunitTest__CppunitTest_impl |
| 184 |
$(call gb_CppunitTest_register_target, $(1), $(2), "test") |
| 185 |
$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1),NONE) |
| 186 |
$(call gb_LinkTarget_set_targettype,$(2),CppunitTest) |
| 187 |
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS)) |
| 188 |
$(call gb_LinkTarget_add_defs,$(2),\ |
| 189 |
$(gb_CppunitTest_DEFS) \ |
| 190 |
) |
| 191 |
$(call gb_LinkTarget_use_external,$(2),cppunit) |
| 192 |
$(call gb_LinkTarget_set_include,$(2),\ |
| 193 |
$$(INCLUDE) \ |
| 194 |
$(filter -I%,$(CPPUNIT_CFLAGS)) \ |
| 195 |
) |
| 196 |
$(call gb_LinkTarget_add_defs,$(2), \ |
| 197 |
$(filter-out -I%,$(CPPUNIT_CFLAGS)) \ |
| 198 |
-DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT' \ |
| 199 |
) |
| 200 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) |
| 201 |
$(call gb_CppunitTest_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) |
| 202 |
$(call gb_CppunitTest_CppunitTest_platform,$(1),$(2),$(gb_CppunitTest_DLLDIR)/$(call gb_CppunitTest_get_ilibfilename,$(1))) |
| 203 |
$(call gb_CppunitTest_get_target,$(1)) : ARGS := |
| 204 |
$(call gb_CppunitTest_get_target,$(1)) : CONFIGURATION_LAYERS := |
| 205 |
$(call gb_CppunitTest_get_target,$(1)) : PYTHON_URE := $(false) |
| 206 |
$(call gb_CppunitTest_get_target,$(1)) : URE := $(false) |
| 207 |
$(call gb_CppunitTest_get_target,$(1)) : VCL := $(false) |
| 208 |
$(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES := |
| 209 |
$(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES := |
| 210 |
$(call gb_CppunitTest_get_target,$(1)) : HEADLESS := --headless |
| 211 |
$(call gb_CppunitTest_get_target,$(1)) : EXTRA_ENV_VARS := |
| 212 |
$(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE := |
| 213 |
$$(eval $$(call gb_Module_register_target,$(call gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1)))) |
| 214 |
$(call gb_Helper_make_userfriendly_targets,$(1),CppunitTest) |
| 215 |
|
| 216 |
endef |
| 217 |
|
| 218 |
# Add additional command line arguments for the test. |
| 219 |
# |
| 220 |
# You should practically never need to use this, as there are special |
| 221 |
# functions for adding many commonly used arguments. |
| 222 |
define gb_CppunitTest_add_arguments |
| 223 |
$(call gb_CppunitTest_get_target,$(1)) : ARGS += $(2) |
| 224 |
|
| 225 |
endef |
| 226 |
|
| 227 |
define gb_CppunitTest_use_ure |
| 228 |
$(call gb_CppunitTest_use_rdb,$(1),ure/services) |
| 229 |
$(call gb_CppunitTest_get_target,$(1)) : URE := $(true) |
| 230 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,$(CPPU_ENV)_uno) |
| 231 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,affine_uno) |
| 232 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unobootstrapprotector) |
| 233 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unoexceptionprotector) |
| 234 |
|
| 235 |
endef |
| 236 |
|
| 237 |
# $(2) == $(true) if headless: |
| 238 |
define gb_CppunitTest__use_vcl |
| 239 |
$(call gb_CppunitTest_get_target,$(1)) : VCL := $(true) |
| 240 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,vclbootstrapprotector) |
| 241 |
ifeq ($(USING_X11),TRUE) |
| 242 |
$(call gb_CppunitTest_get_target,$(1)) : $(if $(filter $(2),$(true)),, \ |
| 243 |
$(call gb_Library_get_target,vclplug_gen) \ |
| 244 |
$(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \ |
| 245 |
$(if $(ENABLE_GTK4),$(call gb_Library_get_target,vclplug_gtk4)) \ |
| 246 |
$(if $(ENABLE_QT5),$(call gb_Library_get_target,vclplug_qt5)) \ |
| 247 |
$(if $(ENABLE_QT6),$(call gb_Library_get_target,vclplug_qt6)) \ |
| 248 |
) |
| 249 |
else ifeq ($(OS),MACOSX) |
| 250 |
$(call gb_CppunitTest_get_target,$(1)): $(call gb_Library_get_target,vclplug_osx) |
| 251 |
else ifeq ($(OS),WNT) |
| 252 |
$(call gb_CppunitTest_get_target,$(1)): $(call gb_Library_get_target,vclplug_win) |
| 253 |
endif |
| 254 |
|
| 255 |
endef |
| 256 |
|
| 257 |
define gb_CppunitTest_use_confpreinit |
| 258 |
$(call gb_CppunitTest_use_executable,$(1),lokconf_init) |
| 259 |
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__use_confpreinit := TRUE |
| 260 |
|
| 261 |
endef |
| 262 |
|
| 263 |
define gb_CppunitTest_use_vcl |
| 264 |
$(call gb_CppunitTest__use_vcl,$(1),$(true)) |
| 265 |
|
| 266 |
endef |
| 267 |
|
| 268 |
define gb_CppunitTest_use_vcl_non_headless |
| 269 |
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true) |
| 270 |
$(call gb_CppunitTest__use_vcl,$(1),$(false)) |
| 271 |
|
| 272 |
endef |
| 273 |
|
| 274 |
define gb_CppunitTest_use_vcl_non_headless_with_windows |
| 275 |
$(call gb_CppunitTest_get_target,$(1)) : HEADLESS := |
| 276 |
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true) |
| 277 |
$(call gb_CppunitTest__use_vcl,$(1),$(false)) |
| 278 |
|
| 279 |
endef |
| 280 |
|
| 281 |
define gb_CppunitTest__use_api |
| 282 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_UnoApi_get_target,$(2)) |
| 283 |
$(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES += $(call gb_UnoApi_get_target,$(2)) |
| 284 |
|
| 285 |
endef |
| 286 |
|
| 287 |
define gb_CppunitTest_use_api |
| 288 |
$(call gb_LinkTarget_use_api,$(call gb_CppunitTest_get_linktarget,$(1)),$(2)) |
| 289 |
$(foreach rdb,$(2),$(call gb_CppunitTest__use_api,$(1),$(rdb))) |
| 290 |
|
| 291 |
endef |
| 292 |
|
| 293 |
define gb_CppunitTest_use_udk_api |
| 294 |
$(call gb_CppunitTest_use_api,$(1),udkapi) |
| 295 |
|
| 296 |
endef |
| 297 |
|
| 298 |
define gb_CppunitTest_use_sdk_api |
| 299 |
$(call gb_CppunitTest_use_api,$(1),udkapi offapi) |
| 300 |
|
| 301 |
endef |
| 302 |
|
| 303 |
define gb_CppunitTest_use_rdb |
| 304 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Rdb_get_target_for_build,$(2)) |
| 305 |
$(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES += $(call gb_Rdb_get_target_for_build,$(2)) |
| 306 |
|
| 307 |
endef |
| 308 |
|
| 309 |
define gb_CppunitTest_use_rdbs |
| 310 |
$(foreach rdb,$(2),$(call gb_CppunitTest_use_rdb,$(1),$(rdb))) |
| 311 |
|
| 312 |
endef |
| 313 |
|
| 314 |
define gb_CppunitTest_use_component |
| 315 |
$(call gb_CppunitTest_get_target,$(1)) : \ |
| 316 |
$(call gb_ComponentTarget_get_target,$(2)) |
| 317 |
$(call gb_CppunitTest_get_target,$(1)) : \ |
| 318 |
UNO_SERVICES += $(call gb_ComponentTarget_get_target,$(2)) |
| 319 |
|
| 320 |
endef |
| 321 |
|
| 322 |
define gb_CppunitTest_set_componentfile |
| 323 |
$(call gb_ComponentTarget_ComponentTarget,CppunitTest/$(2),\ |
| 324 |
$(call gb_Helper_make_url,$(gb_CppunitTest_DLLDIR))/,\ |
| 325 |
$(call gb_CppunitTest_get_filename,$(1))) |
| 326 |
$(call gb_CppunitTest_get_target,$(1)) : \ |
| 327 |
$(call gb_ComponentTarget_get_target,CppunitTest/$(2)) |
| 328 |
$(call gb_CppunitTest_get_clean_target,$(1)) : \ |
| 329 |
$(call gb_ComponentTarget_get_clean_target,CppunitTest/$(2)) |
| 330 |
$(call gb_CppunitTest_use_component,$(1),CppunitTest/$(2)) |
| 331 |
|
| 332 |
endef |
| 333 |
|
| 334 |
# Given a list of component files, filter out those corresponding |
| 335 |
# to libraries not built in this configuration. |
| 336 |
define gb_CppunitTest__filter_not_built_components |
| 337 |
$(filter-out \ |
| 338 |
$(if $(filter SCRIPTING,$(BUILD_TYPE)),, \ |
| 339 |
basic/util/sb \ |
| 340 |
sw/util/vbaswobj \ |
| 341 |
scripting/source/basprov/basprov \ |
| 342 |
scripting/util/scriptframe) \ |
| 343 |
$(if $(filter DBCONNECTIVITY,$(BUILD_TYPE)),, \ |
| 344 |
dbaccess/util/dba \ |
| 345 |
forms/util/frm),$(1)) |
| 346 |
endef |
| 347 |
|
| 348 |
define gb_CppunitTest_use_components |
| 349 |
$(foreach component,$(call gb_CppunitTest__filter_not_built_components,$(2)),$(call gb_CppunitTest_use_component,$(1),$(component))) |
| 350 |
|
| 351 |
endef |
| 352 |
|
| 353 |
define gb_CppunitTest__use_configuration |
| 354 |
$(call gb_CppunitTest_get_target,$(1)) : CONFIGURATION_LAYERS += $(2):$(call gb_Helper_make_url,$(3)) |
| 355 |
|
| 356 |
endef |
| 357 |
|
| 358 |
# Use instdir configuration |
| 359 |
define gb_CppunitTest_use_instdir_configuration |
| 360 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,postprocess_registry) |
| 361 |
$(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry) |
| 362 |
|
| 363 |
endef |
| 364 |
|
| 365 |
# Use configuration in $(WORKDIR)/unittest/registry-common. |
| 366 |
define gb_CppunitTest_use_common_configuration |
| 367 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,test_unittest) |
| 368 |
$(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(WORKDIR)/unittest/registry-common) |
| 369 |
|
| 370 |
endef |
| 371 |
|
| 372 |
# Use configuration in $(WORKDIR)/unittest/registry-user-ui |
| 373 |
define gb_CppunitTest_use_user_ui_configuration |
| 374 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Package_get_target,test_unittest) |
| 375 |
$(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(WORKDIR)/unittest/registry-user-ui) |
| 376 |
|
| 377 |
endef |
| 378 |
|
| 379 |
# Use standard configuration: instdir config + common + user-ui config (in this order!) |
| 380 |
define gb_CppunitTest_use_configuration |
| 381 |
$(call gb_CppunitTest_use_instdir_configuration,$(1)) |
| 382 |
$(call gb_CppunitTest_use_common_configuration,$(1)) |
| 383 |
$(call gb_CppunitTest_use_user_ui_configuration,$(1)) |
| 384 |
|
| 385 |
endef |
| 386 |
|
| 387 |
define gb_CppunitTest_use_executable |
| 388 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Executable_get_target,$(2)) |
| 389 |
|
| 390 |
endef |
| 391 |
|
| 392 |
# One of allow, deny, abort: |
| 393 |
define gb_CppunitTest_set_non_application_font_use |
| 394 |
$(call gb_CppunitTest_get_target,$(1)) : NON_APPLICATION_FONT_USE += $(2) |
| 395 |
|
| 396 |
endef |
| 397 |
|
| 398 |
define gb_CppunitTest_use_more_fonts |
| 399 |
ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),) |
| 400 |
$(call gb_CppunitTest_get_target,$(1)) : \ |
| 401 |
$(foreach font,$(gb_Package_MODULE_ooo_fonts),$(call gb_Package_get_target,$(font))) |
| 402 |
$(call gb_CppunitTest_set_non_application_font_use,$(1),deny) |
| 403 |
endif |
| 404 |
|
| 405 |
endef |
| 406 |
|
| 407 |
define gb_CppunitTest__use_java_ure |
| 408 |
$(call gb_CppunitTest_get_target,$(1)) : \ |
| 409 |
$(foreach jar,java_uno libreoffice unoloader,$(call gb_Jar_get_target,$(jar))) \ |
| 410 |
$(call gb_Library_get_target,affine_uno_uno) \ |
| 411 |
$(call gb_Library_get_target,java_uno) \ |
| 412 |
$(call gb_Library_get_target,jpipe) \ |
| 413 |
$(call gb_Library_get_target,juhx) \ |
| 414 |
$(call gb_Library_get_target,juhx) \ |
| 415 |
$(call gb_Library_get_target,jvmaccess) \ |
| 416 |
$(call gb_Library_get_target,jvmfwk) \ |
| 417 |
$(call gb_Package_get_target,jvmfwk_javavendors) \ |
| 418 |
$(call gb_Package_get_target,jvmfwk_jreproperties) \ |
| 419 |
$(call gb_Package_get_target,jvmfwk_jvmfwk3_ini) \ |
| 420 |
|
| 421 |
endef |
| 422 |
|
| 423 |
define gb_CppunitTest_use_jar |
| 424 |
$(call gb_CppunitTest__use_java_ure,$(1)) |
| 425 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Jar_get_target,$(2)) |
| 426 |
|
| 427 |
endef |
| 428 |
|
| 429 |
define gb_CppunitTest_use_jars |
| 430 |
$(foreach jar,$(2),$(call gb_CppunitTest_use_jar,$(1),$(jar))) |
| 431 |
|
| 432 |
endef |
| 433 |
|
| 434 |
define gb_CppunitTest_use_python_ure |
| 435 |
$(call gb_CppunitTest_get_target,$(1)) : PYTHON_URE := $(true) |
| 436 |
$(call gb_CppunitTest_get_target,$(1)) :\ |
| 437 |
$(call gb_Library_get_target,pythonloader) \ |
| 438 |
$(call gb_Library_get_target,pyuno) \ |
| 439 |
$(gb_CppunitTest_PYTHONDEPS) \ |
| 440 |
$(call gb_Package_get_target,pyuno_python_scripts) |
| 441 |
|
| 442 |
endef |
| 443 |
|
| 444 |
define gb_CppunitTest_use_uiconfig |
| 445 |
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_UIConfig_get_target,$(2)) |
| 446 |
|
| 447 |
endef |
| 448 |
|
| 449 |
define gb_CppunitTest_use_uiconfigs |
| 450 |
$(foreach uiconfig,$(2),$(call gb_CppunitTest_use_uiconfig,$(1),$(uiconfig))) |
| 451 |
|
| 452 |
endef |
| 453 |
|
| 454 |
# forward the call to the gb_LinkTarget implementation |
| 455 |
# (note: because the function name is in $(1), the other args are shifted by 1) |
| 456 |
define gb_CppunitTest__forward_to_Linktarget |
| 457 |
$(call gb_LinkTarget_$(subst gb_CppunitTest_,,$(1)),$(call gb_CppunitTest_get_linktarget,$(2)),$(3),$(4),CppunitTest_$(2)) |
| 458 |
|
| 459 |
endef |
| 460 |
|
| 461 |
# copy pasta for forwarding: this could be (and was) done more elegantly, but |
| 462 |
# these here can be found by both git grep and ctags |
| 463 |
gb_CppunitTest_add_cobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 464 |
gb_CppunitTest_add_cobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 465 |
gb_CppunitTest_add_cxxobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 466 |
gb_CppunitTest_add_cxxobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 467 |
gb_CppunitTest_add_exception_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 468 |
gb_CppunitTest_use_executable_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 469 |
gb_CppunitTest_use_library_objects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 470 |
gb_CppunitTest_use_libraries = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 471 |
gb_CppunitTest_use_static_libraries = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 472 |
gb_CppunitTest_add_objcobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 473 |
gb_CppunitTest_add_objcobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 474 |
gb_CppunitTest_add_objcxxobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 475 |
gb_CppunitTest_add_objcxxobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 476 |
gb_CppunitTest_add_cxxclrobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 477 |
gb_CppunitTest_add_cxxclrobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 478 |
gb_CppunitTest_add_asmobject = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 479 |
gb_CppunitTest_add_asmobjects = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 480 |
gb_CppunitTest_use_package = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 481 |
gb_CppunitTest_use_packages = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 482 |
gb_CppunitTest_set_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 483 |
gb_CppunitTest_reuse_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 484 |
gb_CppunitTest_use_common_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 485 |
gb_CppunitTest_add_sdi_headers = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 486 |
gb_CppunitTest_add_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 487 |
gb_CppunitTest_set_cflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 488 |
gb_CppunitTest_add_cxxflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 489 |
gb_CppunitTest_set_yaccflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 490 |
gb_CppunitTest_add_objcflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 491 |
gb_CppunitTest_add_objcxxflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 492 |
gb_CppunitTest_add_cxxclrflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 493 |
gb_CppunitTest_add_defs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 494 |
gb_CppunitTest_set_include = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 495 |
gb_CppunitTest_add_ldflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 496 |
gb_CppunitTest_set_ldflags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 497 |
gb_CppunitTest_add_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 498 |
gb_CppunitTest_disable_standard_system_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 499 |
gb_CppunitTest_use_system_darwin_frameworks = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 500 |
gb_CppunitTest_use_system_win32_libs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 501 |
gb_CppunitTest_use_internal_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 502 |
gb_CppunitTest_use_internal_bootstrap_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 503 |
gb_CppunitTest_use_internal_comprehensive_api = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 504 |
gb_CppunitTest_set_library_path_flags = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 505 |
gb_CppunitTest_use_external = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 506 |
gb_CppunitTest_use_externals = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 507 |
gb_CppunitTest_use_custom_headers = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 508 |
gb_CppunitTest_set_visibility_default = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 509 |
gb_CppunitTest_set_warnings_not_errors = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 510 |
gb_CppunitTest_set_warnings_disabled = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 511 |
gb_CppunitTest_set_external_code = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 512 |
gb_CppunitTest_set_generated_cxx_suffix = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 513 |
gb_CppunitTest_use_clang = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 514 |
gb_CppunitTest_set_clang_precompiled_header = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 515 |
gb_CppunitTest_use_vclmain = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 516 |
gb_CppunitTest_add_prejs = $(call gb_CppunitTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |
| 517 |
|
| 518 |
# vim: set noet sw=4: |