Automated checkin: version bump remove "pre" from version number for firefox 3.7a1...
[mozilla-central.git] / testing / testsuite-targets.mk
blobd6f709c235fe8adaada07a8b02d6b4a2c632f84c
1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
12 # License.
14 # The Original Code is Mozilla Test Harnesses
16 # The Initial Developer of the Original Code is
17 # The Mozilla Foundation
18 # Portions created by the Initial Developer are Copyright (C) 2008
19 # the Initial Developer. All Rights Reserved.
21 # Contributor(s):
22 # Serge Gautherie <sgautherie.bz@free.fr>
23 # Ted Mielczarek <ted.mielczarek@gmail.com>
25 # Alternatively, the contents of this file may be used under the terms of
26 # either of the GNU General Public License Version 2 or later (the "GPL"),
27 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
40 # Shortcut for mochitest* and xpcshell-tests targets,
41 # replaces 'EXTRA_TEST_ARGS=--test-path=...'.
42 ifdef TEST_PATH
43 TEST_PATH_ARG := --test-path=$(TEST_PATH)
44 else
45 TEST_PATH_ARG :=
46 endif
48 SYMBOLS_PATH := --symbols-path=$(DIST)/crashreporter-symbols
50 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] mochitest*|.
51 mochitest:: mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins
53 RUN_MOCHITEST = \
54 rm -f ./$@.log && \
55 $(PYTHON) _tests/testing/mochitest/runtests.py --autorun --close-when-done \
56 --console-level=INFO --log-file=./$@.log --file-level=INFO \
57 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
59 ifndef NO_FAIL_ON_TEST_ERRORS
60 define CHECK_TEST_ERROR
61 @errors=`grep "TEST-UNEXPECTED-" $@.log` ;\
62 if test "$$errors" ; then \
63 echo "$@ failed:"; \
64 echo "$$errors"; \
65 exit 1; \
66 else \
67 echo "$@ passed"; \
69 endef
70 endif
72 mochitest-plain:
73 $(RUN_MOCHITEST)
74 $(CHECK_TEST_ERROR)
76 mochitest-chrome:
77 $(RUN_MOCHITEST) --chrome
78 $(CHECK_TEST_ERROR)
80 mochitest-a11y:
81 $(RUN_MOCHITEST) --a11y
82 $(CHECK_TEST_ERROR)
84 mochitest-ipcplugins:
85 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled=true --test-path=modules/plugin/test
86 $(CHECK_TEST_ERROR)
88 # Usage: |make [EXTRA_TEST_ARGS=...] *test|.
89 RUN_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftest.py \
90 $(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) $(1) | tee ./$@.log
92 reftest: TEST_PATH=layout/reftests/reftest.list
93 reftest:
94 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
95 $(CHECK_TEST_ERROR)
97 crashtest: TEST_PATH=testing/crashtest/crashtests.list
98 crashtest:
99 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
100 $(CHECK_TEST_ERROR)
102 jstestbrowser: TEST_PATH=js/src/tests/jstests.list
103 jstestbrowser:
104 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) --extra-profile-file=$(topsrcdir)/js/src/tests/user.js)
105 $(CHECK_TEST_ERROR)
107 # Execute all xpcshell tests in the directories listed in the manifest.
108 # See also config/rules.mk 'xpcshell-tests' target for local execution.
109 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] xpcshell-tests|.
110 xpcshell-tests:
111 $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
112 -I$(topsrcdir)/build \
113 $(topsrcdir)/testing/xpcshell/runxpcshelltests.py \
114 --manifest=$(DEPTH)/_tests/xpcshell/all-test-dirs.list \
115 --no-logfiles \
116 $(SYMBOLS_PATH) \
117 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
118 $(DIST)/bin/xpcshell
121 # Package up the tests and test harnesses
122 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
124 ifndef UNIVERSAL_BINARY
125 PKG_STAGE = $(DIST)/test-package-stage
126 package-tests: stage-mochitest stage-reftest stage-xpcshell stage-jstests
127 else
128 # This staging area has been built for us by universal/flight.mk
129 PKG_STAGE = $(DIST)/universal/test-package-stage
130 endif
132 package-tests:
133 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
134 @(cd $(PKG_STAGE) && tar $(TAR_CREATE_FLAGS) - *) | bzip2 -f > "$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)"
136 make-stage-dir:
137 rm -rf $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE)/bin && $(NSINSTALL) -D $(PKG_STAGE)/bin/components && $(NSINSTALL) -D $(PKG_STAGE)/certs
139 stage-mochitest: make-stage-dir
140 $(MAKE) -C $(DEPTH)/testing/mochitest stage-package
142 stage-reftest: make-stage-dir
143 $(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
145 stage-xpcshell: make-stage-dir
146 $(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
148 stage-jstests: make-stage-dir
149 $(MAKE) -C $(DEPTH)/js/src/tests stage-package
151 .PHONY: \
152 mochitest mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins \
153 reftest crashtest \
154 xpcshell-tests \
155 jstestbrowser \
156 package-tests make-stage-dir stage-mochitest stage-reftest stage-xpcshell stage-jstests