merge the formfield patch from ooo-build
[ooovba.git] / solenv / inc / cppunit.mk
blob6571d60d3ab0691eb7dadabb4fd083db2b2e1f81
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: cppunit.mk,v $
11 # $Revision: 1.9 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 # Helper makefile additional, to support
33 # dmake test
34 # for testshl2 (cppunit testing)
35 # for simple start all generated libraries:
36 # dmake test
38 # for library 1 & 2:
39 # or dmake test1 test2
41 # for library 2 with additional options to the testshl2
42 # dmake test2 TESTOPT="-dntsf"
44 # This file have to be unroll by
45 # cat cppunit.mk | mkunroll >_cppunit.mk
46 # all between begin and end will repeat n times (at the moment n=10) to create such iterations
47 # $(TNR) is the number
48 # $(SHL$(TNR)TARGETN) is the same like $(OUT)/bin/$(SHL1TARGET) for every number, within unix, "bin" is replaced by "lib"
50 #.IF "$(TESTOPT)"==""
51 # TESTOPT="-onlyerrors"
52 #.ENDIF
54 ################################################################################
55 # unroll begin
56 # ---- create the test libraries ------------------------------------
58 TEST$(TNR)LIB=$(SHL$(TNR)TARGETN)
59 .IF "$(TESTOPT)"==""
60 TEST$(TNR)OPT="-jobexclude"
61 TEST$(TNR)OPT+=$(SHL$(TNR)TARGET).xsce
62 TEST$(TNR)OPT+="-sf"
63 TEST$(TNR)OPT+=$(mktmp "foo")
64 TEST$(TNR)OPT+="-onlyerrors"
65 TEST$(TNR)OPT+=" "
66 TEST$(TNR)OPT+=$(TESTOPTADD)
67 .ELSE
68 TEST$(TNR)OPT=$(TESTOPT)
69 .ENDIF
71 .IF "$(SHL$(TNR)TARGET)"!=""
72 test : test$(TNR)
73 test$(TNR): ALLTAR
74 @echo ----------------------------------------------------------
75 @echo - start unit test \#$(TNR) on library $(TEST$(TNR)LIB)
76 @echo ----------------------------------------------------------
77 .IF "$(OS)" == "LINUX" # full path needed by osl_getModuleURLFromAddress:
78 `which testshl2` $(TEST$(TNR)LIB) $(TEST$(TNR)OPT)
79 .ELSE
80 testshl2 $(TEST$(TNR)LIB) $(TEST$(TNR)OPT)
81 .ENDIF
82 .ENDIF
84 # unroll end