Bug 578272: Remove Algol-like display optimization. (r=brendan)
[mozilla-central.git] / testing / testsuite-targets.mk
blob97048d38d265dce1bb812983917a06766c2b3895
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 MOCHITESTS := mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins
52 mochitest:: $(MOCHITESTS)
54 RUN_MOCHITEST = \
55 rm -f ./$@.log && \
56 $(PYTHON) _tests/testing/mochitest/runtests.py --autorun --close-when-done \
57 --console-level=INFO --log-file=./$@.log --file-level=INFO \
58 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
60 ifndef NO_FAIL_ON_TEST_ERRORS
61 define CHECK_TEST_ERROR
62 @errors=`grep "TEST-UNEXPECTED-" $@.log` ;\
63 if test "$$errors" ; then \
64 echo "$@ failed:"; \
65 echo "$$errors"; \
66 exit 1; \
67 else \
68 echo "$@ passed"; \
70 endef
71 endif
73 mochitest-plain:
74 $(RUN_MOCHITEST)
75 $(CHECK_TEST_ERROR)
77 mochitest-chrome:
78 $(RUN_MOCHITEST) --chrome
79 $(CHECK_TEST_ERROR)
81 mochitest-a11y:
82 $(RUN_MOCHITEST) --a11y
83 $(CHECK_TEST_ERROR)
85 mochitest-ipcplugins:
86 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled=true --test-path=modules/plugin/test
87 $(CHECK_TEST_ERROR)
89 # Usage: |make [EXTRA_TEST_ARGS=...] *test|.
90 RUN_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftest.py \
91 $(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) $(1) | tee ./$@.log
93 reftest: TEST_PATH=layout/reftests/reftest.list
94 reftest:
95 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
96 $(CHECK_TEST_ERROR)
98 crashtest: TEST_PATH=testing/crashtest/crashtests.list
99 crashtest:
100 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
101 $(CHECK_TEST_ERROR)
103 jstestbrowser: TEST_PATH=js/src/tests/jstests.list
104 jstestbrowser:
105 $(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) --extra-profile-file=$(topsrcdir)/js/src/tests/user.js)
106 $(CHECK_TEST_ERROR)
108 GARBAGE += $(addsuffix .log,$(MOCHITESTS) reftest crashtest jstestbrowser)
110 # Execute all xpcshell tests in the directories listed in the manifest.
111 # See also config/rules.mk 'xpcshell-tests' target for local execution.
112 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] xpcshell-tests|.
113 xpcshell-tests:
114 $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
115 -I$(topsrcdir)/build \
116 $(topsrcdir)/testing/xpcshell/runxpcshelltests.py \
117 --manifest=$(DEPTH)/_tests/xpcshell/all-test-dirs.list \
118 --no-logfiles \
119 $(SYMBOLS_PATH) \
120 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
121 $(DIST)/bin/xpcshell
123 # Package up the tests and test harnesses
124 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
126 ifndef UNIVERSAL_BINARY
127 PKG_STAGE = $(DIST)/test-package-stage
128 package-tests: stage-mochitest stage-reftest stage-xpcshell stage-jstests stage-mozmill
129 else
130 # This staging area has been built for us by universal/flight.mk
131 PKG_STAGE = $(DIST)/universal/test-package-stage
132 endif
134 package-tests:
135 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
136 @rm -f "$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)"
137 cd $(PKG_STAGE) && \
138 zip -r9D "$(call core_abspath,$(DIST)/$(PKG_PATH)$(TEST_PACKAGE))" *
140 ifeq (Android, $(OS_TARGET))
141 package-tests: stage-android
142 endif
144 make-stage-dir:
145 rm -rf $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE)/bin && $(NSINSTALL) -D $(PKG_STAGE)/bin/components && $(NSINSTALL) -D $(PKG_STAGE)/certs
147 stage-mochitest: make-stage-dir
148 $(MAKE) -C $(DEPTH)/testing/mochitest stage-package
150 stage-reftest: make-stage-dir
151 $(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
153 stage-xpcshell: make-stage-dir
154 $(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
156 stage-jstests: make-stage-dir
157 $(MAKE) -C $(DEPTH)/js/src/tests stage-package
159 stage-mozmill: make-stage-dir
160 $(MAKE) -C $(DEPTH)/testing/mozmill stage-package
162 stage-android: make-stage-dir
163 $(NSINSTALL) $(DEPTH)/build/mobile/sutagent/android/sutAgentAndroid.apk $(PKG_STAGE)/bin
165 .PHONY: \
166 mochitest mochitest-plain mochitest-chrome mochitest-a11y mochitest-ipcplugins \
167 reftest crashtest \
168 xpcshell-tests \
169 jstestbrowser \
170 package-tests make-stage-dir stage-mochitest stage-reftest stage-xpcshell stage-jstests stage-mozmill stage-android