gnumake3: JunitTest.mk: bizarre hacks to make it work on windows

This commit is contained in:
Michael Stahl 2011-02-07 16:35:59 +01:00
parent 1b830a82ea
commit 1bb0c1be05
2 changed files with 36 additions and 0 deletions

View file

@ -41,6 +41,7 @@ $(call gb_JunitTest_get_target,%) :
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
$(gb_JunitTest_JAVACOMMAND) -cp "$(CLASSPATH)" $(DEFS) org.junit.runner.JUnitCore $(CLASSES) 2>&1 > $@.log || (cat $@.log && false))
$(CLEAN_CMD)
define gb_JunitTest_JunitTest
$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib

View file

@ -590,6 +590,41 @@ $(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_g
endef
# JunitTest class
gb_defaultlangiso := en-US
gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip
define gb_JunitTest_JunitTest_platform
ifeq ($(OOO_TEST_SOFFICE),)
# Work around Windows problems with long pathnames (see issue 50885) by
# installing into the temp directory instead of the module output tree (in which
# case $(target).instpath contains the path to the temp installation,
# which is removed after smoketest); can be removed once issue 50885 is fixed;
# on other platforms, a single installation to solver is created in
# smoketestoo_native.
$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath
$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
$(call gb_JunitTest_get_target,$(1)).instpath : $(shell ls $(gb_smoketest_instset))
INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
&& unzip -d "$$$${INST_DIR}" "$$<" \
&& mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
&& mkdir -p $$(dir $$@) \
&& echo "$$$${INST_DIR}" > $$@
endif # OOO_TEST_SOFFICE
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
-Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
-Dorg.openoffice.test.arg.env=PATH \
-Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
endef
# SdiTarget class
gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"