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@
43 include $(DEPTH
)/config
/autoconf.mk
47 ifndef MOZ_ENABLE_LIBXUL
48 MOZILLA_INTERNAL_API
= 1
51 DIRS
= dynamic services external
52 ifeq ($(OS_ARCH
),WINNT
)
57 DIRS
+= static-checker
65 nsIFileEnumerator.
cpp \
67 TestCallTemplates.
cpp \
74 TestObserverService.
cpp \
77 TestVersionComparator.
cpp \
78 TestTextFormatter.
cpp \
81 TestRacingServiceManager.
cpp \
82 TestRegistrationOrder.
cpp \
84 TestThreadPoolListener.
cpp \
89 ifndef MOZ_ENABLE_LIBXUL
97 TestPermanentAtoms.
cpp \
100 TestXPIDLString.
cpp \
103 TestStorageStream.
cpp \
104 TestExpirationTracker.
cpp \
108 ifndef MOZILLA_INTERNAL_API
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
)
127 # Needed to resolve __yylex (?)
128 ifeq ($(OS_ARCH
)$(OS_RELEASE
),FreeBSD2
)
132 ENABLE_CXX_EXCEPTIONS
= 1
134 XPCSHELL_TESTS
= unit
143 TestObserverService \
146 TestRacingServiceManager \
149 TestThreadPoolListener \
153 ifndef MOZ_ENABLE_LIBXUL
159 TestExpirationTracker \
171 ifndef MOZILLA_INTERNAL_API
177 # Make sure we have symbols in case we need to debug these.
178 MOZ_DEBUG_SYMBOLS
= 1
180 include $(topsrcdir
)/config
/rules.mk
184 -I
$(srcdir)/services \
188 $(INSTALL
) $(srcdir)/test.properties
$(DIST
)/bin
/res
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)))
200 abs_srcdir
= $(shell cd
$(srcdir) && pwd
)
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
)
208 for f in
$(CPP_UNIT_TESTS
); do \
210 XPCOM_DEBUG_BREAK
=stack-and-abort
$(RUN_TEST_PROGRAM
) $(DIST
)/bin
/$$f; \
211 echo Finished running
$$f; \
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"; \
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"; \
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"