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
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.
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 *****
39 topsrcdir
= @top_srcdir@
42 relativesrcdir
= xpcom
/tests
44 include $(DEPTH
)/config
/autoconf.mk
48 ifndef MOZ_ENABLE_LIBXUL
49 MOZILLA_INTERNAL_API
= 1
54 # Disabled because manifests make this test difficult to run correctly.
55 # ifdef MOZ_ENABLE_LIBXUL
59 ifeq ($(OS_ARCH
),WINNT
)
64 DIRS
+= static-checker
69 nsIFileEnumerator.
cpp \
70 TestCallTemplates.
cpp \
72 TestRacingServiceManager.
cpp \
73 TestRegistrationOrder.
cpp \
74 TestThreadPoolListener.
cpp \
76 TestBlockingProcess.
cpp \
79 TestUnicodeArguments.
cpp \
82 ifdef WRAP_STL_INCLUDES
83 CPPSRCS
+= TestSTLWrappers.
cpp
86 SIMPLE_PROGRAMS
:= $(CPPSRCS
:.
cpp=$(BIN_SUFFIX
))
98 TestObserverArray.
cpp \
99 TestObserverService.
cpp \
102 TestTextFormatter.
cpp \
106 ifndef MOZ_ENABLE_LIBXUL
112 TestExpirationTracker.
cpp \
114 TestPriorityQueue.
cpp \
116 TestStorageStream.
cpp \
118 TestSynchronization.
cpp \
123 TestXPIDLString.
cpp \
127 # FIXME: bug 577500 TestStaticAtoms fails when run in dist/bin
128 # TestStaticAtoms.cpp
132 # FIXME bug 523392: TestDeadlockDetector doesn't like Windows
133 # FIXME bug 523378: also fails on OS X
134 ifneq (,$(filter-out WINNT WINCE Darwin
,$(OS_ARCH
)))
136 TestDeadlockDetector.
cpp \
137 TestDeadlockDetectorScalability.
cpp \
142 ifndef MOZILLA_INTERNAL_API
148 include $(topsrcdir
)/config
/config.mk
150 LIBS
+= $(XPCOM_LIBS
)
152 # Needed to resolve __yylex (?)
153 ifeq ($(OS_ARCH
)$(OS_RELEASE
),FreeBSD2
)
157 XPCSHELL_TESTS
= unit
159 # Make sure we have symbols in case we need to debug these.
160 MOZ_DEBUG_SYMBOLS
= 1
162 include $(topsrcdir
)/config
/rules.mk
164 ifeq ($(OS_ARCH
),WINCE
)
165 EXTRA_LIBS
+= libcmt.lib
170 -I
$(srcdir)/services \
174 $(INSTALL
) $(srcdir)/test.properties
$(DIST
)/bin
/res
175 $(INSTALL
) $(SIMPLE_PROGRAMS
) $(DEPTH
)/_tests
/xpcshell
/$(relativesrcdir
)/unit
177 # Copy TestHarness.h into its own module, for ease of setting up includes
180 $(NSINSTALL
) -D
$(DIST
)/include/testing
181 $(INSTALL
) $(srcdir)/TestHarness.h
$(DIST
)/include/testing
184 $(SYSINSTALL
) $(IFLAGS1
) $(srcdir)/test.properties
$(DESTDIR
)$(mozappdir
)/res
186 ifeq (,$(filter-out WINNT WINCE os2-emx
, $(HOST_OS_ARCH
)))
187 swapslashes
= $(shell echo
$(1) | sed
-e
's|/|\\|g')
188 getnativepath
= $(call swapslashes
,$(call normalizepath
,$(1)))
193 abs_srcdir
= $(shell cd
$(srcdir) && pwd
)
196 DM_RM
= $(PYTHON
) $(topsrcdir
)/build
/mobile
/devicemanager-utils.py delete
197 DM_CP
= $(PYTHON
) $(topsrcdir
)/build
/mobile
/devicemanager-utils.py copy
200 regOrderDir
=\\tests
\\regorder
; # This is WinCe specific, adjust for other platforms
201 DOCOPY
=$(DM_CP
) $(srcdir)/regorder
$(regOrderDir
)
203 DIST_PATH
= $(DIST
)/bin
/
205 regOrderDir
="$(call getnativepath,$(abs_srcdir)/regorder)";
209 @echo
"Running XPIDL tests"
210 $(XPIDL_COMPILE
) -m header
$(srcdir)/TestScriptable.idl
211 @if grep Notscriptable TestScriptable.h | grep NS_SCRIPTABLE
>/dev
/null
2>&1 ; then \
212 echo
"Nonscriptable object marked scriptable by xpidl"; \
215 @if
test `grep 'NS_IMETHOD[^I].*Scriptable' TestScriptable.h | grep -v -c NS_SCRIPTABLE` -ne
0 ; then \
216 echo
"Scriptable object marked nonscriptable by xpidl"; \
219 $(RM_DIST
) $(DIST_PATH
)components
/compreg.dat
; \
221 XPCOM_DEBUG_BREAK
=stack-and-abort
$(RUN_TEST_PROGRAM
) \
222 $(DIST
)/bin
/TestRegistrationOrder
$(BIN_SUFFIX
) $(regOrderDir
)
224 GARBAGE
+= TestScriptable.h