summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--solenv/gbuild/JunitTest.mk2
-rw-r--r--solenv/gbuild/Module.mk10
-rw-r--r--solenv/gbuild/gbuild.mk4
-rw-r--r--solenv/gbuild/platform/unxgcc.mk26
4 files changed, 38 insertions, 4 deletions
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 3003c9dbd701..33d068c93e28 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -50,8 +50,6 @@ $(call gb_JunitTest_get_target,%) :
mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
($(gb_JunitTest_JAVACOMMAND) \
-cp "$(CLASSPATH)" \
- $(if $(strip $(gb_JunitTest_DEBUGCOMMAND)),\
- '-Dorg.openoffice.test.arg.debugcommand=$(gb_JunitTest_DEBUGCOMMAND)') \
$(DEFS) \
org.junit.runner.JUnitCore \
$(CLASSES) 2>&1 > $@.log || \
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index 82da04192b33..582d960d982e 100644
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -112,6 +112,10 @@ check : unitcheck
$(call gb_Output_announce_title,all tests checked.)
$(call gb_Output_announce_bell)
+debugrun : build
+ $(call gb_Module_DEBUGRUNCOMMAND)
+
+
ifeq ($(strip $(gb_PARTIALBUILD)),)
check : subsequentcheck
@@ -149,6 +153,10 @@ endif
endef
+# Dont recurse in subdirs for help an debugrun
+
+ifeq ($(filter help debugrun,$(MAKECMDGOALS)),)
+
define gb_Module_add_target
$(call gb_Module__read_targetfile,$(1),$(2),target)
@@ -187,6 +195,8 @@ $(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET)
endef
+endif
+
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))
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 361632ea1f6c..0d0bad3c0475 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -123,7 +123,7 @@ gb_ENABLE_PCH := $(false)
endif
# for clean, setuplocal and removelocal goals we switch off dependencies
-ifneq ($(filter cleanpackmodule clean setuplocal removelocal showdeliverables help,$(MAKECMDGOALS)),)
+ifneq ($(filter cleanpackmodule clean setuplocal removelocal showdeliverables help debugrun,$(MAKECMDGOALS)),)
gb_FULLDEPS := $(false)
else
gb_FULLDEPS := $(true)
@@ -377,6 +377,8 @@ AVAILABLE TARGETS
check run unit tests and if in toplevel subsequentcheck
clean remove all generated files
showdeliverables show the targets delivered to OUTDIR and their source
+ debugrun starts the dev-install instance and allows tests to be run
+ against it
INTERACTIVE VARIABLES:
DEBUG / debug If not empty, build with DBGLEVEL=1 (see below).
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 8c8380c5acda..d34d4a101648 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -377,16 +377,40 @@ endef
# JunitTest class
+ifneq ($(OOO_TEST_SOFFICE),)
+gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE)
+else
+ifneq ($(gb_JunitTest_DEBUGRUN),)
+gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER)
+else
+gb_JunitTest_SOFFICEARG:=$(OUTDIR)/installation/opt/program/soffice"
+endif
+endif
+
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}" \
-Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR) \
-Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
-Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \
-Dorg.openoffice.test.arg.postprocesscommand=$(GBUILDDIR)/platform/unxgcc_gdbforjunit.sh \
+ -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \
+
+endef
+# Module class
+
+define gb_Module_DEBUGRUNCOMMAND
+OFFICESCRIPT=`mktemp` && \
+echo ". $(OUTDIR)/installation/opt/program/ooenv" > $${OFFICESCRIPT} && \
+echo "$(OUTDIR)/installation/opt/program/soffice.bin --norestore --nologo \"--accept=pipe,name=$(USER);urp;\" -env:UserInstallation=file://$(OUTDIR)/installation/ &" >> $${OFFICESCRIPT} && \
+echo "OFFICEPID=\$$!" >> $${OFFICESCRIPT} && \
+echo "echo \"office started as \$${OFFICEPID}\"" >> $${OFFICESCRIPT} && \
+echo "gdb -ex \"at \$${OFFICEPID}\" -ex \"c\"" >> $${OFFICESCRIPT} && \
+$(SHELL) $${OFFICESCRIPT} && \
+rm $${OFFICESCRIPT}
endef
+
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload