summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-11-08 00:48:14 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2018-11-09 07:37:00 +0100
commit84286ac443ea8978743d281efeaa7ddb46199558 (patch)
tree916a3175c92da40e4ac521586f74b01dcb71e07f /solenv/gbuild
parent5063e7fc09b38b77a3ff4c200b68cf2c8947462d (diff)
Simplify and fix Java UNO API test makefiles
Originally I just wanted to add the juh.jar to the list of jars of the UNO API tests, but this became tedious work, so after the first few files I decided to replace the similiar makefiles with a common define for the *_unoapi* tests. This patch adds two new make defines to be used used by Java UNO and UNO API tests: - gb_JunitTest_set_unoapi_test_defaults - gb_JunitTest_set_unoapi_test_class_and_jars The first one will deduce most defaults from the test name, but still allows to optionally override most settings. If a test doesn't match the default at all, the 2nd define still shares the common jar files and the main Java UNO class, so the second define adds these to your makefile. The real fix is to add juh.jar to gb_JunitTest_use_jars. Change-Id: I4342fdac5e31f85ea18fb4268e13c287a7adc2b7 Reviewed-on: https://gerrit.libreoffice.org/63118 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/JunitTest.mk39
1 files changed, 39 insertions, 0 deletions
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 36f29b50ef28..1b06a1c5f78d 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -152,6 +152,45 @@ $(foreach dependency,$(2),$(call gb_JunitTest_use_customtarget,$(1),$(dependency
endef
+define gb_JunitTest_set_unoapi_test_class_and_jars
+$(eval $(call gb_JunitTest_use_jars,$(1),\
+ OOoRunner \
+ juh \
+ jurt \
+ ridl \
+ test \
+ unoil \
+))
+
+$(eval $(call gb_JunitTest_add_classes,$(1),\
+ org.openoffice.test.UnoApiTest \
+))
+
+endef
+
+# To be used by gb_JunitTest_set_unoapi_test_defaults
+# <module>_unoapi_1 => <module>_1 => <module> => <module>/qa/unoapi
+gb_JunitTest__unoapi_iter = $(subst _unoapi,,$(1))
+gb_JunitTest__unoapi_module = $(firstword $(subst _, ,$(gb_JunitTest__unoapi_iter)))
+gb_JunitTest__unoapi_dir = $(if $(2),$(2),$(gb_JunitTest__unoapi_module)/qa/unoapi)
+
+# $(1) = test name (prefer <module>_unoapi for defaults, example <module>_unoapi_1)
+# $(2) = test directory base (def: <module>_unoapi_1 => <module>_1/qa/unoapi)
+# $(3) = SCE file (def: <module>_1.sce)
+# $(4) = XCL file (def: knownissues.xcl)
+# $(5) = test document directory (def: testdocuments; use . for base)
+define gb_JunitTest_set_unoapi_test_defaults
+$(eval $(call gb_JunitTest_set_defs,$(1),\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.sce=$(SRCDIR)/$(gb_JunitTest__unoapi_dir)/$(if $(3),$(3),$(gb_JunitTest__unoapi_iter).sce) \
+ -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/$(gb_JunitTest__unoapi_dir)/$(if $(4),$(4),knownissues.xcl) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/$(gb_JunitTest__unoapi_dir)/$(if $(5),$(5),testdocuments) \
+))
+
+$(eval $(call gb_JunitTest_set_unoapi_test_class_and_jars,$(1)))
+
+endef
+
else # OOO_JUNIT_JAR
.PHONY : $(call gb_JunitTest_get_target,$(1))