1998-08-20 00:42:14 +04:00
|
|
|
#
|
2004-04-18 18:21:17 +04:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-08-20 00:42:14 +04:00
|
|
|
#
|
2004-04-18 18:21:17 +04:00
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
1998-08-20 00:42:14 +04:00
|
|
|
#
|
1999-11-06 06:43:54 +03:00
|
|
|
# The Original Code is mozilla.org code.
|
|
|
|
#
|
2004-04-18 18:21:17 +04:00
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Netscape Communications Corporation.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1999-11-06 06:43:54 +03:00
|
|
|
#
|
2004-04-18 18:21:17 +04:00
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
1999-07-23 03:20:25 +04:00
|
|
|
#
|
2004-04-18 18:21:17 +04:00
|
|
|
# ***** END LICENSE BLOCK *****
|
1998-08-20 00:42:14 +04:00
|
|
|
|
1998-10-21 06:13:56 +04:00
|
|
|
DEPTH = ../..
|
1998-08-20 00:42:14 +04:00
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
1998-10-21 06:13:56 +04:00
|
|
|
VPATH = @srcdir@
|
1998-08-20 00:42:14 +04:00
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2000-11-20 10:16:06 +03:00
|
|
|
MODULE = xpcom
|
2005-11-08 21:17:49 +03:00
|
|
|
|
|
|
|
ifndef MOZ_ENABLE_LIBXUL
|
2005-04-01 22:22:57 +04:00
|
|
|
MOZILLA_INTERNAL_API = 1
|
2005-11-08 21:17:49 +03:00
|
|
|
endif
|
2005-04-01 22:22:57 +04:00
|
|
|
|
2006-05-20 02:37:17 +04:00
|
|
|
DIRS = dynamic services external
|
2001-12-09 10:05:12 +03:00
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
|
|
DIRS += windows
|
|
|
|
endif
|
|
|
|
|
2008-02-27 19:28:13 +03:00
|
|
|
ifdef DEHYDRA_PATH
|
|
|
|
DIRS += static-checker
|
|
|
|
endif
|
|
|
|
|
2002-05-08 10:11:48 +04:00
|
|
|
REQUIRES = \
|
2001-09-18 17:41:47 +04:00
|
|
|
string \
|
|
|
|
$(NULL)
|
1998-08-20 00:42:14 +04:00
|
|
|
|
1999-07-23 03:20:25 +04:00
|
|
|
CPPSRCS = \
|
2000-09-15 02:56:56 +04:00
|
|
|
nsIFileEnumerator.cpp \
|
2001-07-04 22:55:15 +04:00
|
|
|
TestCallTemplates.cpp \
|
2005-08-15 22:29:55 +04:00
|
|
|
TestINIParser.cpp \
|
2008-09-05 02:44:41 +04:00
|
|
|
TestRacingServiceManager.cpp \
|
2008-04-01 17:06:18 +04:00
|
|
|
TestRegistrationOrder.cpp \
|
2008-08-12 04:01:47 +04:00
|
|
|
TestThreadPoolListener.cpp \
|
2008-07-24 21:20:33 +04:00
|
|
|
TestTimers.cpp \
|
2008-08-15 13:12:45 +04:00
|
|
|
TestOOM.cpp \
|
2009-03-09 19:47:39 +03:00
|
|
|
TestBlockingProcess.cpp \
|
|
|
|
TestQuickReturn.cpp \
|
|
|
|
TestArguments.cpp \
|
2005-11-08 21:17:49 +03:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
ifndef MOZ_ENABLE_LIBXUL
|
|
|
|
CPPSRCS += \
|
|
|
|
TestAtoms.cpp \
|
2001-10-21 03:19:07 +04:00
|
|
|
TestPermanentAtoms.cpp \
|
1999-07-23 03:20:25 +04:00
|
|
|
$(NULL)
|
2005-11-08 21:17:49 +03:00
|
|
|
endif
|
1999-07-23 03:20:25 +04:00
|
|
|
|
2008-12-04 09:25:00 +03:00
|
|
|
SIMPLE_PROGRAMS := $(CPPSRCS:.cpp=$(BIN_SUFFIX))
|
|
|
|
|
|
|
|
CPP_UNIT_TESTS = \
|
|
|
|
TestAutoPtr.cpp \
|
|
|
|
TestCOMPtr.cpp \
|
|
|
|
TestCOMPtrEq.cpp \
|
|
|
|
TestFactory.cpp \
|
2009-03-24 03:44:37 +03:00
|
|
|
TestFile.cpp \
|
2008-12-04 09:25:00 +03:00
|
|
|
TestHashtables.cpp \
|
|
|
|
TestID.cpp \
|
|
|
|
TestObserverService.cpp \
|
|
|
|
TestPipe.cpp \
|
|
|
|
TestServMgr.cpp \
|
|
|
|
TestTextFormatter.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
ifndef MOZ_ENABLE_LIBXUL
|
|
|
|
CPP_UNIT_TESTS += \
|
|
|
|
TestArray.cpp \
|
|
|
|
TestAutoLock.cpp \
|
|
|
|
TestCRT.cpp \
|
|
|
|
TestEncoding.cpp \
|
|
|
|
TestExpirationTracker.cpp \
|
|
|
|
TestPipes.cpp \
|
|
|
|
TestProxies.cpp \
|
|
|
|
TestThreads.cpp \
|
|
|
|
TestThreadPool.cpp \
|
|
|
|
TestXPIDLString.cpp \
|
|
|
|
TestDeque.cpp \
|
|
|
|
TestStrings.cpp \
|
|
|
|
TestStorageStream.cpp \
|
|
|
|
TestTArray.cpp \
|
2009-04-06 06:19:41 +04:00
|
|
|
TestTimeStamp.cpp \
|
2008-12-04 09:25:00 +03:00
|
|
|
$(NULL)
|
2008-07-13 01:27:27 +04:00
|
|
|
endif
|
1999-07-23 03:20:25 +04:00
|
|
|
|
2008-12-04 09:25:00 +03:00
|
|
|
ifndef MOZILLA_INTERNAL_API
|
|
|
|
CPP_UNIT_TESTS += \
|
|
|
|
TestStringAPI.cpp \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
2008-07-13 01:32:25 +04:00
|
|
|
|
1999-12-21 04:39:12 +03:00
|
|
|
include $(topsrcdir)/config/config.mk
|
|
|
|
|
2005-11-08 21:17:49 +03:00
|
|
|
ifndef MOZILLA_INTERNAL_API
|
|
|
|
LIBS += $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX)
|
|
|
|
endif
|
|
|
|
|
2008-12-04 12:13:14 +03:00
|
|
|
LIBS += $(XPCOM_LIBS)
|
|
|
|
|
1999-06-09 12:43:51 +04:00
|
|
|
# Needed to resolve __yylex (?)
|
|
|
|
ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
|
|
|
|
LIBS += -lpcap
|
|
|
|
endif
|
|
|
|
|
2004-11-23 22:34:02 +03:00
|
|
|
ENABLE_CXX_EXCEPTIONS = 1
|
|
|
|
|
2007-01-31 06:25:46 +03:00
|
|
|
XPCSHELL_TESTS = unit
|
|
|
|
|
2008-08-12 04:01:47 +04:00
|
|
|
# Make sure we have symbols in case we need to debug these.
|
|
|
|
MOZ_DEBUG_SYMBOLS = 1
|
|
|
|
|
1999-07-23 03:20:25 +04:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2001-12-09 10:05:12 +03:00
|
|
|
LOCAL_INCLUDES = \
|
2001-10-21 03:19:07 +04:00
|
|
|
-I$(srcdir)/../ds \
|
|
|
|
-I$(srcdir)/services \
|
|
|
|
$(NULL)
|
1999-07-23 03:20:25 +04:00
|
|
|
|
2001-11-21 11:55:59 +03:00
|
|
|
libs::
|
1999-09-18 06:12:56 +04:00
|
|
|
$(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
|
2009-03-21 18:20:00 +03:00
|
|
|
$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(MODULE)/unit
|
1999-05-27 12:50:52 +04:00
|
|
|
|
2008-12-04 09:25:00 +03:00
|
|
|
# Copy TestHarness.h into its own module, for ease of setting up includes
|
|
|
|
# correctly.
|
|
|
|
export::
|
|
|
|
$(NSINSTALL) -D $(DIST)/include/testing
|
|
|
|
$(INSTALL) $(srcdir)/TestHarness.h $(DIST)/include/testing
|
|
|
|
|
2002-04-25 06:52:44 +04:00
|
|
|
install::
|
|
|
|
$(SYSINSTALL) $(IFLAGS1) $(srcdir)/test.properties $(DESTDIR)$(mozappdir)/res
|
|
|
|
|
2009-03-05 21:03:14 +03:00
|
|
|
ifeq (,$(filter-out WINNT WINCE os2-emx, $(HOST_OS_ARCH)))
|
2008-04-01 17:06:18 +04:00
|
|
|
swapslashes = $(shell echo $(1) | sed -e 's|/|\\|g')
|
|
|
|
getnativepath = $(call swapslashes,$(call normalizepath,$(1)))
|
|
|
|
else
|
|
|
|
getnativepath = $(1)
|
|
|
|
endif
|
|
|
|
|
2008-04-10 20:14:01 +04:00
|
|
|
abs_srcdir = $(shell cd $(srcdir) && pwd)
|
|
|
|
|
2005-08-11 20:41:54 +04:00
|
|
|
check::
|
2008-03-12 14:00:24 +03:00
|
|
|
@echo "Running XPIDL tests"
|
|
|
|
$(XPIDL_COMPILE) -m header $(srcdir)/TestScriptable.idl
|
|
|
|
@if grep Notscriptable TestScriptable.h | grep -q NS_SCRIPTABLE ; then \
|
|
|
|
echo "Nonscriptable object marked scriptable by xpidl"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
@if test $$( grep 'NS_IMETHOD[^I].*Scriptable' TestScriptable.h | grep -v -c NS_SCRIPTABLE ) != 0 ; then \
|
|
|
|
echo "Scriptable object marked nonscriptable by xpidl"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2008-04-10 20:14:01 +04:00
|
|
|
rm -f $(DIST)/bin/components/compreg.dat; \
|
|
|
|
regOrderDir="$(call getnativepath,$(abs_srcdir)/regorder)"; \
|
2008-04-01 17:06:18 +04:00
|
|
|
XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) \
|
|
|
|
$(DIST)/bin/TestRegistrationOrder$(BIN_SUFFIX) "$$regOrderDir"
|