Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / xpcom / tests / Makefile.in
blob9329bde2cd65f402a6b55f87b08a6cfdb0a5698d
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
22 # Contributor(s):
24 # Alternatively, the contents of this file may be used under the terms of
25 # either of the GNU General Public License Version 2 or later (the "GPL"),
26 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
38 DEPTH = ../..
39 topsrcdir = @top_srcdir@
40 srcdir = @srcdir@
41 VPATH = @srcdir@
43 include $(DEPTH)/config/autoconf.mk
45 MODULE = xpcom
47 ifndef MOZ_ENABLE_LIBXUL
48 MOZILLA_INTERNAL_API = 1
49 endif
51 DIRS = dynamic services external
52 ifeq ($(OS_ARCH),WINNT)
53 DIRS += windows
54 endif
56 ifdef DEHYDRA_PATH
57 DIRS += static-checker
58 endif
60 REQUIRES = \
61 string \
62 $(NULL)
64 CPPSRCS = \
65 nsIFileEnumerator.cpp \
66 nsIFileTest.cpp \
67 TestCallTemplates.cpp \
68 TestINIParser.cpp \
69 TestVersionComparator.cpp \
70 TestRacingServiceManager.cpp \
71 TestRegistrationOrder.cpp \
72 TestThreadPoolListener.cpp \
73 TestTimers.cpp \
74 TestOOM.cpp \
75 $(NULL)
77 ifndef MOZ_ENABLE_LIBXUL
78 CPPSRCS += \
79 TestAtoms.cpp \
80 TestPermanentAtoms.cpp \
81 $(NULL)
82 endif
84 SIMPLE_PROGRAMS := $(CPPSRCS:.cpp=$(BIN_SUFFIX))
86 CPP_UNIT_TESTS = \
87 TestAutoPtr.cpp \
88 TestCOMPtr.cpp \
89 TestCOMPtrEq.cpp \
90 TestFactory.cpp \
91 TestHashtables.cpp \
92 TestID.cpp \
93 TestObserverService.cpp \
94 TestPipe.cpp \
95 TestServMgr.cpp \
96 TestTextFormatter.cpp \
97 $(NULL)
99 ifndef MOZ_ENABLE_LIBXUL
100 CPP_UNIT_TESTS += \
101 TestArray.cpp \
102 TestAutoLock.cpp \
103 TestCRT.cpp \
104 TestEncoding.cpp \
105 TestExpirationTracker.cpp \
106 TestPipes.cpp \
107 TestProxies.cpp \
108 TestThreads.cpp \
109 TestThreadPool.cpp \
110 TestXPIDLString.cpp \
111 TestDeque.cpp \
112 TestStrings.cpp \
113 TestStorageStream.cpp \
114 TestTArray.cpp \
115 $(NULL)
116 endif
118 ifndef MOZILLA_INTERNAL_API
119 CPP_UNIT_TESTS += \
120 TestStringAPI.cpp \
121 $(NULL)
122 endif
124 include $(topsrcdir)/config/config.mk
126 ifndef MOZILLA_INTERNAL_API
127 LIBS += $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX)
128 endif
130 LIBS += $(XPCOM_LIBS)
132 # Needed to resolve __yylex (?)
133 ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
134 LIBS += -lpcap
135 endif
137 ENABLE_CXX_EXCEPTIONS = 1
139 XPCSHELL_TESTS = unit
141 # Make sure we have symbols in case we need to debug these.
142 MOZ_DEBUG_SYMBOLS = 1
144 include $(topsrcdir)/config/rules.mk
146 LOCAL_INCLUDES = \
147 -I$(srcdir)/../ds \
148 -I$(srcdir)/services \
149 $(NULL)
151 libs::
152 $(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
154 # Copy TestHarness.h into its own module, for ease of setting up includes
155 # correctly.
156 export::
157 $(NSINSTALL) -D $(DIST)/include/testing
158 $(INSTALL) $(srcdir)/TestHarness.h $(DIST)/include/testing
160 install::
161 $(SYSINSTALL) $(IFLAGS1) $(srcdir)/test.properties $(DESTDIR)$(mozappdir)/res
163 ifeq (,$(filter-out WINNT WINCE, $(HOST_OS_ARCH)))
164 swapslashes = $(shell echo $(1) | sed -e 's|/|\\|g')
165 getnativepath = $(call swapslashes,$(call normalizepath,$(1)))
166 else
167 getnativepath = $(1)
168 endif
170 abs_srcdir = $(shell cd $(srcdir) && pwd)
172 check::
173 @echo "Running TestVersionComparator tests"
174 @$(PERL) -w $(srcdir)/TestVersionComparatorRunner.pl "$(RUN_TEST_PROGRAM) $(FINAL_TARGET)/TestVersionComparator$(BIN_SUFFIX)"
175 @echo "Running XPIDL tests"
176 $(XPIDL_COMPILE) -m header $(srcdir)/TestScriptable.idl
177 @if grep Notscriptable TestScriptable.h | grep -q NS_SCRIPTABLE ; then \
178 echo "Nonscriptable object marked scriptable by xpidl"; \
179 exit 1; \
181 @if test $$( grep 'NS_IMETHOD[^I].*Scriptable' TestScriptable.h | grep -v -c NS_SCRIPTABLE ) != 0 ; then \
182 echo "Scriptable object marked nonscriptable by xpidl"; \
183 exit 1; \
185 rm -f $(DIST)/bin/components/compreg.dat; \
186 regOrderDir="$(call getnativepath,$(abs_srcdir)/regorder)"; \
187 XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) \
188 $(DIST)/bin/TestRegistrationOrder$(BIN_SUFFIX) "$$regOrderDir"