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 \
69 TestVersionComparator.
cpp \
70 TestRacingServiceManager.
cpp \
71 TestRegistrationOrder.
cpp \
72 TestThreadPoolListener.
cpp \
77 ifndef MOZ_ENABLE_LIBXUL
80 TestPermanentAtoms.
cpp \
84 SIMPLE_PROGRAMS
:= $(CPPSRCS
:.
cpp=$(BIN_SUFFIX
))
93 TestObserverService.
cpp \
96 TestTextFormatter.
cpp \
99 ifndef MOZ_ENABLE_LIBXUL
105 TestExpirationTracker.
cpp \
110 TestXPIDLString.
cpp \
113 TestStorageStream.
cpp \
118 ifndef MOZILLA_INTERNAL_API
124 include $(topsrcdir
)/config
/config.mk
126 ifndef MOZILLA_INTERNAL_API
127 LIBS
+= $(DIST
)/lib
/$(LIB_PREFIX
)xpcomglue_s.
$(LIB_SUFFIX
)
130 LIBS
+= $(XPCOM_LIBS
)
132 # Needed to resolve __yylex (?)
133 ifeq ($(OS_ARCH
)$(OS_RELEASE
),FreeBSD2
)
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
148 -I
$(srcdir)/services \
152 $(INSTALL
) $(srcdir)/test.properties
$(DIST
)/bin
/res
154 # Copy TestHarness.h into its own module, for ease of setting up includes
157 $(NSINSTALL
) -D
$(DIST
)/include/testing
158 $(INSTALL
) $(srcdir)/TestHarness.h
$(DIST
)/include/testing
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)))
170 abs_srcdir
= $(shell cd
$(srcdir) && pwd
)
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"; \
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"; \
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"