diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-04-26 13:32:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-04-26 13:40:11 +0200 |
commit | 9b30c3e98ebb2f1c74609d93be735daf3b0bf03c (patch) | |
tree | 340326f4c19d39546e213d6496776db248177487 | |
parent | d56ba7ee6f385866d82142aab568a159009ae69e (diff) |
Towards a Mac OS X PythonTest
Use URE_BOOTSTRAP instead of listing ~its content individually.
[DY]LD_LIBRARY_PATH needs to be set to all of installdir's ure and program as
well as OUTDIR, as initPoniesMode (pyuno/source/module/pyuno_module.cxx) tries
to load the OUTDIR test library. Abstracted as gb_PythonTest_PRECOMMAND.
Abstracted Mac's special LibreOffice.app/Content path as gb_DEVINSTALLROOT,
adapted a number of places accordingly.
Change-Id: I1646615c77dfab342675f84dbb83c579bf16058d
-rw-r--r-- | smoketest/CppunitTest_smoketest.mk | 4 | ||||
-rw-r--r-- | smoketest/Executable_libtest.mk | 9 | ||||
-rw-r--r-- | solenv/gbuild/PythonTest.mk | 10 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 13 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 17 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 16 |
7 files changed, 48 insertions, 32 deletions
diff --git a/smoketest/CppunitTest_smoketest.mk b/smoketest/CppunitTest_smoketest.mk index ee0d8156c791..f607c069c4c9 100644 --- a/smoketest/CppunitTest_smoketest.mk +++ b/smoketest/CppunitTest_smoketest.mk @@ -48,9 +48,9 @@ $(eval $(call gb_CppunitTest_use_libraries,smoketest,\ )) ifeq ($(OS),MACOSX) -smoketest_SOFFICE := path:$(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/soffice +smoketest_SOFFICE := path:$(gb_DEVINSTALLROOT)/MacOS/soffice else -smoketest_SOFFICE := path:$(DEVINSTALLDIR)/opt/program/soffice +smoketest_SOFFICE := path:$(gb_DEVINSTALLROOT)/program/soffice endif $(eval $(call gb_CppunitTest_use_ure,smoketest)) diff --git a/smoketest/Executable_libtest.mk b/smoketest/Executable_libtest.mk index 59ba80be4910..1b0a16a65f2a 100644 --- a/smoketest/Executable_libtest.mk +++ b/smoketest/Executable_libtest.mk @@ -27,12 +27,7 @@ $(eval $(call gb_Executable_add_exception_objects,libtest,\ smoketest/libtest \ )) -ifeq ($(OS),MACOSX) -liblibreoffice_SOFFICE_INST := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS -else -liblibreoffice_SOFFICE_INST := $(DEVINSTALLDIR)/opt/program -endif -liblibreoffice_OWN_LD_PATH_DIR := $(liblibreoffice_SOFFICE_INST)/libolib +liblibreoffice_OWN_LD_PATH_DIR := $(gb_DEVINSTALLROOT)/program/libolib liblibreoffice_OWN_LD_SO := $(liblibreoffice_OWN_LD_PATH_DIR)/$(call gb_Library_get_linktargetname,libreoffice) $(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice) @@ -42,6 +37,6 @@ $(liblibreoffice_OWN_LD_SO) : $(call gb_Library_get_target,libreoffice) run_libtest: $(liblibreoffice_OWN_LD_SO) $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}":$(liblibreoffice_OWN_LD_PATH_DIR)/Library" \ $(call gb_LinkTarget_get_target,Executable/libtest) \ - $(liblibreoffice_SOFFICE_INST) $(OUTDIR)/bin/smoketestdoc.sxw \ + $(gb_DEVINSTALLROOT)/program $(OUTDIR)/bin/smoketestdoc.sxw \ # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk index d6570f353528..63665582f28f 100644 --- a/solenv/gbuild/PythonTest.mk +++ b/solenv/gbuild/PythonTest.mk @@ -36,14 +36,10 @@ $(call gb_PythonTest_get_target,%) : $(if $(gb_CppunitTest__interactive),, \ $(if $(value gb_CppunitTest_postprocess), \ rm -fr $@.core && mkdir $@.core && cd $@.core &&)) \ - (PYTHONPATH=$(PYPATH):$(DEVINSTALLDIR)/opt/program \ + ($(gb_PythonTest_PRECOMMAND) \ + URE_BOOTSTRAP=vnd.sun.star.pathname:$(gb_DEVINSTALLROOT)/program/fundamentalrc \ + PYTHONPATH=$(PYPATH) \ UserInstallation="$(call gb_Helper_make_url,$(OUTDIR)/unittest)" \ - BRAND_BASE_DIR="$(call gb_Helper_make_url,$(OUTDIR)/unittest/install)" \ - CONFIGURATION_LAYERS="$(strip $(CONFIGURATION_LAYERS))" \ - UNO_TYPES="$(foreach item,$(UNO_TYPES),$(call gb_Helper_make_url,$(item)))" \ - UNO_SERVICES="$(foreach item,$(UNO_SERVICES),$(call gb_Helper_make_url,$(item)))" \ - $(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\ - $(dir)="$(call gb_Helper_make_url,$(gb_CppunitTest_LIBDIR))") \ $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_PythonTest_COMMAND) \ $(MODULES) \ $(if $(gb_CppunitTest__interactive),, \ diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 536a44f24144..49b9bbfdc8b6 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -26,6 +26,8 @@ # #************************************************************************* +gb_DEVINSTALLROOT := $(DEVINSTALLDIR)/opt + # Convert path to file URL. define gb_Helper_make_url file:///$(strip $(1)) @@ -476,12 +478,17 @@ endif # OOO_TEST_SOFFICE define gb_JunitTest_JunitTest_platform $(call gb_JunitTest_get_target,$(1)) : DEFS := \ - -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/program/soffice.exe}" \ + -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(gb_DEVINSTALLROOT)/program/soffice.exe}" \ -Dorg.openoffice.test.arg.env=PATH="$$$$PATH" \ -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) endef +# PythonTest class + +#TODO: +gb_PythonTest_PRECOMMAND := + # SrsPartTarget class ifeq ($(gb_FULLDEPS),$(true)) @@ -622,6 +629,6 @@ gb_Pyuno_PROGRAMDIRNAME := program # Python gb_Python_PRECOMMAND := PATH="$(shell cygpath -w $(INSTDIR)/program);$(shell cygpath -w $(OUTDIR)/bin)" PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib;$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program" -gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/program/python.exe +gb_Python_INSTALLED_EXECUTABLE := $(gb_DEVINSTALLROOT)/program/python.exe # vim: set noet sw=4: diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index b1559011085a..b3cb175dc9d1 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -26,6 +26,8 @@ # #************************************************************************* +gb_DEVINSTALLROOT := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents + gb_SDKDIR := $(MACOSX_SDK_PATH) include $(GBUILDDIR)/platform/com_GCC_defs.mk @@ -33,7 +35,6 @@ include $(GBUILDDIR)/platform/com_GCC_defs.mk # Darwin mktemp -t expects a prefix, not a pattern gb_MKTEMP ?= /usr/bin/mktemp -t gbuild. - gb_OSDEFS := \ -D$(OS) \ -D_PTHREADS \ @@ -317,7 +318,7 @@ else ifneq ($(gb_JunitTest_DEBUGRUN),) gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) else -gb_JunitTest_SOFFICEARG:=path:$(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/soffice +gb_JunitTest_SOFFICEARG:=path:$(gb_DEVINSTALLROOT)/MacOS/soffice endif endif @@ -330,12 +331,16 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \ endef +# PythonTest class + +gb_PythonTest_PRECOMMAND := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}$(gb_DEVINSTALLROOT)/ure-link/lib:$(gb_DEVINSTALLROOT)/program:$(OUTDIR)/lib + # Module class define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=$$($(gb_MKTEMP)) && \ printf '%s\n' "set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(call gb_Helper_make_url,$(DEVINSTALLDIR)/)" > $${OFFICESCRIPT} && \ -gdb -x $${OFFICESCRIPT} $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/soffice && \ +gdb -x $${OFFICESCRIPT} $(gb_DEVINSTALLROOT)/MacOS/soffice && \ rm $${OFFICESCRIPT} endef @@ -401,7 +406,7 @@ endef # Python gb_Python_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib -gb_Python_INSTALLED_EXECUTABLE := $(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython +gb_Python_INSTALLED_EXECUTABLE := $(gb_DEVINSTALLROOT)/program/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython # this is passed to gdb as executable when running tests gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_Python_INSTALLED_EXECUTABLE) diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index cfbdef2ed75d..cddb8705bece 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -26,6 +26,8 @@ # #************************************************************************* +gb_DEVINSTALLROOT := $(DEVINSTALLDIR)/opt + include $(GBUILDDIR)/platform/com_GCC_defs.mk gb_MKTEMP := mktemp -t gbuild.XXXXXX @@ -351,7 +353,7 @@ else ifneq ($(gb_JunitTest_DEBUGRUN),) gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) else -gb_JunitTest_SOFFICEARG:=path:$(DEVINSTALLDIR)/opt/program/soffice +gb_JunitTest_SOFFICEARG:=path:$(gb_DEVINSTALLROOT)/program/soffice endif endif @@ -365,12 +367,17 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \ endef +# PythonTest class + +#TODO: +gb_PythonTest_PRECOMMAND := + # Module class define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=`mktemp` && \ -printf ". $(DEVINSTALLDIR)/opt/program/ooenv\\n" > $${OFFICESCRIPT} && \ -printf "gdb --tui $(DEVINSTALLDIR)/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ +printf ". $(gb_DEVINSTALLROOT)/program/ooenv\\n" > $${OFFICESCRIPT} && \ +printf "gdb --tui $(gb_DEVINSTALLROOT)/program/soffice.bin" >> $${OFFICESCRIPT} && \ printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(call gb_Helper_make_url,$(DEVINSTALLDIR)/)\"" >> $${OFFICESCRIPT} && \ printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \ $(SHELL) $${OFFICESCRIPT} && \ @@ -433,9 +440,9 @@ gb_Pyuno_PROGRAMDIRNAME := program # Python gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload" -gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python +gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(gb_DEVINSTALLROOT)/program/python # this is passed to gdb as executable when running tests -gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin +gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_DEVINSTALLROOT)/program/python.bin include $(GBUILDDIR)/platform/com_GCC_class.mk diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 081aa1fcae0a..63e912aa19e4 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -26,6 +26,8 @@ # #************************************************************************* +gb_DEVINSTALLROOT := $(DEVINSTALLDIR)/opt + include $(GBUILDDIR)/platform/com_GCC_defs.mk gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }') @@ -348,7 +350,7 @@ else ifneq ($(gb_JunitTest_DEBUGRUN),) gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) else -gb_JunitTest_SOFFICEARG:=path:$(DEVINSTALLDIR)/opt/program/soffice +gb_JunitTest_SOFFICEARG:=path:$(gb_DEVINSTALLROOT)/program/soffice endif endif @@ -362,12 +364,16 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \ endef +# PythonTest class + +gb_PythonTest_PRECOMMAND := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}$(gb_DEVINSTALLROOT)/ure-link/lib:$(gb_DEVINSTALLROOT)/program:$(OUTDIR)/lib + # Module class define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=`mktemp` && \ -printf 'if [ -e $(DEVINSTALLDIR)/opt/program/ooenv ]; then . $(DEVINSTALLDIR)/opt/program/ooenv; fi\n' > $${OFFICESCRIPT} && \ -printf "gdb $(DEVINSTALLDIR)/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ +printf 'if [ -e $(gb_DEVINSTALLROOT)/program/ooenv ]; then . $(gb_DEVINSTALLROOT)/program/ooenv; fi\n' > $${OFFICESCRIPT} && \ +printf "gdb $(gb_DEVINSTALLROOT)/program/soffice.bin" >> $${OFFICESCRIPT} && \ printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(call gb_Helper_make_url,$(DEVINSTALLDIR)/)\"" >> $${OFFICESCRIPT} && \ $(SHELL) $${OFFICESCRIPT} && \ rm $${OFFICESCRIPT} @@ -432,9 +438,9 @@ gb_Pyuno_PROGRAMDIRNAME := program # Python gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload" -gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(DEVINSTALLDIR)/opt/program/python +gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(gb_DEVINSTALLROOT)/program/python # this is passed to gdb as executable when running tests -gb_Python_INSTALLED_EXECUTABLE_GDB := $(DEVINSTALLDIR)/opt/program/python.bin +gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_DEVINSTALLROOT)/program/python.bin include $(GBUILDDIR)/platform/com_GCC_class.mk |