xref: /trunk/main/configmgr/qa/unit/makefile.mk (revision 7231f715)
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
24PRJ = ../..
25PRJNAME = configmgr
26TARGET = unit
27
28ENABLE_EXCEPTIONS = TRUE
29
30.INCLUDE: settings.mk
31
32.IF "$(ENABLE_UNIT_TESTS)" != "YES"
33all:
34	@echo unit tests are disabled. Nothing to do.
35
36.ELSE
37
38SLOFILES = $(SLO)/test.obj
39
40APP1OBJS = $(SLOFILES)
41APP1STDLIBS = \
42    $(CPPUHELPERLIB) \
43    $(CPPULIB) \
44    $(GTESTLIB) \
45    $(SALLIB) \
46    $(TESTSHL2LIB)
47APP1TARGET = unit
48APP1RPATH = NONE
49# this is a custom test, can't use APP1TARGET_run so disable it here:
50APP1TEST = disabled
51
52.INCLUDE: target.mk
53
54ALLTAR: TEST
55
56.IF "$(OS)" == "OS2" || "$(OS)" == "WNT"
57MY_INI = .ini
58.ELSE
59MY_INI = rc
60.ENDIF
61
62DLLPRE = # no leading "lib" on .so files
63
64$(MISC)/unit.rdb .ERRREMOVE:
65    cp $(SOLARBINDIR)/types.rdb $@
66    $(REGCOMP) -register -r $@ -c $(DLLDEST)/$(DLLPRE)configmgr.uno$(DLLPOST)
67
68TEST .PHONY: $(APP1TARGETN) $(MISC)/unit.rdb
69    rm -rf $(MISC)/unitdata
70    mkdir $(MISC)/unitdata
71    cp urebootstrap.ini $(MISC)/unitdata
72    mkdir $(MISC)/unitdata/basis
73    mkdir $(MISC)/unitdata/basis/program
74    echo '[Bootstrap]' > $(MISC)/unitdata/basis/program/uno$(MY_INI)
75    echo 'UNO_SHARED_PACKAGES_CACHE = $$OOO_BASE_DIR' \
76        >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
77    echo 'UNO_USER_PACKAGES_CACHE =' \
78        '$${$$OOO_BASE_DIR/program/bootstrap$(MY_INI):UserInstallation}' \
79        >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
80    mkdir $(MISC)/unitdata/basis/share
81    mkdir $(MISC)/unitdata/basis/share/registry
82    cp data.xcd $(MISC)/unitdata/basis/share/registry
83    mkdir $(MISC)/unitdata/brand
84    mkdir $(MISC)/unitdata/brand/program
85    echo '[Bootstrap]' > $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
86    echo 'UserInstallation = $$ORIGIN/../../user' \
87        >> $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
88    $(COMMAND_ECHO) $(AUGMENT_LIBRARY_PATH_LOCAL) \
89    URE_BOOTSTRAP=vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
90    CONFIGMGR_UNIT_FORWARD_STRING=$(MISC)/unit.rdb \
91    $(APP1TARGETN) --gtest_output="xml:$(BIN)/$(APP1TARGET)_result.xml"
92
93.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
94