Bug 462294 - Add "View Video" to context menu for <video> elements. r=gavin, ui...
[wine-gecko.git] / xpcom / tests / Makefile.in
blob6dea4642fbc2bee131ac63f13eeab25f2c0264a6
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 TestCOMPtr.cpp \
69 TestCOMPtrEq.cpp \
70 TestFactory.cpp \
71 TestHashtables.cpp \
72 TestID.cpp \
73 TestINIParser.cpp \
74 TestObserverService.cpp \
75 TestServMgr.cpp \
76 TestAutoPtr.cpp \
77 TestVersionComparator.cpp \
78 TestTextFormatter.cpp \
79 TestPipe.cpp \
80 TestPipes.cpp \
81 TestRacingServiceManager.cpp \
82 TestRegistrationOrder.cpp \
83 TestProxies.cpp \
84 TestThreadPoolListener.cpp \
85 TestTimers.cpp \
86 TestOOM.cpp \
87 $(NULL)
89 ifndef MOZ_ENABLE_LIBXUL
90 CPPSRCS += \
91 TestArray.cpp \
92 TestTArray.cpp \
93 TestAtoms.cpp \
94 TestAutoLock.cpp \
95 TestCRT.cpp \
96 TestEncoding.cpp \
97 TestPermanentAtoms.cpp \
98 TestThreads.cpp \
99 TestThreadPool.cpp \
100 TestXPIDLString.cpp \
101 TestDeque.cpp \
102 TestStrings.cpp \
103 TestStorageStream.cpp \
104 TestExpirationTracker.cpp \
105 $(NULL)
106 endif
108 ifndef MOZILLA_INTERNAL_API
109 CPPSRCS += \
110 TestStringAPI.cpp \
111 $(NULL)
112 endif
114 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
116 include $(topsrcdir)/config/config.mk
118 ifndef MOZILLA_INTERNAL_API
119 LIBS += $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX)
120 endif
122 LIBS += \
123 $(XPCOM_LIBS) \
124 $(NSPR_LIBS) \
125 $(NULL)
127 # Needed to resolve __yylex (?)
128 ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
129 LIBS += -lpcap
130 endif
132 ENABLE_CXX_EXCEPTIONS = 1
134 XPCSHELL_TESTS = unit
136 CPP_UNIT_TESTS = \
137 TestAutoPtr \
138 TestCOMPtr \
139 TestCOMPtrEq \
140 TestFactory \
141 TestHashtables \
142 TestID \
143 TestObserverService \
144 TestPipe \
145 TestPipes \
146 TestRacingServiceManager \
147 TestServMgr \
148 TestTextFormatter \
149 TestThreadPoolListener \
150 TestTimers \
151 $(NULL)
153 ifndef MOZ_ENABLE_LIBXUL
154 CPP_UNIT_TESTS += \
155 TestArray \
156 TestAutoLock \
157 TestCRT \
158 TestEncoding \
159 TestExpirationTracker \
160 TestProxies \
161 TestThreads \
162 TestThreadPool \
163 TestXPIDLString \
164 TestDeque \
165 TestStrings \
166 TestStorageStream \
167 TestTArray \
168 $(NULL)
169 endif
171 ifndef MOZILLA_INTERNAL_API
172 CPP_UNIT_TESTS += \
173 TestStringAPI \
174 $(NULL)
175 endif
177 # Make sure we have symbols in case we need to debug these.
178 MOZ_DEBUG_SYMBOLS = 1
180 include $(topsrcdir)/config/rules.mk
182 LOCAL_INCLUDES = \
183 -I$(srcdir)/../ds \
184 -I$(srcdir)/services \
185 $(NULL)
187 libs::
188 $(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
190 install::
191 $(SYSINSTALL) $(IFLAGS1) $(srcdir)/test.properties $(DESTDIR)$(mozappdir)/res
193 ifeq (,$(filter-out WINNT WINCE, $(HOST_OS_ARCH)))
194 swapslashes = $(shell echo $(1) | sed -e 's|/|\\|g')
195 getnativepath = $(call swapslashes,$(call normalizepath,$(1)))
196 else
197 getnativepath = $(1)
198 endif
200 abs_srcdir = $(shell cd $(srcdir) && pwd)
202 check::
203 @echo "Running TestVersionComparator tests"
204 @$(PERL) -w $(srcdir)/TestVersionComparatorRunner.pl "$(RUN_TEST_PROGRAM) $(FINAL_TARGET)/TestVersionComparator$(BIN_SUFFIX)"
205 @echo "Running nsTextFormatter tests"
206 @$(RUN_TEST_PROGRAM) $(FINAL_TARGET)/TestTextFormatter$(BIN_SUFFIX)
207 @$(EXIT_ON_ERROR) \
208 for f in $(CPP_UNIT_TESTS); do \
209 echo Running $$f; \
210 XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) $(DIST)/bin/$$f; \
211 echo Finished running $$f; \
212 done
213 @echo "Running XPIDL tests"
214 $(XPIDL_COMPILE) -m header $(srcdir)/TestScriptable.idl
215 @if grep Notscriptable TestScriptable.h | grep -q NS_SCRIPTABLE ; then \
216 echo "Nonscriptable object marked scriptable by xpidl"; \
217 exit 1; \
219 @if test $$( grep 'NS_IMETHOD[^I].*Scriptable' TestScriptable.h | grep -v -c NS_SCRIPTABLE ) != 0 ; then \
220 echo "Scriptable object marked nonscriptable by xpidl"; \
221 exit 1; \
223 rm -f $(DIST)/bin/components/compreg.dat; \
224 regOrderDir="$(call getnativepath,$(abs_srcdir)/regorder)"; \
225 XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) \
226 $(DIST)/bin/TestRegistrationOrder$(BIN_SUFFIX) "$$regOrderDir"