xref: /trunk/main/configmgr/qa/unit/makefile.mk (revision 7231f715)
1e3c01311SAndrew Rist#**************************************************************
2e3c01311SAndrew Rist#
3e3c01311SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4e3c01311SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5e3c01311SAndrew Rist#  distributed with this work for additional information
6e3c01311SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7e3c01311SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8e3c01311SAndrew Rist#  "License"); you may not use this file except in compliance
9e3c01311SAndrew Rist#  with the License.  You may obtain a copy of the License at
10e3c01311SAndrew Rist#
11e3c01311SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12e3c01311SAndrew Rist#
13e3c01311SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14e3c01311SAndrew Rist#  software distributed under the License is distributed on an
15e3c01311SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16e3c01311SAndrew Rist#  KIND, either express or implied.  See the License for the
17e3c01311SAndrew Rist#  specific language governing permissions and limitations
18e3c01311SAndrew Rist#  under the License.
19e3c01311SAndrew Rist#
20e3c01311SAndrew Rist#**************************************************************
21e3c01311SAndrew Rist
22e3c01311SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ = ../..
25cdf0e10cSrcweirPRJNAME = configmgr
26cdf0e10cSrcweirTARGET = unit
27cdf0e10cSrcweir
28cdf0e10cSrcweirENABLE_EXCEPTIONS = TRUE
29cdf0e10cSrcweir
30cdf0e10cSrcweir.INCLUDE: settings.mk
31cdf0e10cSrcweir
32*7231f715SDamjan Jovanovic.IF "$(ENABLE_UNIT_TESTS)" != "YES"
33*7231f715SDamjan Jovanovicall:
34*7231f715SDamjan Jovanovic	@echo unit tests are disabled. Nothing to do.
35*7231f715SDamjan Jovanovic
36*7231f715SDamjan Jovanovic.ELSE
37cdf0e10cSrcweir
38cdf0e10cSrcweirSLOFILES = $(SLO)/test.obj
39cdf0e10cSrcweir
40*7231f715SDamjan JovanovicAPP1OBJS = $(SLOFILES)
41*7231f715SDamjan JovanovicAPP1STDLIBS = \
42cdf0e10cSrcweir    $(CPPUHELPERLIB) \
43cdf0e10cSrcweir    $(CPPULIB) \
44*7231f715SDamjan Jovanovic    $(GTESTLIB) \
45cdf0e10cSrcweir    $(SALLIB) \
46cdf0e10cSrcweir    $(TESTSHL2LIB)
47*7231f715SDamjan JovanovicAPP1TARGET = unit
48*7231f715SDamjan JovanovicAPP1RPATH = NONE
49*7231f715SDamjan Jovanovic# this is a custom test, can't use APP1TARGET_run so disable it here:
50*7231f715SDamjan JovanovicAPP1TEST = disabled
51cdf0e10cSrcweir
52cdf0e10cSrcweir.INCLUDE: target.mk
53cdf0e10cSrcweir
54cdf0e10cSrcweirALLTAR: TEST
55cdf0e10cSrcweir
56cdf0e10cSrcweir.IF "$(OS)" == "OS2" || "$(OS)" == "WNT"
57cdf0e10cSrcweirMY_INI = .ini
58cdf0e10cSrcweir.ELSE
59cdf0e10cSrcweirMY_INI = rc
60cdf0e10cSrcweir.ENDIF
61cdf0e10cSrcweir
62*7231f715SDamjan JovanovicDLLPRE = # no leading "lib" on .so files
63*7231f715SDamjan Jovanovic
64cdf0e10cSrcweir$(MISC)/unit.rdb .ERRREMOVE:
65cdf0e10cSrcweir    cp $(SOLARBINDIR)/types.rdb $@
66*7231f715SDamjan Jovanovic    $(REGCOMP) -register -r $@ -c $(DLLDEST)/$(DLLPRE)configmgr.uno$(DLLPOST)
67cdf0e10cSrcweir
68*7231f715SDamjan JovanovicTEST .PHONY: $(APP1TARGETN) $(MISC)/unit.rdb
69cdf0e10cSrcweir    rm -rf $(MISC)/unitdata
70cdf0e10cSrcweir    mkdir $(MISC)/unitdata
71cdf0e10cSrcweir    cp urebootstrap.ini $(MISC)/unitdata
72cdf0e10cSrcweir    mkdir $(MISC)/unitdata/basis
73cdf0e10cSrcweir    mkdir $(MISC)/unitdata/basis/program
74cdf0e10cSrcweir    echo '[Bootstrap]' > $(MISC)/unitdata/basis/program/uno$(MY_INI)
75cdf0e10cSrcweir    echo 'UNO_SHARED_PACKAGES_CACHE = $$OOO_BASE_DIR' \
76cdf0e10cSrcweir        >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
77cdf0e10cSrcweir    echo 'UNO_USER_PACKAGES_CACHE =' \
78910823aeSJürgen Schmidt        '$${$$OOO_BASE_DIR/program/bootstrap$(MY_INI):UserInstallation}' \
79cdf0e10cSrcweir        >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
80cdf0e10cSrcweir    mkdir $(MISC)/unitdata/basis/share
81cdf0e10cSrcweir    mkdir $(MISC)/unitdata/basis/share/registry
82cdf0e10cSrcweir    cp data.xcd $(MISC)/unitdata/basis/share/registry
83cdf0e10cSrcweir    mkdir $(MISC)/unitdata/brand
84cdf0e10cSrcweir    mkdir $(MISC)/unitdata/brand/program
85cdf0e10cSrcweir    echo '[Bootstrap]' > $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
86cdf0e10cSrcweir    echo 'UserInstallation = $$ORIGIN/../../user' \
87cdf0e10cSrcweir        >> $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
88*7231f715SDamjan Jovanovic    $(COMMAND_ECHO) $(AUGMENT_LIBRARY_PATH_LOCAL) \
89*7231f715SDamjan Jovanovic    URE_BOOTSTRAP=vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
90*7231f715SDamjan Jovanovic    CONFIGMGR_UNIT_FORWARD_STRING=$(MISC)/unit.rdb \
91*7231f715SDamjan Jovanovic    $(APP1TARGETN) --gtest_output="xml:$(BIN)/$(APP1TARGET)_result.xml"
92*7231f715SDamjan Jovanovic
93*7231f715SDamjan Jovanovic.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
94