xref: /trunk/main/solenv/inc/installationtest.mk (revision d435d9a5)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24# relevant for non-product builds only, but built unconditionally
25.IF "$(ABORT_ON_ASSERTION)" != ""
26    DBGSV_ERROR_OUT=abort
27    SAL_DIAGNOSE_ABORT=TRUE
28    .EXPORT: SAL_DIAGNOSE_ABORT
29.ELSE
30    DBGSV_ERROR_OUT=shell
31.ENDIF
32.EXPORT: DBGSV_ERROR_OUT
33
34# don't allow to overwrite DBGSV_ERROR_OUT with an INI file. Otherwise, people
35# might be tempted to put an DBGSV_INIT into their .bash_profile which points to a file
36# delcaring to ignore all assertions completely ...
37DBGSV_INIT=
38.EXPORT: DBGSV_INIT
39
40.IF "$(OS)" == "WNT"
41my_file = file:///
42.ELSE
43my_file = file://
44.END
45
46# The following conditional is an approximation of: UPDATER set to YES and
47# SHIPDRIVE set and CWS_WORK_STAMP not set and either SOL_TMP not set or
48# SOLARENV set to a pathname of which SOL_TMP is not a prefix:
49.IF "$(UPDATER)" == "YES" && "$(SHIPDRIVE)" != "" && \
50    "$(CWS_WORK_STAMP)" == "" && "$(SOLARENV:s/$(SOL_TMP)//" == "$(SOLARENV)"
51my_instsets = $(shell ls -dt \
52    $(SHIPDRIVE)/$(INPATH)/Apache_OpenOffice/archive/$(WORK_STAMP)_$(LAST_MINOR)_native_packed-*_$(defaultlangiso).$(BUILD))
53installationtest_instset = $(my_instsets:1)
54.ELSE
55installationtest_instset = \
56    $(SOLARSRC)/instsetoo_native/$(INPATH)/Apache_OpenOffice/archive/install/$(defaultlangiso)
57.END
58
59installationtest_instpath = $(SOLARVERSION)/$(INPATH)/installation$(UPDMINOREXT)
60
61.IF "$(OS)" == "WNT"
62my_sofficepath = \
63    $(SOLARSRC)'/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/Openoffice 4/program/soffice.exe'
64.ELSE
65my_sofficepath = \
66    $(SOLARSRC)/instsetoo_native/$(INPATH)/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice
67.END
68
69.IF "$(OOO_TEST_SOFFICE)" == ""
70my_soffice = path:$(my_sofficepath)
71.ELSE
72my_soffice = '$(OOO_TEST_SOFFICE:s/'/'\''/)'
73.END
74
75.IF "$(OOO_LIBRARY_PATH_VAR)" != ""
76my_cppenv = \
77    -env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
78my_javaenv = \
79    -Dorg.openoffice.test.arg.env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
80.END
81
82.IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != ""
83.IF "$(HAMCREST_CORE_JAR)" != ""
84javatest_% .PHONY : $(JAVATARGET)
85    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
86    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
87    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
88        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(HAMCREST_CORE_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
89        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
90        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
91        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
92        org.junit.runner.JUnitCore \
93        $(subst,/,. $(PACKAGE)).$(@:s/javatest_//)
94.ELSE
95javatest_% .PHONY : $(JAVATARGET)
96    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
97    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
98    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
99        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
100        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
101        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
102        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
103        org.junit.runner.JUnitCore \
104        $(subst,/,. $(PACKAGE)).$(@:s/javatest_//)
105.END
106    $(RM) -r $(MISC)/$(TARGET)/user
107javatest .PHONY : $(JAVATARGET)
108    $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
109    $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
110.IF "$(HAMCREST_CORE_JAR)" != ""
111    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
112        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(HAMCREST_CORE_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
113        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
114        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
115        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
116        org.junit.runner.JUnitCore \
117        $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(subst,/,. $(i:s/.java//)))
118.ELSE
119    $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
120        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
121        -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
122        -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
123        $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
124        org.junit.runner.JUnitCore \
125        $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(subst,/,. $(i:s/.java//)))
126.END
127    $(RM) -r $(MISC)/$(TARGET)/user
128.ELSE
129javatest .PHONY :
130    @echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR'
131.END
132