17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=..$/..$/..
25cdf0e10cSrcweirPRJNAME=sdext
26cdf0e10cSrcweirTARGET=tests
27cdf0e10cSrcweirTARGETTYPE=CUI
28cdf0e10cSrcweirENABLE_EXCEPTIONS=TRUE
29cdf0e10cSrcweir
30cdf0e10cSrcweir# --- Settings -----------------------------------------------------
31cdf0e10cSrcweir
32cdf0e10cSrcweir.INCLUDE: settings.mk
33cdf0e10cSrcweir
34*74e62aedSDamjan Jovanovic.IF "$(ENABLE_UNIT_TESTS)" != "YES"
35*74e62aedSDamjan Jovanovicall:
36*74e62aedSDamjan Jovanovic	@echo unit tests are disabled. Nothing to do.
37*74e62aedSDamjan Jovanovic
38*74e62aedSDamjan Jovanovic.ELSE
39*74e62aedSDamjan Jovanovic
40cdf0e10cSrcweir# --- test lib ------------------------------------------------------
41cdf0e10cSrcweir
42cdf0e10cSrcweir.IF "$(ENABLE_PDFIMPORT)" == "NO"
43cdf0e10cSrcweir@all:
44cdf0e10cSrcweir        @echo "PDF Import extension disabled."
45cdf0e10cSrcweir.ENDIF
46cdf0e10cSrcweir
47cdf0e10cSrcweir.IF "$(SYSTEM_ZLIB)" == "YES"
48cdf0e10cSrcweirCFLAGS+=-DSYSTEM_ZLIB
49cdf0e10cSrcweir.ENDIF
50cdf0e10cSrcweir
51*74e62aedSDamjan JovanovicAPP1OBJS=  \
52cdf0e10cSrcweir	$(SLO)$/tests.obj
53cdf0e10cSrcweir
54*74e62aedSDamjan JovanovicAPP1LIBS=\
55cdf0e10cSrcweir	$(SLB)$/pdfmisc.lib \
56cdf0e10cSrcweir	$(SLB)$/pdfparse.lib \
57cdf0e10cSrcweir	$(SLB)$/pdfsax.lib \
58cdf0e10cSrcweir	$(SLB)$/pdfparsetree.lib \
59cdf0e10cSrcweir	$(SLB)$/pdfodf.lib \
60cdf0e10cSrcweir	$(SLB)$/xpdfwrapper.lib \
61cdf0e10cSrcweir	$(SLB)$/pdfimport.lib
62cdf0e10cSrcweir
63*74e62aedSDamjan JovanovicAPP1TARGET=$(TARGET)
64*74e62aedSDamjan JovanovicAPP1STDLIBS=\
65cdf0e10cSrcweir	$(BASEGFXLIB)		\
66cdf0e10cSrcweir	$(UNOTOOLSLIB)		\
67cdf0e10cSrcweir	$(CANVASTOOLSLIB)	\
68cdf0e10cSrcweir	$(COMPHELPERLIB)	\
69cdf0e10cSrcweir	$(CPPUHELPERLIB)	\
70*74e62aedSDamjan Jovanovic	$(GTESTLIB)		\
71cdf0e10cSrcweir        $(TESTSHL2LIB)           \
72cdf0e10cSrcweir	$(ZLIB3RDLIB)	    \
73cdf0e10cSrcweir	$(CPPULIB)			\
74cdf0e10cSrcweir	$(SALLIB)
75cdf0e10cSrcweir
76cdf0e10cSrcweir
77*74e62aedSDamjan JovanovicAPP1RPATH = NONE
78*74e62aedSDamjan Jovanovic# Run explicitly below:
79*74e62aedSDamjan JovanovicAPP1TEST = disabled
80cdf0e10cSrcweir
81cdf0e10cSrcweir# --- pdf2xml binary ------------------------------------------------------
82cdf0e10cSrcweir
83cdf0e10cSrcweirTARGET2=pdf2xml
84cdf0e10cSrcweir
85*74e62aedSDamjan JovanovicAPP2TARGET=$(TARGET2)
86*74e62aedSDamjan JovanovicAPP2LIBSALCPPRT=
87*74e62aedSDamjan JovanovicAPP2OBJS=$(SLO)$/pdf2xml.obj
88cdf0e10cSrcweir
89*74e62aedSDamjan JovanovicAPP2LIBS=\
90cdf0e10cSrcweir	$(SLB)$/pdfmisc.lib \
91cdf0e10cSrcweir	$(SLB)$/pdfparse.lib \
92cdf0e10cSrcweir	$(SLB)$/pdfsax.lib \
93cdf0e10cSrcweir	$(SLB)$/pdfparsetree.lib \
94cdf0e10cSrcweir	$(SLB)$/pdfodf.lib \
95cdf0e10cSrcweir	$(SLB)$/xpdfwrapper.lib \
96cdf0e10cSrcweir	$(SLB)$/pdfimport.lib
97cdf0e10cSrcweir
98*74e62aedSDamjan JovanovicAPP2STDLIBS=\
99cdf0e10cSrcweir	$(BASEGFXLIB)		\
100cdf0e10cSrcweir	$(UNOTOOLSLIB)		\
101cdf0e10cSrcweir	$(CANVASTOOLSLIB)	\
102cdf0e10cSrcweir	$(COMPHELPERLIB)	\
103cdf0e10cSrcweir	$(CPPUHELPERLIB)	\
104*74e62aedSDamjan Jovanovic	$(GTESTLIB)		\
105cdf0e10cSrcweir        $(TESTSHL2LIB)           \
106cdf0e10cSrcweir	$(ZLIB3RDLIB)	    \
107cdf0e10cSrcweir	$(CPPULIB)			\
108cdf0e10cSrcweir	$(SALLIB)
109cdf0e10cSrcweir
110cdf0e10cSrcweir# --- pdfunzip binary ------------------------------------------------------
111cdf0e10cSrcweir
112cdf0e10cSrcweirTARGET3=pdfunzip
113cdf0e10cSrcweir
114*74e62aedSDamjan JovanovicAPP3TARGET=$(TARGET3)
115*74e62aedSDamjan JovanovicAPP3LIBSALCPPRT=
116*74e62aedSDamjan JovanovicAPP3OBJS=$(SLO)$/pdfunzip.obj
117cdf0e10cSrcweir
118*74e62aedSDamjan JovanovicAPP3LIBS=\
119cdf0e10cSrcweir	$(SLB)$/pdfmisc.lib \
120cdf0e10cSrcweir	$(SLB)$/pdfparse.lib \
121cdf0e10cSrcweir	$(SLB)$/pdfsax.lib \
122cdf0e10cSrcweir	$(SLB)$/pdfparsetree.lib \
123cdf0e10cSrcweir	$(SLB)$/pdfodf.lib \
124cdf0e10cSrcweir	$(SLB)$/xpdfwrapper.lib \
125cdf0e10cSrcweir	$(SLB)$/pdfimport.lib
126cdf0e10cSrcweir
127*74e62aedSDamjan JovanovicAPP3STDLIBS=\
128cdf0e10cSrcweir	$(BASEGFXLIB)		\
129cdf0e10cSrcweir  	$(UNOTOOLSLIB)		\
130cdf0e10cSrcweir  	$(CANVASTOOLSLIB)	\
131cdf0e10cSrcweir  	$(COMPHELPERLIB)	\
132cdf0e10cSrcweir  	$(CPPUHELPERLIB)	\
133*74e62aedSDamjan Jovanovic  	$(GTESTLIB)		\
134cdf0e10cSrcweir        $(TESTSHL2LIB)           \
135cdf0e10cSrcweir  	$(ZLIB3RDLIB)	    \
136cdf0e10cSrcweir  	$(CPPULIB)			\
137cdf0e10cSrcweir  	$(SALLIB)
138cdf0e10cSrcweir
139cdf0e10cSrcweir# --- Targets ------------------------------------------------------
140cdf0e10cSrcweir
141cdf0e10cSrcweir  .INCLUDE : target.mk
142cdf0e10cSrcweir
143cdf0e10cSrcweir# --- Fake uno bootstrap & copy testfile ------------------------
144cdf0e10cSrcweir
145*74e62aedSDamjan Jovanovic$(BIN)$/pdfi_unittest_test.pdf : testinput.pdf
146*74e62aedSDamjan Jovanovic	rm -f $@
147*74e62aedSDamjan Jovanovic	$(GNUCOPY) testinput.pdf $@
148cdf0e10cSrcweir
149*74e62aedSDamjan Jovanovic$(BIN)$/pdfi_unittest_test.ini : makefile.mk
150*74e62aedSDamjan Jovanovic	rm -f $@
151*74e62aedSDamjan Jovanovic	@echo UNO_SERVICES= > $@
152*74e62aedSDamjan Jovanovic	@echo UNO_TYPES=$(UNOUCRRDB:s/\/\\/) >> $@
153cdf0e10cSrcweir
154cdf0e10cSrcweir# --- Enable testshl2 execution in normal build ------------------------
155cdf0e10cSrcweir
156*74e62aedSDamjan Jovanovic$(MISC)$/pdfi_unittest_succeeded : $(APP1TARGETN) $(BIN)$/pdfi_unittest_test.pdf $(BIN)$/pdfi_unittest_test.ini
157*74e62aedSDamjan Jovanovic	rm -f $(BIN)$/pdfi_unittest_draw.xml
158*74e62aedSDamjan Jovanovic	rm -f $(BIN)$/pdfi_unittest_writer.xml
159*74e62aedSDamjan Jovanovic	@echo ----------------------------------------------------------
160*74e62aedSDamjan Jovanovic	@echo - start unit test on $(APP1TARGETN)
161*74e62aedSDamjan Jovanovic	@echo ----------------------------------------------------------
162*74e62aedSDamjan Jovanovic	$(COMMAND_ECHO) $(AUGMENT_LIBRARY_PATH_LOCAL) TESTS_FORWARD_STRING=$(BIN)$/ \
163*74e62aedSDamjan Jovanovic		$(APP1TARGETN) --gtest_output="xml:$(BIN)/$(APP1TARGET)_result.xml"
164*74e62aedSDamjan Jovanovic	$(TOUCH) $@
165*74e62aedSDamjan Jovanovic
166*74e62aedSDamjan JovanovicALLTAR : $(MISC)$/pdfi_unittest_succeeded
167cdf0e10cSrcweir
168*74e62aedSDamjan Jovanovic.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
169