From 3ead72d365c722f2234ace08fdb3d313f709ace5 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 9 May 2016 10:05:14 +0200 Subject: uitest: build system part for new uitests We now can call the uitests with make uitest.uickeck Change-Id: I20c73efd93c7987f3b841cd0e3e7842ee7a5dab9 --- Makefile.in | 3 +- RepositoryModule_host.mk | 3 +- solenv/gbuild/Module.mk | 40 ++++++++- solenv/gbuild/Postprocess.mk | 1 + solenv/gbuild/TargetLocations.mk | 3 + solenv/gbuild/UITest.mk | 114 ++++++++++++++++++++++++ solenv/gbuild/extensions/post_SpeedUpTargets.mk | 14 +-- solenv/gbuild/gbuild.mk | 1 + uitest/Makefile | 14 +++ uitest/Module_uitest.mk | 15 ++++ uitest/UITest_calc_demo.mk | 15 ++++ uitest/calc_tests/calc_demo.txt | 1 + 12 files changed, 214 insertions(+), 10 deletions(-) create mode 100644 solenv/gbuild/UITest.mk create mode 100644 uitest/Makefile create mode 100644 uitest/Module_uitest.mk create mode 100644 uitest/UITest_calc_demo.mk create mode 100644 uitest/calc_tests/calc_demo.txt diff --git a/Makefile.in b/Makefile.in index 5e8b9de57910..23ccc953b8cc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck +gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck uicheck .PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch findunusedcode get-submodules id install install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS) @@ -144,6 +144,7 @@ gbuild_TARGETS := AllLangHelp \ Rdb \ StaticLibrary \ UIConfig \ + UITest \ UnoApi \ UnpackedTarball \ WinResTarget \ diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index d2f1d849b7fa..5954a509f71d 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ ucb \ ucbhelper \ udkapi \ + $(call gb_Helper_optional,PYUNO,uitest) \ UnoControls \ unodevtools \ unoil \ @@ -181,7 +182,7 @@ endef # otherwise cyclic dependencies ruin everything. # do not serialize on a partial build as that may fail due to missing deps. # the default goal is all (see Module.mk) -ifeq (,$(filter-out all build check unitcheck slowcheck subsequentcheck,$(MAKECMDGOALS))) +ifeq (,$(filter-out all build check unitcheck slowcheck subsequentcheck uicheck,$(MAKECMDGOALS))) $(eval $(call repositorymodule_serialize,\ scfilt \ $(call gb_Helper_optional,SCRIPTING,vbaobj) \ diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk index 468b80b4940a..d4217ea75b41 100644 --- a/solenv/gbuild/Module.mk +++ b/solenv/gbuild/Module.mk @@ -27,12 +27,14 @@ # recursive Module/checks # Module/slowcheck run all slow unit tests # Module/subsequentcheck run system tests all system tests +# Module/uicheck run uitests all uitests # recursive Module/subsequentchecks # build (global) build the product top-level Module # unitcheck (global) run unit tests top-level Module/unitcheck # slowcheck (global) run slow unit tests top-level Module/slowcheck # subsequentcheck (global) run system tests top-level Module/subsequentcheck # perfcheck (global) run performance unit tests top-level Module/perfcheck +# uicheck (global) run the uitests run all uitests # all (global) default goal build unitcheck @@ -47,6 +49,7 @@ gb_Module_SLOWCHECKTARGETSTACK := gb_Module_SUBSEQUENTCHECKTARGETSTACK := gb_Module_STAGINGCHECKTARGETSTACK := gb_Module_PERFCHECKTARGETSTACK := +gb_Module_UICHECKTARGETSTACK := gb_Module_CLEANTARGETSTACK := # The currently read gbuild makefile. @@ -68,7 +71,7 @@ $(call gb_Module_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),MOD,5) $(call gb_Output_announce_title,module $* cleared.) -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_Module_get_target,$*) $(call gb_Module_get_nonl10n_target,$*) $(call gb_Module_get_l10n_target,$*) $(call gb_Module_get_check_target,$*) $(call gb_Module_get_slowcheck_target,$*) $(call gb_Module_get_subsequentcheck_target,$*) $(call gb_Module_get_perfcheck_target,$*)) + rm -f $(call gb_Module_get_target,$*) $(call gb_Module_get_nonl10n_target,$*) $(call gb_Module_get_l10n_target,$*) $(call gb_Module_get_check_target,$*) $(call gb_Module_get_slowcheck_target,$*) $(call gb_Module_get_subsequentcheck_target,$*) $(call gb_Module_get_perfcheck_target,$*) $(call gb_Module_get_uicheck,$*)) $(call gb_Module_get_l10n_target,%) : $(call gb_Output_announce,$*,$(true),LOC,5) @@ -112,6 +115,13 @@ $(call gb_Module_get_perfcheck_target,%) : mkdir -p $(dir $@) && \ touch $@) +$(call gb_Module_get_uicheck_target,%) : + $(call gb_Output_announce,$*,$(true),UIT,5) + $(call gb_Output_announce_title,module $* uicheck done.) + -$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $@) && \ + touch $@) + $(call gb_Module_get_target,%) : $(call gb_Output_announce,$*,$(true),MOD,5) $(call gb_Output_announce_title,module $* done.) @@ -119,7 +129,7 @@ $(call gb_Module_get_target,%) : mkdir -p $(dir $@) && \ touch $@) -.PHONY : all build build-l10n-only build-non-l10n-only unitcheck slowcheck subsequentcheck stagingcheck perfcheck clean check debugrun help showmodules translations +.PHONY : all build build-l10n-only build-non-l10n-only unitcheck slowcheck subsequentcheck stagingcheck perfcheck uicheck clean check debugrun help showmodules translations .DEFAULT_GOAL := all all : build $(if $(CROSS_COMPILING),,unitcheck $(if $(gb_PARTIAL_BUILD),,slowcheck)) @@ -174,6 +184,11 @@ perfcheck : $(call gb_Output_announce_title,all perftests checked.) $(call gb_Output_announce_bell) +uicheck : build + $(if $(gb_VERBOSE),$(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),UIT,6)) + $(call gb_Output_announce_title,all uicheck checked.) + $(call gb_Output_announce_bell) + clean : $(if $(gb_VERBOSE),$(call gb_Output_announce,top level modules: $(foreach module,$^,$(notdir $(module))),$(false),ALL,6)) $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(false),ALL,6) @@ -217,6 +232,7 @@ gb_Module_TARGETSTACK := $(call gb_Module_get_target,$(1)) $(gb_Module_TARGETSTA gb_Module_L10NTARGETSTACK := $(call gb_Module_get_l10n_target,$(1)) $(gb_Module_L10NTARGETSTACK) gb_Module_CHECKTARGETSTACK := $(call gb_Module_get_check_target,$(1)) $(gb_Module_CHECKTARGETSTACK) gb_Module_SLOWCHECKTARGETSTACK := $(call gb_Module_get_slowcheck_target,$(1)) $(gb_Module_SLOWCHECKTARGETSTACK) +gb_Module_UICHECKTARGETSTACK := $(call gb_Module_get_uicheck_target,$(1)) $(gb_Module_UICHECKTARGETSTACK) gb_Module_SUBSEQUENTCHECKTARGETSTACK := $(call gb_Module_get_subsequentcheck_target,$(1)) $(gb_Module_SUBSEQUENTCHECKTARGETSTACK) gb_Module_STAGINGCHECKTARGETSTACK := $(call gb_Module_get_stagingcheck_target,$(1)) $(gb_Module_STAGINGCHECKTARGETSTACK) gb_Module_PERFCHECKTARGETSTACK := $(call gb_Module_get_perfcheck_target,$(1)) $(gb_Module_PERFCHECKTARGETSTACK) @@ -229,6 +245,7 @@ $(if $(filter-out libreoffice instsetoo_native android ios,$(1)),\ $(call gb_Postprocess_get_target,AllModuleTests) : $(call gb_Module_get_check_target,$(1)) $(call gb_Postprocess_get_target,AllModuleSlowtests) : $(call gb_Module_get_slowcheck_target,$(1)) +$(call gb_Postprocess_get_target,AllModuleUITest) : $(call gb_Module_get_uicheck_target,$(1)) endef @@ -324,6 +341,14 @@ $(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET) endef +define gb_Module_add_uicheck_target +$(call gb_Module__read_targetfile,$(1),$(2),uicheck target) + +$(call gb_Module_get_uicheck_target,$(1)) : $$(gb_Module_CURRENTTARGET) +$(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET) + +endef + define gb_Module_add_moduledir include $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Module_MODULELOCATIONS)))/$(2)/Module_$(2).mk $(call gb_Module_get_target,$(1)) : $$(firstword $$(gb_Module_TARGETSTACK)) @@ -333,6 +358,7 @@ $(call gb_Module_get_slowcheck_target,$(1)) : $$(firstword $$(gb_Module_SLOWCHEC $(call gb_Module_get_subsequentcheck_target,$(1)) : $$(firstword $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) $(call gb_Module_get_stagingcheck_target,$(1)) : $$(firstword $$(gb_Module_STAGINGCHECKTARGETSTACK)) $(call gb_Module_get_perfcheck_target,$(1)) : $$(firstword $$(gb_Module_PERFCHECKTARGETSTACK)) +$(call gb_Module_get_uicheck_target,$(1)) : $$(firstword $$(gb_Module_UICHECKTARGETSTACK)) $(call gb_Module_get_clean_target,$(1)) : $$(firstword $$(gb_Module_CLEANTARGETSTACK)) gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK)) gb_Module_L10NTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_L10NTARGETSTACK)),$$(gb_Module_L10NTARGETSTACK)) @@ -341,6 +367,7 @@ gb_Module_SLOWCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SLOWCHECKT gb_Module_SUBSEQUENTCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) gb_Module_STAGINGCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_STAGINGCHECKTARGETSTACK)),$$(gb_Module_STAGINGCHECKTARGETSTACK)) gb_Module_PERFCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_PERFCHECKTARGETSTACK)),$$(gb_Module_PERFCHECKTARGETSTACK)) +gb_Module_UICHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_UICHECKTARGETSTACK)),$$(gb_Module_UICHECKTARGETSTACK)) gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK)) endef @@ -389,6 +416,11 @@ $(foreach target,$(sort $(2)),$(call gb_Module_add_moduledir,$(1),$(target))) endef +define gb_Module_add_uicheck_targets +$(foreach target,$(2),$(call gb_Module_add_uicheck_target,$(1),$(target))) + +endef + define gb_Module_make_global_targets ifneq ($$(gb_Module_TARGETSTACK),) $$(eval $$(call gb_Output_error,Corrupted module target stack!1)) @@ -404,6 +436,7 @@ slowcheck : $$(firstword $$(gb_Module_SLOWCHECKTARGETSTACK)) subsequentcheck : $$(firstword $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) stagingcheck : $$(firstword $$(gb_Module_STAGINGCHECKTARGETSTACK)) perfcheck : $$(firstword $$(gb_Module_PERFCHECKTARGETSTACK)) +uicheck : $$(firstword $$(gb_Module_UICHECKTARGETSTACK)) clean : $$(firstword $$(gb_Module_CLEANTARGETSTACK)) ifneq ($$(words $$(gb_Module_TARGETSTACK)),1) @@ -415,11 +448,12 @@ gb_Module_L10NTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_L10NTARGETSTACK gb_Module_CHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CHECKTARGETSTACK)),$$(gb_Module_CHECKTARGETSTACK)) gb_Module_SLOWCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SLOWCHECKTARGETSTACK)),$$(gb_Module_SLOWCHECKTARGETSTACK)) gb_Module_SUBSEQUENTCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) +gb_Module_UICHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_UICHECKTARGETSTACK)),$$(gb_Module_UICHECKTARGETSTACK)) gb_Module_STAGINGCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_STAGINGCHECKTARGETSTACK)),$$(gb_Module_STAGINGCHECKTARGETSTACK)) gb_Module_PERFCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_PERFCHECKTARGETSTACK)),$$(gb_Module_PERFCHECKTARGETSTACK)) gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK)) -ifneq ($$(and $$(gb_Module_TARGETSTACK),$$(gb_Module_CHECKTARGETSTACK),$$(gb_Module_SLOWCHECKTARGETSTACK),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK),$$(gb_Module_STAGINGCHECKTARGETSTACK),$$(gb_Module_PERFCHECKTARGETSTACK),$$(gb_Module_L10NTARGETSTACK)),) +ifneq ($$(and $$(gb_Module_TARGETSTACK),$$(gb_Module_CHECKTARGETSTACK),$$(gb_Module_SLOWCHECKTARGETSTACK),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK),$$(gb_Module_UICHECKTARGETSTACK),$$(gb_Module_STAGINGCHECKTARGETSTACK),$$(gb_Module_PERFCHECKTARGETSTACK),$$(gb_Module_L10NTARGETSTACK)),) $$(eval $$(call gb_Output_error,Corrupted module target stack!3)) endif diff --git a/solenv/gbuild/Postprocess.mk b/solenv/gbuild/Postprocess.mk index 06766465ccf3..a256a210552c 100644 --- a/solenv/gbuild/Postprocess.mk +++ b/solenv/gbuild/Postprocess.mk @@ -47,6 +47,7 @@ $(call gb_Postprocess_Postprocess,AllResources,All resources,$(WORKDIR)/AllLangR $(call gb_Postprocess_Postprocess,AllUIConfigs,All UI configuration files,$(WORKDIR)/UIConfig/) $(call gb_Postprocess_Postprocess,AllModuleTests,All modules' tests,$(WORKDIR)/Module/check/) $(call gb_Postprocess_Postprocess,AllModuleSlowtests,All modules' slowtests,$(WORKDIR)/Module/slowcheck/) +$(call gb_Postprocess_Postprocess,AllModuleUITests,All modules' uitests,$(WORKDIR)/Module/uicheck/) endef diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 9c15d8e92e8d..34577cadca03 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -121,6 +121,7 @@ gb_Module_get_slowcheck_target = $(WORKDIR)/Module/slowcheck/$(1) gb_Module_get_subsequentcheck_target = $(WORKDIR)/Module/subsequentcheck/$(1) gb_Module_get_stagingcheck_target = $(WORKDIR)/Module/stagingcheck/$(1) gb_Module_get_perfcheck_target = $(WORKDIR)/Module/perfcheck/$(1) +gb_Module_get_uicheck_target = $(WORKDIR)/Module/uicheck/$(1) gb_Module_get_target = $(WORKDIR)/Module/$(1) gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o gb_ObjCObject_get_target = $(WORKDIR)/ObjCObject/$(1).o @@ -160,6 +161,7 @@ gb_UIImageListTarget_get_target = $(WORKDIR)/UIImageListTarget/$(1).ilst gb_UILocalizeTarget_get_target = $(WORKDIR)/UILocalizeTarget/$(1).done gb_UILocalizeTarget_get_workdir = $(WORKDIR)/UILocalizeTarget/$(1) gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml +gb_UITest_get_target = $(WORKDIR)/UITest/$(1)/done gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb gb_UnoApiHeadersTarget_get_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),bootstrap) gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/$(call gb_UnoApiHeadersTarget_select_variant,$(1),comprehensive) @@ -284,6 +286,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ UIImageListTarget \ UILocalizeTarget \ UIMenubarTarget \ + UITest \ UnoApi \ UnoApiHeadersTarget \ UnoApiTarget \ diff --git a/solenv/gbuild/UITest.mk b/solenv/gbuild/UITest.mk new file mode 100644 index 000000000000..bbe76f6bebff --- /dev/null +++ b/solenv/gbuild/UITest.mk @@ -0,0 +1,114 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# UITest class + +gb_UITest_UNITTESTFAILED ?= $(GBUILDDIR)/platform/unittest-failed-default.sh + +ifeq ($(SYSTEM_PYTHON),) +gb_UITest_EXECUTABLE := $(gb_Python_INSTALLED_EXECUTABLE) +gb_UITest_EXECUTABLE_GDB := $(gb_Python_INSTALLED_EXECUTABLE_GDB) +gb_UITest_DEPS ?= $(call gb_Package_get_target,python3) $(call gb_Package_get_target,python_shell) +else +gb_UITest_EXECUTABLE := $(PYTHON_FOR_BUILD) +gb_UITest_EXECUTABLE_GDB := $(PYTHON_FOR_BUILD) +gb_UITest_DEPS := +endif + +gb_UITest_COMMAND := $(gb_UITest_EXECUTABLE) $(SRCDIR)/uitest/main.py + +.PHONY : $(call gb_UITest_get_clean_target,%) +$(call gb_UITest_get_clean_target,%) : + $(call gb_Helper_abbreviate_dirs,\ + rm -f $@ $@.log) + +ifneq ($(DISABLE_PYTHON),TRUE) + +.PHONY : $(call gb_UITest_get_target,%) +$(call gb_UITest_get_target,%) :| $(gb_UITest_DEPS) + $(call gb_Output_announce,$*,$(true),UIT,2) + $(call gb_Helper_abbreviate_dirs,\ + rm -rf $(dir $(call gb_UITest_get_target,$*)) && \ + mkdir -p $(dir $(call gb_UITest_get_target,$*)) && \ + rm -fr $@.core && mkdir $@.core && cd $@.core && \ + ($(gb_UITest_PRECOMMAND) \ + $(if $(G_SLICE),G_SLICE=$(G_SLICE)) \ + $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ + $(DEFS) \ + TEST_LIB=$(call gb_Library_get_target,test) \ + URE_BOOTSTRAP=vnd.sun.star.pathname:$(call gb_Helper_get_rcfile,$(INSTROOT)/$(LIBO_ETC_FOLDER)/fundamental) \ + PYTHONPATH="$(PYPATH)" \ + TestUserDir="$(call gb_Helper_make_url,$(dir $(call gb_UITest_get_target,$*)))" \ + PYTHONDONTWRITEBYTECODE=1 \ + $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(ENABLE_HEADLESS),, \ + SAL_USE_VCLPLUGIN=svp \ + )) \ + $(gb_UITest_COMMAND) \ + --soffice=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice \ + --userdir=$(call gb_Helper_make_url,$(dir $(call gb_UITest_get_target,$*))user) \ + --file=$(SRCDIR)/uitest/$(strip $(MODULES)) \ + $(if $(gb_CppunitTest__interactive),, \ + > $@.log 2>&1 \ + || ($(if $(value gb_CppunitTest_postprocess), \ + RET=$$?; \ + $(call gb_CppunitTest_postprocess,$(gb_UITest_EXECUTABLE_GDB),$@.core,$$RET) >> $@.log 2>&1;) \ + cat $@.log; $(gb_UITest_UNITTESTFAILED) Python $*)))) + +# always use udkapi and URE services +define gb_UITest_UITest +$(call gb_UITest_get_target,$(1)) : PYPATH := $(SRCDIR)/unotest/source/python$$(gb_CLASSPATHSEP)$(INSTROOT)/$(LIBO_LIB_PYUNO_FOLDER)$(if $(filter-out $(LIBO_LIB_PYUNO_FOLDER),$(LIBO_LIB_FOLDER)),$(gb_CLASSPATHSEP)$(INSTROOT)/$(LIBO_LIB_FOLDER)) +$(call gb_UITest_get_target,$(1)) : MODULES := + +$(eval $(call gb_Module_register_target,$(call gb_UITest_get_target,$(1)),$(call gb_UITest_get_clean_target,$(1)))) +$(call gb_Helper_make_userfriendly_targets,$(1),UITest) + +endef + +define gb_UITest_set_defs +$(call gb_UITest_get_target,$(1)) : DEFS := $(2) + +endef + +# put the directory on the PYTHONPATH because the "unittest" loader +# mysteriously fails to load modules given as absolute path unless the $PWD is +# a prefix of the absolute path, which it is not when we go into a certain +# dir to get a core dump there +# +# gb_UITest_add_modules directory module(s) +define gb_UITest_add_modules +$(call gb_UITest_get_target,$(1)) : PYPATH := $$(PYPATH)$$(gb_CLASSPATHSEP)$(2) +$(call gb_UITest_get_target,$(1)) : MODULES += $(3) + +endef + +define gb_UITest_use_customtarget +$(call gb_UITest_get_target,$(1)) : $(call gb_CustomTarget_get_workdir,$(2)) + +endef + + +else # DISABLE_PYTHON + +.PHONY : $(call gb_UITest_get_target,$(1)) +$(call gb_UITest_get_target,%) : + $(call gb_Output_announce,$* (skipped - no UITest),$(true),PYT,2) + @true + +define gb_UITest_UITest +$(eval $(call gb_Module_register_target,$(call gb_UITest_get_target,$(1)),$(call gb_UITest_get_clean_target,$(1)))) +$(call gb_Helper_make_userfriendly_targets,$(1),UITest) + +endef + +gb_UITest_set_defs := +gb_UITest_add_modules := +gb_UITest_use_customtarget := + +endif # DISABLE_PYTHON +# vim: set noet sw=4: diff --git a/solenv/gbuild/extensions/post_SpeedUpTargets.mk b/solenv/gbuild/extensions/post_SpeedUpTargets.mk index a13392a29cf7..921038e4821f 100644 --- a/solenv/gbuild/extensions/post_SpeedUpTargets.mk +++ b/solenv/gbuild/extensions/post_SpeedUpTargets.mk @@ -9,21 +9,21 @@ ifneq ($(CROSS_COMPILING),) gb_Module_add_targets_for_build := -gb_Module_SKIPTARGETS := check slowcheck subsequentcheck +gb_Module_SKIPTARGETS := check slowcheck subsequentcheck uicheck endif ifeq ($(gb_Side),build) -gb_Module_SKIPTARGETS := check slowcheck subsequentcheck +gb_Module_SKIPTARGETS := check slowcheck subsequentcheck uicheck endif ifeq ($(MAKECMDGOALS),build) -gb_Module_SKIPTARGETS := check slowcheck subsequentcheck +gb_Module_SKIPTARGETS := check slowcheck subsequentcheck uicheck endif ifeq (,$(filter perfcheck,$(MAKECMDGOALS))) gb_Module_SKIPTARGETS += perfcheck else -gb_Module_SKIPTARGETS += check slowcheck subsequentcheck +gb_Module_SKIPTARGETS += check slowcheck subsequentcheck uicheck endif ifneq ($(strip $(MAKECMDGOALS)),) @@ -37,7 +37,7 @@ ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_1),$(MAKECMDGOALS)),,T)) gb_FULLDEPS := ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_2),$(MAKECMDGOALS)),,T)) -gb_Module_SKIPTARGETS += check slowcheck subsequentcheck +gb_Module_SKIPTARGETS += check slowcheck subsequentcheck uicheck ifeq (T,$(if $(filter-out $(gb_SpeedUpTargets_LEVEL_3),$(MAKECMDGOALS)),,T)) gb_Module_SKIPTARGETS += build @@ -73,6 +73,10 @@ ifneq (,$(filter perfcheck,$(gb_Module_SKIPTARGETS))) gb_Module_add_perfcheck_target = endif +ifneq (,$(filter uicheck,$(gb_Module_SKIPTARGETS))) +gb_Module_add_uicheck_target = +endif + ifneq (,$(filter module,$(gb_Module_SKIPTARGETS))) gb_Module_add_moduledir = endif diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 04056cd136c8..69e370761884 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -287,6 +287,7 @@ include $(foreach class, \ PrecompiledHeaders \ Pyuno \ PythonTest \ + UITest \ Rdb \ CppunitTest \ Jar \ diff --git a/uitest/Makefile b/uitest/Makefile new file mode 100644 index 000000000000..0997e628485b --- /dev/null +++ b/uitest/Makefile @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/uitest/Module_uitest.mk b/uitest/Module_uitest.mk new file mode 100644 index 000000000000..4dbf02041fde --- /dev/null +++ b/uitest/Module_uitest.mk @@ -0,0 +1,15 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,uitest)) + +$(eval $(call gb_Module_add_uicheck_targets,uitest,\ + UITest_calc_demo \ +)) diff --git a/uitest/UITest_calc_demo.mk b/uitest/UITest_calc_demo.mk new file mode 100644 index 000000000000..96acb49f296c --- /dev/null +++ b/uitest/UITest_calc_demo.mk @@ -0,0 +1,15 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UITest_UITest,calc_demo)) + +$(eval $(call gb_UITest_add_modules,calc_demo,$(SRCDIR)/uitest,\ + calc_tests/calc_demo.txt \ +)) +# vim: set noet sw=4 ts=4: diff --git a/uitest/calc_tests/calc_demo.txt b/uitest/calc_tests/calc_demo.txt new file mode 100644 index 000000000000..fd921da5a503 --- /dev/null +++ b/uitest/calc_tests/calc_demo.txt @@ -0,0 +1 @@ +calc_tests.create_range_name.create_range_name -- cgit v1.2.3