xref: /aoo41x/main/solenv/inc/installationtest.mk (revision cdf0e10c)
1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3*cdf0e10cSrcweir#
4*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
5*cdf0e10cSrcweir#
6*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
7*cdf0e10cSrcweir#
8*cdf0e10cSrcweir# This file is part of OpenOffice.org.
9*cdf0e10cSrcweir#
10*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
11*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
12*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
13*cdf0e10cSrcweir#
14*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
15*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
16*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
18*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
19*cdf0e10cSrcweir#
20*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
21*cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
22*cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
23*cdf0e10cSrcweir# for a copy of the LGPLv3 License.
24*cdf0e10cSrcweir#***********************************************************************/
25*cdf0e10cSrcweir
26*cdf0e10cSrcweir# relevant for non-product builds only, but built unconditionally
27*cdf0e10cSrcweir.IF "$(ABORT_ON_ASSERTION)" != ""
28*cdf0e10cSrcweir    DBGSV_ERROR_OUT=abort
29*cdf0e10cSrcweir    SAL_DIAGNOSE_ABORT=TRUE
30*cdf0e10cSrcweir    .EXPORT: SAL_DIAGNOSE_ABORT
31*cdf0e10cSrcweir.ELSE
32*cdf0e10cSrcweir    DBGSV_ERROR_OUT=shell
33*cdf0e10cSrcweir.ENDIF
34*cdf0e10cSrcweir.EXPORT: DBGSV_ERROR_OUT
35*cdf0e10cSrcweir
36*cdf0e10cSrcweir# don't allow to overwrite DBGSV_ERROR_OUT with an INI file. Otherwise, people
37*cdf0e10cSrcweir# might be tempted to put an DBGSV_INIT into their .bash_profile which points to a file
38*cdf0e10cSrcweir# delcaring to ignore all assertions completely ...
39*cdf0e10cSrcweirDBGSV_INIT=
40*cdf0e10cSrcweir.EXPORT: DBGSV_INIT
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir.IF "$(OS)" == "WNT"
43*cdf0e10cSrcweirmy_file = file:///
44*cdf0e10cSrcweir.ELSE
45*cdf0e10cSrcweirmy_file = file://
46*cdf0e10cSrcweir.END
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir# The following conditional is an approximation of: UPDATER set to YES and
49*cdf0e10cSrcweir# SHIPDRIVE set and CWS_WORK_STAMP not set and either SOL_TMP not set or
50*cdf0e10cSrcweir# SOLARENV set to a pathname of which SOL_TMP is not a prefix:
51*cdf0e10cSrcweir.IF "$(UPDATER)" == "YES" && "$(SHIPDRIVE)" != "" && \
52*cdf0e10cSrcweir    "$(CWS_WORK_STAMP)" == "" && "$(SOLARENV:s/$(SOL_TMP)//" == "$(SOLARENV)"
53*cdf0e10cSrcweirmy_instsets = $(shell ls -dt \
54*cdf0e10cSrcweir    $(SHIPDRIVE)/$(INPATH)/OpenOffice/archive/$(WORK_STAMP)_$(LAST_MINOR)_native_packed-*_$(defaultlangiso).$(BUILD))
55*cdf0e10cSrcweirinstallationtest_instset = $(my_instsets:1)
56*cdf0e10cSrcweir.ELSE
57*cdf0e10cSrcweirinstallationtest_instset = \
58*cdf0e10cSrcweir    $(SOLARSRC)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(defaultlangiso)
59*cdf0e10cSrcweir.END
60*cdf0e10cSrcweir
61*cdf0e10cSrcweir.IF "$(OS)" == "WNT"
62*cdf0e10cSrcweirinstallationtest_instpath = `cat $(MISC)/$(TARGET)/installation.flag`
63*cdf0e10cSrcweir.ELSE
64*cdf0e10cSrcweirinstallationtest_instpath = $(SOLARVERSION)/$(INPATH)/installation$(UPDMINOREXT)
65*cdf0e10cSrcweir.END
66*cdf0e10cSrcweir
67*cdf0e10cSrcweir.IF "$(OS)" == "MACOSX"
68*cdf0e10cSrcweirmy_sofficepath = \
69*cdf0e10cSrcweir    $(installationtest_instpath)/opt/OpenOffice.org.app/Contents/MacOS/soffice
70*cdf0e10cSrcweir.ELIF "$(OS)" == "WNT"
71*cdf0e10cSrcweirmy_sofficepath = \
72*cdf0e10cSrcweir    $(installationtest_instpath)'/opt/OpenOffice.org 3/program/soffice.exe'
73*cdf0e10cSrcweir.ELSE
74*cdf0e10cSrcweirmy_sofficepath = \
75*cdf0e10cSrcweir    $(installationtest_instpath)/opt/openoffice.org3/program/soffice
76*cdf0e10cSrcweir.END
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir.IF "$(OOO_TEST_SOFFICE)" == ""
79*cdf0e10cSrcweirmy_soffice = path:$(my_sofficepath)
80*cdf0e10cSrcweir.ELSE
81*cdf0e10cSrcweirmy_soffice = '$(OOO_TEST_SOFFICE:s/'/'\''/)'
82*cdf0e10cSrcweir.END
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir.IF "$(OOO_LIBRARY_PATH_VAR)" != ""
85*cdf0e10cSrcweirmy_cppenv = \
86*cdf0e10cSrcweir    -env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
87*cdf0e10cSrcweirmy_javaenv = \
88*cdf0e10cSrcweir    -Dorg.openoffice.test.arg.env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
89*cdf0e10cSrcweir.END
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir# Work around Windows problems with long pathnames (see issue 50885) by
92*cdf0e10cSrcweir# installing into the temp directory instead of the module output tree (in which
93*cdf0e10cSrcweir# case $(TARGET).installation.flag contains the path to the temp installation,
94*cdf0e10cSrcweir# which is removed after smoketest); can be removed once issue 50885 is fixed;
95*cdf0e10cSrcweir# on other platforms, a single installation to solver is created in
96*cdf0e10cSrcweir# smoketestoo_native:
97*cdf0e10cSrcweir.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
98*cdf0e10cSrcweirOOO_EXTRACT_TO:=$(shell cygpath -m `mktemp -dt ooosmoke.XXXXXX`)
99*cdf0e10cSrcweir$(MISC)/$(TARGET)/installation.flag : $(shell \
100*cdf0e10cSrcweir        ls $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip)
101*cdf0e10cSrcweir    $(COMMAND_ECHO)$(MKDIRHIER) $(@:d)
102*cdf0e10cSrcweir    $(COMMAND_ECHO)unzip -q $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip -d "$(OOO_EXTRACT_TO)"
103*cdf0e10cSrcweir    $(COMMAND_ECHO)mv "$(OOO_EXTRACT_TO)"/OOo_*_install-arc_$(defaultlangiso) "$(OOO_EXTRACT_TO)"/opt
104*cdf0e10cSrcweir    $(COMMAND_ECHO)echo "$(OOO_EXTRACT_TO)" > $@
105*cdf0e10cSrcweir.END
106*cdf0e10cSrcweir
107*cdf0e10cSrcweircpptest .PHONY :
108*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
109*cdf0e10cSrcweir    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
110*cdf0e10cSrcweir    $(CPPUNITTESTER) \
111*cdf0e10cSrcweir        -env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb \
112*cdf0e10cSrcweir        -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb \
113*cdf0e10cSrcweir        -env:arg-soffice=$(my_soffice) -env:arg-user=$(MISC)/$(TARGET)/user \
114*cdf0e10cSrcweir        $(my_cppenv) $(TEST_ARGUMENTS:^"-env:arg-testarg.") --protector \
115*cdf0e10cSrcweir        $(SOLARSHAREDBIN)/unoexceptionprotector$(DLLPOST) \
116*cdf0e10cSrcweir        unoexceptionprotector $(CPPTEST_LIBRARY)
117*cdf0e10cSrcweir# As a workaround for #i111400#, ignore failure of $(RM):
118*cdf0e10cSrcweir    $(COMMAND_ECHO)- $(RM) -r $(MISC)/$(TARGET)/user
119*cdf0e10cSrcweir.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
120*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
121*cdf0e10cSrcweircpptest : $(MISC)/$(TARGET)/installation.flag
122*cdf0e10cSrcweir.END
123*cdf0e10cSrcweir
124*cdf0e10cSrcweir.IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != ""
125*cdf0e10cSrcweirjavatest_% .PHONY : $(JAVATARGET)
126*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
127*cdf0e10cSrcweir    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
128*cdf0e10cSrcweir    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
129*cdf0e10cSrcweir        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
130*cdf0e10cSrcweir        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
131*cdf0e10cSrcweir        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
132*cdf0e10cSrcweir        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
133*cdf0e10cSrcweir        org.junit.runner.JUnitCore \
134*cdf0e10cSrcweir        $(subst,/,. $(PACKAGE)).$(@:s/javatest_//)
135*cdf0e10cSrcweir    $(RM) -r $(MISC)/$(TARGET)/user
136*cdf0e10cSrcweir.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
137*cdf0e10cSrcweir    $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
138*cdf0e10cSrcweirjavatest : $(MISC)/$(TARGET)/installation.flag
139*cdf0e10cSrcweir.END
140*cdf0e10cSrcweirjavatest .PHONY : $(JAVATARGET)
141*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
142*cdf0e10cSrcweir    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
143*cdf0e10cSrcweir    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
144*cdf0e10cSrcweir        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
145*cdf0e10cSrcweir        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
146*cdf0e10cSrcweir        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
147*cdf0e10cSrcweir        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
148*cdf0e10cSrcweir        org.junit.runner.JUnitCore \
149*cdf0e10cSrcweir        $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(i:s/.java//))
150*cdf0e10cSrcweir    $(RM) -r $(MISC)/$(TARGET)/user
151*cdf0e10cSrcweir.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
152*cdf0e10cSrcweir    $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
153*cdf0e10cSrcweirjavatest : $(MISC)/$(TARGET)/installation.flag
154*cdf0e10cSrcweir.END
155*cdf0e10cSrcweir.ELSE
156*cdf0e10cSrcweirjavatest .PHONY :
157*cdf0e10cSrcweir    @echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR'
158*cdf0e10cSrcweir.END
159