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
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.
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=...'.
43 TEST_PATH_ARG
:= --test-path
=$(TEST_PATH
)
48 # include automation-build.mk to get the path to the binary
49 TARGET_DEPTH
= $(DEPTH
)
50 include $(topsrcdir
)/build
/binary-location.mk
52 SYMBOLS_PATH
:= --symbols-path
=$(DIST
)/crashreporter-symbols
54 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] mochitest*|.
55 MOCHITESTS
:= mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins
56 mochitest
:: $(MOCHITESTS
)
60 $(PYTHON
) _tests
/testing
/mochitest
/runtests.py
--autorun
--close-when-done \
61 --console-level
=INFO
--log-file
=.
/$@.log
--file-level
=INFO \
62 $(SYMBOLS_PATH
) $(TEST_PATH_ARG
) $(EXTRA_TEST_ARGS
)
64 ifndef NO_FAIL_ON_TEST_ERRORS
65 define CHECK_TEST_ERROR
66 @errors
=`grep "TEST-UNEXPECTED-" $@.log` ;\
67 if
test "$$errors" ; then \
81 # Allow mochitest-1 ... mochitest-5 for developer ease
82 mochitest-1 mochitest-2 mochitest-3 mochitest-4 mochitest-5
: mochitest-
%:
83 echo
"mochitest: $* / 5"
84 $(RUN_MOCHITEST
) --chunk-by-dir
=4 --total-chunks
=5 --this-chunk
=$*
88 $(RUN_MOCHITEST
) --chrome
92 $(RUN_MOCHITEST
) --a11y
96 ifeq (Darwin
,$(OS_ARCH
))
97 ifeq (i386
,$(TARGET_CPU
))
98 $(RUN_MOCHITEST
) --setpref
=dom.ipc.plugins.enabled.i386.
test.plugin
=true
--test-path
=modules
/plugin
/test
100 ifeq (x86_64
,$(TARGET_CPU
))
101 $(RUN_MOCHITEST
) --setpref
=dom.ipc.plugins.enabled.x86_64.
test.plugin
=true
--test-path
=modules
/plugin
/test
103 ifeq (powerpc
,$(TARGET_CPU
))
104 $(RUN_MOCHITEST
) --setpref
=dom.ipc.plugins.enabled.ppc.
test.plugin
=true
--test-path
=modules
/plugin
/test
107 $(RUN_MOCHITEST
) --setpref
=dom.ipc.plugins.enabled
=true
--test-path
=modules
/plugin
/test
111 # Usage: |make [EXTRA_TEST_ARGS=...] *test|.
112 RUN_REFTEST
= rm -f .
/$@.log
&& $(PYTHON
) _tests
/reftest
/runreftest.py \
113 $(SYMBOLS_PATH
) $(EXTRA_TEST_ARGS
) $(1) | tee .
/$@.log
115 ifeq ($(OS_ARCH
),WINNT
) #{
116 # GPU-rendered shadow layers are unsupported here
117 OOP_CONTENT
= --setpref
=browser.tabs.remote
=true
--setpref
=layers.acceleration.disabled
=true
120 OOP_CONTENT
= --setpref
=browser.tabs.remote
=true
121 GPU_RENDERING
= --setpref
=layers.acceleration.force-enabled
=true
124 reftest
: TEST_PATH?
=layout
/reftests
/reftest.list
126 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
))
129 reftest-ipc
: TEST_PATH?
=layout
/reftests
/reftest.list
131 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
) $(OOP_CONTENT
))
134 reftest-ipc-gpu
: TEST_PATH?
=layout
/reftests
/reftest.list
136 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
) $(OOP_CONTENT
) $(GPU_RENDERING
))
139 crashtest
: TEST_PATH?
=testing
/crashtest
/crashtests.list
141 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
))
144 crashtest-ipc
: TEST_PATH?
=testing
/crashtest
/crashtests.list
146 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
) $(OOP_CONTENT
))
149 crashtest-ipc-gpu
: TEST_PATH?
=testing
/crashtest
/crashtests.list
151 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
) $(OOP_CONTENT
) $(GPU_RENDERING
))
154 jstestbrowser
: TEST_PATH?
=js
/src
/tests
/jstests.list
156 $(call RUN_REFTEST
,$(topsrcdir
)/$(TEST_PATH
) --extra-profile-file
=$(topsrcdir
)/js
/src
/tests
/user.js
)
159 GARBAGE
+= $(addsuffix .log
,$(MOCHITESTS
) reftest crashtest jstestbrowser
)
161 # Execute all xpcshell tests in the directories listed in the manifest.
162 # See also config/rules.mk 'xpcshell-tests' target for local execution.
163 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] xpcshell-tests|.
165 $(PYTHON
) -u
$(topsrcdir
)/config
/pythonpath.py \
166 -I
$(topsrcdir
)/build \
167 $(topsrcdir
)/testing
/xpcshell
/runxpcshelltests.py \
168 --manifest
=$(DEPTH
)/_tests
/xpcshell
/all-test-dirs.list \
171 $(TEST_PATH_ARG
) $(EXTRA_TEST_ARGS
) \
174 # install and run the mozmill tests
175 $(DEPTH
)/_tests
/mozmill
:
176 $(MAKE
) -C
$(DEPTH
)/testing
/mozmill install-develop PKG_STAGE
=..
/..
/_tests
177 $(PYTHON
) $(topsrcdir
)/testing
/mozmill
/installmozmill.py
--develop
$(DEPTH
)/_tests
/mozmill
179 MOZMILL_TEST_PATH
= $(DEPTH
)/_tests
/mozmill
/tests
/firefox
180 mozmill
: TEST_PATH?
=$(MOZMILL_TEST_PATH
)
181 mozmill
: $(DEPTH
)/_tests
/mozmill
182 $(SHELL
) $(DEPTH
)/_tests
/mozmill
/mozmill.sh
-t
$(TEST_PATH
) -b
$(browser_path
) --show-all
184 MOZMILL_RESTART_TEST_PATH
= $(DEPTH
)/_tests
/mozmill
/tests
/firefox
/restartTests
185 mozmill-restart
: TEST_PATH?
=$(MOZMILL_RESTART_TEST_PATH
)
186 mozmill-restart
: $(DEPTH
)/_tests
/mozmill
187 $(SHELL
) $(DEPTH
)/_tests
/mozmill
/mozmill-restart.sh
-t
$(TEST_PATH
) -b
$(browser_path
) --show-all
189 # in order to have `mozmill-all` ignore TEST_PATH, if it is set, we shell out to call make
190 # again, verbosely overriding the TEST_PATH
191 # This isn't as neat as having mozmill and mozmill-restart be dependencies, but it
192 # seems to be the make idiom
194 $(MAKE
) mozmill TEST_PATH
=$(MOZMILL_TEST_PATH
)
195 $(MAKE
) mozmill-restart TEST_PATH
=$(MOZMILL_RESTART_TEST_PATH
)
197 # Package up the tests and test harnesses
198 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
200 ifndef UNIVERSAL_BINARY
201 PKG_STAGE
= $(DIST
)/test-package-stage
202 package-tests
: stage-mochitest stage-reftest stage-xpcshell stage-jstests stage-mozmill stage-jetpack
204 # This staging area has been built for us by universal/flight.mk
205 PKG_STAGE
= $(DIST
)/universal
/test-package-stage
209 @
rm -f
"$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)"
210 ifndef UNIVERSAL_BINARY
211 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
213 #building tests.jar (bug 543800) fails on unify, so we build tests.jar after unify is run
214 $(MAKE
) -C
$(DEPTH
)/testing
/mochitest stage-chromejar PKG_STAGE
=$(DIST
)/universal
217 zip
-r9D
"$(call core_abspath,$(DIST)/$(PKG_PATH)$(TEST_PACKAGE))" *
219 ifeq (Android
, $(OS_TARGET
))
220 package-tests
: stage-android
224 rm -rf
$(PKG_STAGE
) && $(NSINSTALL
) -D
$(PKG_STAGE
) && $(NSINSTALL
) -D
$(PKG_STAGE
)/bin
&& $(NSINSTALL
) -D
$(PKG_STAGE
)/bin
/components
&& $(NSINSTALL
) -D
$(PKG_STAGE
)/certs
&& $(NSINSTALL
) -D
$(PKG_STAGE
)/jetpack
226 stage-mochitest
: make-stage-dir
227 $(MAKE
) -C
$(DEPTH
)/testing
/mochitest stage-package
229 stage-reftest
: make-stage-dir
230 $(MAKE
) -C
$(DEPTH
)/layout
/tools
/reftest stage-package
232 stage-xpcshell
: make-stage-dir
233 $(MAKE
) -C
$(DEPTH
)/testing
/xpcshell stage-package
235 stage-jstests
: make-stage-dir
236 $(MAKE
) -C
$(DEPTH
)/js
/src
/tests stage-package
238 stage-mozmill
: make-stage-dir
239 $(MAKE
) -C
$(DEPTH
)/testing
/mozmill stage-package
241 stage-android
: make-stage-dir
242 $(NSINSTALL
) $(DEPTH
)/build
/mobile
/sutagent
/android
/sutAgentAndroid.apk
$(PKG_STAGE
)/bin
244 stage-jetpack
: make-stage-dir
245 $(NSINSTALL
) $(topsrcdir
)/testing
/jetpack
/jetpack-location.txt
$(PKG_STAGE
)/jetpack
247 mochitest mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins \
251 package-tests make-stage-dir stage-mochitest stage-reftest stage-xpcshell stage-jstests stage-mozmill stage-android stage-jetpack