testing/testsuite-targets.mk

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4
michael@0 5
michael@0 6 # Shortcut for mochitest* and xpcshell-tests targets,
michael@0 7 # replaces 'EXTRA_TEST_ARGS=--test-path=...'.
michael@0 8 ifdef TEST_PATH
michael@0 9 TEST_PATH_ARG := --test-path='$(TEST_PATH)'
michael@0 10 IPCPLUGINS_PATH_ARG := --test-path='$(TEST_PATH)'
michael@0 11 else
michael@0 12 TEST_PATH_ARG :=
michael@0 13 IPCPLUGINS_PATH_ARG := --test-path=dom/plugins/test
michael@0 14 endif
michael@0 15
michael@0 16 # include automation-build.mk to get the path to the binary
michael@0 17 TARGET_DEPTH = $(DEPTH)
michael@0 18 include $(topsrcdir)/build/binary-location.mk
michael@0 19
michael@0 20 SYMBOLS_PATH := --symbols-path=$(DIST)/crashreporter-symbols
michael@0 21
michael@0 22 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] mochitest*|.
michael@0 23 MOCHITESTS := mochitest-plain mochitest-chrome mochitest-devtools mochitest-a11y mochitest-ipcplugins
michael@0 24 mochitest:: $(MOCHITESTS)
michael@0 25
michael@0 26 ifndef TEST_PACKAGE_NAME
michael@0 27 TEST_PACKAGE_NAME := $(ANDROID_PACKAGE_NAME)
michael@0 28 endif
michael@0 29
michael@0 30 RUN_MOCHITEST_B2G_DESKTOP = \
michael@0 31 rm -f ./$@.log && \
michael@0 32 $(PYTHON) _tests/testing/mochitest/runtestsb2g.py --autorun --close-when-done \
michael@0 33 --console-level=INFO --log-file=./$@.log --file-level=INFO \
michael@0 34 --desktop --profile ${GAIA_PROFILE_DIR} \
michael@0 35 --failure-file=$(abspath _tests/testing/mochitest/makefailures.json) \
michael@0 36 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 37
michael@0 38 RUN_MOCHITEST = \
michael@0 39 rm -f ./$@.log && \
michael@0 40 $(PYTHON) _tests/testing/mochitest/runtests.py --autorun --close-when-done \
michael@0 41 --console-level=INFO --log-file=./$@.log --file-level=INFO \
michael@0 42 --failure-file=$(abspath _tests/testing/mochitest/makefailures.json) \
michael@0 43 --testing-modules-dir=$(abspath _tests/modules) \
michael@0 44 --extra-profile-file=$(DIST)/plugins \
michael@0 45 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 46
michael@0 47 RERUN_MOCHITEST = \
michael@0 48 rm -f ./$@.log && \
michael@0 49 $(PYTHON) _tests/testing/mochitest/runtests.py --autorun --close-when-done \
michael@0 50 --console-level=INFO --log-file=./$@.log --file-level=INFO \
michael@0 51 --run-only-tests=makefailures.json \
michael@0 52 --testing-modules-dir=$(abspath _tests/modules) \
michael@0 53 --extra-profile-file=$(DIST)/plugins \
michael@0 54 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 55
michael@0 56 RUN_MOCHITEST_REMOTE = \
michael@0 57 rm -f ./$@.log && \
michael@0 58 $(PYTHON) _tests/testing/mochitest/runtestsremote.py --autorun --close-when-done \
michael@0 59 --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
michael@0 60 --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
michael@0 61 --testing-modules-dir=$(abspath _tests/modules) \
michael@0 62 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 63
michael@0 64 RUN_MOCHITEST_ROBOCOP = \
michael@0 65 rm -f ./$@.log && \
michael@0 66 $(PYTHON) _tests/testing/mochitest/runtestsremote.py \
michael@0 67 --robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug.apk \
michael@0 68 --robocop-ids=$(DEPTH)/mobile/android/base/fennec_ids.txt \
michael@0 69 --robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
michael@0 70 --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
michael@0 71 --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
michael@0 72 $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 73
michael@0 74 ifndef NO_FAIL_ON_TEST_ERRORS
michael@0 75 define check_test_error_internal
michael@0 76 @errors=`grep 'TEST-UNEXPECTED-' $@.log` ;\
michael@0 77 if test "$$errors" ; then \
michael@0 78 echo '$@ failed:'; \
michael@0 79 echo "$$errors"; \
michael@0 80 $(if $(1),echo $(1);) \
michael@0 81 exit 1; \
michael@0 82 fi
michael@0 83 endef
michael@0 84 CHECK_TEST_ERROR = $(call check_test_error_internal)
michael@0 85 CHECK_TEST_ERROR_RERUN = $(call check_test_error_internal,'To rerun your failures please run "make $@-rerun-failures"')
michael@0 86 endif
michael@0 87
michael@0 88 mochitest-remote: DM_TRANS?=adb
michael@0 89 mochitest-remote:
michael@0 90 @if [ '${MOZ_HOST_BIN}' = '' ]; then \
michael@0 91 echo 'environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell'; \
michael@0 92 elif [ ! -d ${MOZ_HOST_BIN} ]; then \
michael@0 93 echo 'MOZ_HOST_BIN does not specify a directory'; \
michael@0 94 elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
michael@0 95 echo 'xpcshell not found in MOZ_HOST_BIN'; \
michael@0 96 elif [ '${TEST_DEVICE}' = '' -a '$(DM_TRANS)' != 'adb' ]; then \
michael@0 97 echo 'please prepare your host with the environment variable TEST_DEVICE'; \
michael@0 98 else \
michael@0 99 $(RUN_MOCHITEST_REMOTE); \
michael@0 100 fi
michael@0 101
michael@0 102 mochitest-robotium: mochitest-robocop
michael@0 103 @echo 'mochitest-robotium is deprecated -- please use mochitest-robocop'
michael@0 104
michael@0 105 mochitest-robocop: DM_TRANS?=adb
michael@0 106 mochitest-robocop:
michael@0 107 @if [ '${MOZ_HOST_BIN}' = '' ]; then \
michael@0 108 echo 'environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell'; \
michael@0 109 elif [ ! -d ${MOZ_HOST_BIN} ]; then \
michael@0 110 echo 'MOZ_HOST_BIN does not specify a directory'; \
michael@0 111 elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
michael@0 112 echo 'xpcshell not found in MOZ_HOST_BIN'; \
michael@0 113 elif [ '${TEST_DEVICE}' = '' -a '$(DM_TRANS)' != 'adb' ]; then \
michael@0 114 echo 'please prepare your host with the environment variable TEST_DEVICE'; \
michael@0 115 else \
michael@0 116 $(RUN_MOCHITEST_ROBOCOP); \
michael@0 117 fi
michael@0 118
michael@0 119 ifdef MOZ_B2G
michael@0 120 mochitest-plain:
michael@0 121 @if [ '${GAIA_PROFILE_DIR}' = '' ]; then \
michael@0 122 echo 'please specify the GAIA_PROFILE_DIR env variable'; \
michael@0 123 else \
michael@0 124 $(RUN_MOCHITEST_B2G_DESKTOP); \
michael@0 125 $(CHECK_TEST_ERROR_RERUN); \
michael@0 126 fi
michael@0 127 else
michael@0 128 mochitest-plain:
michael@0 129 $(RUN_MOCHITEST)
michael@0 130 $(CHECK_TEST_ERROR_RERUN)
michael@0 131 endif
michael@0 132
michael@0 133 mochitest-plain-rerun-failures:
michael@0 134 $(RERUN_MOCHITEST)
michael@0 135 $(CHECK_TEST_ERROR_RERUN)
michael@0 136
michael@0 137 # Allow mochitest-1 ... mochitest-5 for developer ease
michael@0 138 mochitest-1 mochitest-2 mochitest-3 mochitest-4 mochitest-5: mochitest-%:
michael@0 139 echo 'mochitest: $* / 5'
michael@0 140 $(RUN_MOCHITEST) --chunk-by-dir=4 --total-chunks=5 --this-chunk=$*
michael@0 141 $(CHECK_TEST_ERROR)
michael@0 142
michael@0 143 mochitest-chrome:
michael@0 144 $(RUN_MOCHITEST) --chrome
michael@0 145 $(CHECK_TEST_ERROR)
michael@0 146
michael@0 147 mochitest-devtools:
michael@0 148 $(RUN_MOCHITEST) --subsuite=devtools
michael@0 149 $(CHECK_TEST_ERROR)
michael@0 150
michael@0 151 mochitest-a11y:
michael@0 152 $(RUN_MOCHITEST) --a11y
michael@0 153 $(CHECK_TEST_ERROR)
michael@0 154
michael@0 155 mochitest-ipcplugins:
michael@0 156 ifeq (Darwin,$(OS_ARCH))
michael@0 157 ifeq (i386,$(TARGET_CPU))
michael@0 158 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled.i386.test.plugin=false $(IPCPLUGINS_PATH_ARG)
michael@0 159 endif
michael@0 160 ifeq (x86_64,$(TARGET_CPU))
michael@0 161 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled.x86_64.test.plugin=false $(IPCPLUGINS_PATH_ARG)
michael@0 162 endif
michael@0 163 ifeq (powerpc,$(TARGET_CPU))
michael@0 164 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled.ppc.test.plugin=false $(IPCPLUGINS_PATH_ARG)
michael@0 165 endif
michael@0 166 else
michael@0 167 $(RUN_MOCHITEST) --setpref=dom.ipc.plugins.enabled=false --test-path=dom/plugins/test
michael@0 168 endif
michael@0 169 $(CHECK_TEST_ERROR)
michael@0 170
michael@0 171 ifeq ($(OS_ARCH),Darwin)
michael@0 172 webapprt_stub_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/webapprt-stub$(BIN_SUFFIX)
michael@0 173 endif
michael@0 174 ifeq ($(OS_ARCH),WINNT)
michael@0 175 webapprt_stub_path = $(TARGET_DIST)/bin/webapprt-stub$(BIN_SUFFIX)
michael@0 176 endif
michael@0 177 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
michael@0 178 webapprt_stub_path = $(TARGET_DIST)/bin/webapprt-stub$(BIN_SUFFIX)
michael@0 179 endif
michael@0 180
michael@0 181 ifdef webapprt_stub_path
michael@0 182 webapprt-test-content:
michael@0 183 $(RUN_MOCHITEST) --webapprt-content --appname $(webapprt_stub_path)
michael@0 184 $(CHECK_TEST_ERROR)
michael@0 185 webapprt-test-chrome:
michael@0 186 $(RUN_MOCHITEST) --webapprt-chrome --appname $(webapprt_stub_path) --browser-arg -test-mode
michael@0 187 $(CHECK_TEST_ERROR)
michael@0 188 endif
michael@0 189
michael@0 190 # Usage: |make [EXTRA_TEST_ARGS=...] *test|.
michael@0 191 RUN_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftest.py \
michael@0 192 --extra-profile-file=$(DIST)/plugins \
michael@0 193 $(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) $(1) | tee ./$@.log
michael@0 194
michael@0 195 REMOTE_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/remotereftest.py \
michael@0 196 --dm_trans=$(DM_TRANS) --ignore-window-size \
michael@0 197 --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
michael@0 198 --httpd-path=_tests/reftest/reftest/components \
michael@0 199 $(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) '$(1)' | tee ./$@.log
michael@0 200
michael@0 201 RUN_REFTEST_B2G = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftestb2g.py \
michael@0 202 --remote-webserver=10.0.2.2 --b2gpath=${B2G_PATH} --adbpath=${ADB_PATH} \
michael@0 203 --xre-path=${MOZ_HOST_BIN} $(SYMBOLS_PATH) --ignore-window-size \
michael@0 204 --httpd-path=_tests/reftest/reftest/components \
michael@0 205 $(EXTRA_TEST_ARGS) '$(1)' | tee ./$@.log
michael@0 206
michael@0 207 ifeq ($(OS_ARCH),WINNT) #{
michael@0 208 # GPU-rendered shadow layers are unsupported here
michael@0 209 OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.disabled=true
michael@0 210 GPU_RENDERING =
michael@0 211 else
michael@0 212 OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true
michael@0 213 GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
michael@0 214 endif #}
michael@0 215
michael@0 216 reftest: TEST_PATH?=layout/reftests/reftest.list
michael@0 217 reftest:
michael@0 218 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)')
michael@0 219 $(CHECK_TEST_ERROR)
michael@0 220
michael@0 221 reftest-remote: TEST_PATH?=layout/reftests/reftest.list
michael@0 222 reftest-remote: DM_TRANS?=adb
michael@0 223 reftest-remote:
michael@0 224 @if [ '${MOZ_HOST_BIN}' = '' ]; then \
michael@0 225 echo 'environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell'; \
michael@0 226 elif [ ! -d ${MOZ_HOST_BIN} ]; then \
michael@0 227 echo 'MOZ_HOST_BIN does not specify a directory'; \
michael@0 228 elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
michael@0 229 echo 'xpcshell not found in MOZ_HOST_BIN'; \
michael@0 230 elif [ '${TEST_DEVICE}' = '' -a '$(DM_TRANS)' != 'adb' ]; then \
michael@0 231 echo 'please prepare your host with the environment variable TEST_DEVICE'; \
michael@0 232 else \
michael@0 233 ln -s $(abspath $(topsrcdir)) _tests/reftest/tests; \
michael@0 234 $(call REMOTE_REFTEST,tests/$(TEST_PATH)); \
michael@0 235 $(CHECK_TEST_ERROR); \
michael@0 236 fi
michael@0 237
michael@0 238 reftest-b2g: TEST_PATH?=layout/reftests/reftest.list
michael@0 239 reftest-b2g:
michael@0 240 @if [ '${MOZ_HOST_BIN}' = '' ]; then \
michael@0 241 echo 'environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell'; \
michael@0 242 elif [ ! -d ${MOZ_HOST_BIN} ]; then \
michael@0 243 echo 'MOZ_HOST_BIN does not specify a directory'; \
michael@0 244 elif [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
michael@0 245 echo 'xpcshell not found in MOZ_HOST_BIN'; \
michael@0 246 elif [ '${B2G_PATH}' = '' -o '${ADB_PATH}' = '' ]; then \
michael@0 247 echo 'please set the B2G_PATH and ADB_PATH environment variables'; \
michael@0 248 else \
michael@0 249 ln -s $(abspath $(topsrcdir)) _tests/reftest/tests; \
michael@0 250 if [ '${REFTEST_PATH}' != '' ]; then \
michael@0 251 $(call RUN_REFTEST_B2G,tests/${REFTEST_PATH}); \
michael@0 252 else \
michael@0 253 $(call RUN_REFTEST_B2G,tests/$(TEST_PATH)); \
michael@0 254 fi; \
michael@0 255 $(CHECK_TEST_ERROR); \
michael@0 256 fi
michael@0 257
michael@0 258 reftest-ipc: TEST_PATH?=layout/reftests/reftest.list
michael@0 259 reftest-ipc:
michael@0 260 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)' $(OOP_CONTENT))
michael@0 261 $(CHECK_TEST_ERROR)
michael@0 262
michael@0 263 reftest-ipc-gpu: TEST_PATH?=layout/reftests/reftest.list
michael@0 264 reftest-ipc-gpu:
michael@0 265 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)' $(OOP_CONTENT) $(GPU_RENDERING))
michael@0 266 $(CHECK_TEST_ERROR)
michael@0 267
michael@0 268 crashtest: TEST_PATH?=testing/crashtest/crashtests.list
michael@0 269 crashtest:
michael@0 270 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)')
michael@0 271 $(CHECK_TEST_ERROR)
michael@0 272
michael@0 273 crashtest-ipc: TEST_PATH?=testing/crashtest/crashtests.list
michael@0 274 crashtest-ipc:
michael@0 275 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)' $(OOP_CONTENT))
michael@0 276 $(CHECK_TEST_ERROR)
michael@0 277
michael@0 278 crashtest-ipc-gpu: TEST_PATH?=testing/crashtest/crashtests.list
michael@0 279 crashtest-ipc-gpu:
michael@0 280 $(call RUN_REFTEST,'$(topsrcdir)/$(TEST_PATH)' $(OOP_CONTENT) $(GPU_RENDERING))
michael@0 281 $(CHECK_TEST_ERROR)
michael@0 282
michael@0 283 jstestbrowser: TESTS_PATH?=test-package-stage/jsreftest/tests/
michael@0 284 jstestbrowser:
michael@0 285 $(MAKE) -C $(DEPTH)/config
michael@0 286 $(MAKE) stage-jstests
michael@0 287 $(call RUN_REFTEST,'$(DIST)/$(TESTS_PATH)/jstests.list' --extra-profile-file=$(DIST)/test-package-stage/jsreftest/tests/user.js)
michael@0 288 $(CHECK_TEST_ERROR)
michael@0 289
michael@0 290 GARBAGE += $(addsuffix .log,$(MOCHITESTS) reftest crashtest jstestbrowser)
michael@0 291
michael@0 292 # Execute all xpcshell tests in the directories listed in the manifest.
michael@0 293 # See also config/rules.mk 'xpcshell-tests' target for local execution.
michael@0 294 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] xpcshell-tests|.
michael@0 295 xpcshell-tests:
michael@0 296 $(info Have you considered running xpcshell tests via |mach xpcshell-test|? mach is easier to use and has more features than make and it will eventually be the only way to run xpcshell tests. Please consider using mach today!)
michael@0 297 $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
michael@0 298 -I$(DEPTH)/build \
michael@0 299 -I$(topsrcdir)/build \
michael@0 300 -I$(DEPTH)/_tests/mozbase/mozinfo \
michael@0 301 $(topsrcdir)/testing/xpcshell/runxpcshelltests.py \
michael@0 302 --manifest=$(DEPTH)/_tests/xpcshell/xpcshell.ini \
michael@0 303 --build-info-json=$(DEPTH)/mozinfo.json \
michael@0 304 --no-logfiles \
michael@0 305 --test-plugin-path='$(DIST)/plugins' \
michael@0 306 --tests-root-dir=$(abspath _tests/xpcshell) \
michael@0 307 --testing-modules-dir=$(abspath _tests/modules) \
michael@0 308 --xunit-file=$(abspath _tests/xpcshell/results.xml) \
michael@0 309 --xunit-suite-name=xpcshell \
michael@0 310 $(SYMBOLS_PATH) \
michael@0 311 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
michael@0 312 $(LIBXUL_DIST)/bin/xpcshell
michael@0 313
michael@0 314 B2G_XPCSHELL = \
michael@0 315 rm -f ./@.log && \
michael@0 316 $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
michael@0 317 -I$(DEPTH)/build \
michael@0 318 -I$(topsrcdir)/build \
michael@0 319 $(topsrcdir)/testing/xpcshell/runtestsb2g.py \
michael@0 320 --manifest=$(DEPTH)/_tests/xpcshell/xpcshell.ini \
michael@0 321 --build-info-json=$(DEPTH)/mozinfo.json \
michael@0 322 --no-logfiles \
michael@0 323 --use-device-libs \
michael@0 324 --no-clean \
michael@0 325 --objdir=$(DEPTH) \
michael@0 326 $$EXTRA_XPCSHELL_ARGS \
michael@0 327 --b2gpath=${B2G_HOME} \
michael@0 328 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
michael@0 329
michael@0 330 xpcshell-tests-b2g: ADB_PATH?=$(shell which adb)
michael@0 331 xpcshell-tests-b2g:
michael@0 332 @if [ '${B2G_HOME}' = '' ]; then \
michael@0 333 echo 'Please set the B2G_HOME variable'; exit 1; \
michael@0 334 elif [ ! -f '${ADB_PATH}' ]; then \
michael@0 335 echo 'Please set the ADB_PATH variable'; exit 1; \
michael@0 336 elif [ '${EMULATOR}' != '' ]; then \
michael@0 337 EXTRA_XPCSHELL_ARGS=--emulator=${EMULATOR}; \
michael@0 338 $(call B2G_XPCSHELL); \
michael@0 339 exit 0; \
michael@0 340 else \
michael@0 341 EXTRA_XPCSHELL_ARGS=--address=localhost:2828; \
michael@0 342 $(call B2G_XPCSHELL); \
michael@0 343 exit 0; \
michael@0 344 fi
michael@0 345
michael@0 346 xpcshell-tests-remote: DM_TRANS?=adb
michael@0 347 xpcshell-tests-remote:
michael@0 348 @if [ '${TEST_DEVICE}' != '' -o '$(DM_TRANS)' = 'adb' ]; \
michael@0 349 then $(PYTHON) -u $(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
michael@0 350 --manifest=$(DEPTH)/_tests/xpcshell/xpcshell_android.ini \
michael@0 351 --build-info-json=$(DEPTH)/mozinfo.json \
michael@0 352 --no-logfiles \
michael@0 353 --testing-modules-dir=$(abspath _tests/modules) \
michael@0 354 --dm_trans=$(DM_TRANS) \
michael@0 355 --deviceIP=${TEST_DEVICE} \
michael@0 356 --objdir=$(DEPTH) \
michael@0 357 $(SYMBOLS_PATH) \
michael@0 358 $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS); \
michael@0 359 $(CHECK_TEST_ERROR); \
michael@0 360 else \
michael@0 361 echo 'please prepare your host with environment variables for TEST_DEVICE'; \
michael@0 362 fi
michael@0 363
michael@0 364 REMOTE_CPPUNITTESTS = \
michael@0 365 $(PYTHON) -u $(topsrcdir)/testing/remotecppunittests.py \
michael@0 366 --xre-path=$(DEPTH)/dist/bin \
michael@0 367 --localLib=$(DEPTH)/dist/fennec \
michael@0 368 --dm_trans=$(DM_TRANS) \
michael@0 369 --deviceIP=${TEST_DEVICE} \
michael@0 370 $(TEST_PATH) $(EXTRA_TEST_ARGS)
michael@0 371
michael@0 372 # Usage: |make [TEST_PATH=...] [EXTRA_TEST_ARGS=...] cppunittests-remote|.
michael@0 373 cppunittests-remote: DM_TRANS?=adb
michael@0 374 cppunittests-remote:
michael@0 375 @if [ '${TEST_DEVICE}' != '' -o '$(DM_TRANS)' = 'adb' ]; \
michael@0 376 then $(call REMOTE_CPPUNITTESTS); \
michael@0 377 else \
michael@0 378 echo 'please prepare your host with environment variables for TEST_DEVICE'; \
michael@0 379 fi
michael@0 380
michael@0 381 jetpack-tests:
michael@0 382 $(PYTHON) $(topsrcdir)/addon-sdk/source/bin/cfx -b $(browser_path) --parseable testpkgs
michael@0 383
michael@0 384 # -- -register
michael@0 385 # -- --trace-malloc malloc.log --shutdown-leaks=sdleak.log
michael@0 386 leaktest:
michael@0 387 $(PYTHON) _leaktest/leaktest.py $(LEAKTEST_ARGS)
michael@0 388
michael@0 389 pgo-profile-run:
michael@0 390 $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py $(EXTRA_TEST_ARGS)
michael@0 391
michael@0 392 # Package up the tests and test harnesses
michael@0 393 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
michael@0 394
michael@0 395 ifndef UNIVERSAL_BINARY
michael@0 396 PKG_STAGE = $(DIST)/test-package-stage
michael@0 397 package-tests: \
michael@0 398 stage-config \
michael@0 399 stage-mochitest \
michael@0 400 stage-reftest \
michael@0 401 stage-xpcshell \
michael@0 402 stage-jstests \
michael@0 403 stage-jetpack \
michael@0 404 stage-mozbase \
michael@0 405 stage-tps \
michael@0 406 stage-modules \
michael@0 407 stage-marionette \
michael@0 408 stage-cppunittests \
michael@0 409 stage-jittest \
michael@0 410 stage-steeplechase \
michael@0 411 $(NULL)
michael@0 412 else
michael@0 413 # This staging area has been built for us by universal/flight.mk
michael@0 414 PKG_STAGE = $(DIST)/universal/test-package-stage
michael@0 415 endif
michael@0 416
michael@0 417 package-tests:
michael@0 418 @rm -f '$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)'
michael@0 419 ifndef UNIVERSAL_BINARY
michael@0 420 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
michael@0 421 endif
michael@0 422 find $(PKG_STAGE) -name '*.pyc' -exec rm {} \;
michael@0 423 $(MKDIR) -p $(abspath $(DIST))/$(PKG_PATH) && \
michael@0 424 cd $(PKG_STAGE) && \
michael@0 425 zip -rq9D '$(abspath $(DIST))/$(PKG_PATH)$(TEST_PACKAGE)' \
michael@0 426 * -x \*/.mkdir.done
michael@0 427
michael@0 428 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
michael@0 429 package-tests: stage-android
michael@0 430 endif
michael@0 431
michael@0 432 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
michael@0 433 package-tests: stage-b2g
michael@0 434 endif
michael@0 435
michael@0 436 make-stage-dir:
michael@0 437 rm -rf $(PKG_STAGE)
michael@0 438 $(NSINSTALL) -D $(PKG_STAGE)
michael@0 439 $(NSINSTALL) -D $(PKG_STAGE)/bin
michael@0 440 $(NSINSTALL) -D $(PKG_STAGE)/bin/components
michael@0 441 $(NSINSTALL) -D $(PKG_STAGE)/certs
michael@0 442 $(NSINSTALL) -D $(PKG_STAGE)/config
michael@0 443 $(NSINSTALL) -D $(PKG_STAGE)/jetpack
michael@0 444 $(NSINSTALL) -D $(PKG_STAGE)/mozbase
michael@0 445 $(NSINSTALL) -D $(PKG_STAGE)/modules
michael@0 446
michael@0 447 stage-b2g: make-stage-dir
michael@0 448 $(NSINSTALL) $(topsrcdir)/b2g/test/b2g-unittest-requirements.txt $(PKG_STAGE)/b2g
michael@0 449
michael@0 450 stage-config: make-stage-dir
michael@0 451 $(NSINSTALL) -D $(PKG_STAGE)/config
michael@0 452 @(cd $(topsrcdir)/testing/config && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/config && tar -xf -)
michael@0 453
michael@0 454 stage-mochitest: make-stage-dir
michael@0 455 $(MAKE) -C $(DEPTH)/testing/mochitest stage-package
michael@0 456 ifeq ($(MOZ_BUILD_APP),mobile/android)
michael@0 457 $(NSINSTALL) $(DEPTH)/mobile/android/base/fennec_ids.txt $(PKG_STAGE)/mochitest
michael@0 458 endif
michael@0 459
michael@0 460 stage-reftest: make-stage-dir
michael@0 461 $(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
michael@0 462
michael@0 463 stage-xpcshell: make-stage-dir
michael@0 464 $(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
michael@0 465
michael@0 466 stage-jstests: make-stage-dir
michael@0 467 $(MAKE) -C $(DEPTH)/js/src/tests stage-package
michael@0 468
michael@0 469 stage-android: make-stage-dir
michael@0 470 ifdef MOZ_ENABLE_SZIP
michael@0 471 # Tinderbox scripts are not unzipping everything, so the file needs to be in a directory it unzips
michael@0 472 $(NSINSTALL) $(DIST)/host/bin/szip $(PKG_STAGE)/bin/host
michael@0 473 endif
michael@0 474 $(NSINSTALL) $(DEPTH)/build/mobile/sutagent/android/sutAgentAndroid.apk $(PKG_STAGE)/bin
michael@0 475 $(NSINSTALL) $(DEPTH)/build/mobile/sutagent/android/watcher/Watcher.apk $(PKG_STAGE)/bin
michael@0 476 $(NSINSTALL) $(DEPTH)/build/mobile/sutagent/android/fencp/FenCP.apk $(PKG_STAGE)/bin
michael@0 477 $(NSINSTALL) $(DEPTH)/build/mobile/sutagent/android/ffxcp/FfxCP.apk $(PKG_STAGE)/bin
michael@0 478
michael@0 479 stage-jetpack: make-stage-dir
michael@0 480 $(MAKE) -C $(DEPTH)/addon-sdk stage-tests-package
michael@0 481
michael@0 482 stage-tps: make-stage-dir
michael@0 483 $(NSINSTALL) -D $(PKG_STAGE)/tps/tests
michael@0 484 @(cd $(topsrcdir)/testing/tps && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/tps && tar -xf -)
michael@0 485 @(cd $(topsrcdir)/services/sync/tps && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/tps && tar -xf -)
michael@0 486 (cd $(topsrcdir)/services/sync/tests/tps && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/tps/tests && tar -xf -)
michael@0 487
michael@0 488 stage-modules: make-stage-dir
michael@0 489 $(NSINSTALL) -D $(PKG_STAGE)/modules
michael@0 490 cp -RL $(DEPTH)/_tests/modules $(PKG_STAGE)
michael@0 491
michael@0 492 CPP_UNIT_TEST_BINS=$(wildcard $(DIST)/cppunittests/*)
michael@0 493
michael@0 494 ifdef OBJCOPY
michael@0 495 ifndef PKG_SKIP_STRIP
michael@0 496 STRIP_CPP_TESTS := 1
michael@0 497 endif
michael@0 498 endif
michael@0 499
michael@0 500 stage-cppunittests: make-stage-dir
michael@0 501 $(NSINSTALL) -D $(PKG_STAGE)/cppunittests
michael@0 502 ifdef STRIP_CPP_TESTS
michael@0 503 $(foreach bin,$(CPP_UNIT_TEST_BINS),$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(bin) $(bin:$(DIST)/%=$(PKG_STAGE)/%);)
michael@0 504 else
michael@0 505 cp -RL $(DIST)/cppunittests $(PKG_STAGE)
michael@0 506 endif
michael@0 507 $(NSINSTALL) $(topsrcdir)/testing/runcppunittests.py $(PKG_STAGE)/cppunittests
michael@0 508 $(NSINSTALL) $(topsrcdir)/testing/remotecppunittests.py $(PKG_STAGE)/cppunittests
michael@0 509 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
michael@0 510 $(NSINSTALL) $(topsrcdir)/testing/android_cppunittest_manifest.txt $(PKG_STAGE)/cppunittests
michael@0 511 endif
michael@0 512 $(NSINSTALL) $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.js $(PKG_STAGE)/cppunittests
michael@0 513 $(NSINSTALL) $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.manifest $(PKG_STAGE)/cppunittests
michael@0 514 cp -RL $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittests
michael@0 515
michael@0 516 stage-jittest: make-stage-dir
michael@0 517 $(NSINSTALL) -D $(PKG_STAGE)/jit-test/tests
michael@0 518 cp -RL $(topsrcdir)/js/src/jsapi.h $(PKG_STAGE)/jit-test
michael@0 519 cp -RL $(topsrcdir)/js/src/jit-test $(PKG_STAGE)/jit-test/jit-test
michael@0 520 cp -RL $(topsrcdir)/js/src/tests/ecma_6 $(PKG_STAGE)/jit-test/tests/ecma_6
michael@0 521 cp -RL $(topsrcdir)/js/src/tests/js1_8_5 $(PKG_STAGE)/jit-test/tests/js1_8_5
michael@0 522 cp -RL $(topsrcdir)/js/src/tests/lib $(PKG_STAGE)/jit-test/tests/lib
michael@0 523
michael@0 524 stage-steeplechase: make-stage-dir
michael@0 525 $(NSINSTALL) -D $(PKG_STAGE)/steeplechase/
michael@0 526 cp -RL $(DEPTH)/_tests/steeplechase $(PKG_STAGE)/steeplechase/tests
michael@0 527 cp -RL $(DIST)/xpi-stage/specialpowers $(PKG_STAGE)/steeplechase
michael@0 528 cp -RL $(topsrcdir)/testing/profiles/prefs_general.js $(PKG_STAGE)/steeplechase
michael@0 529
michael@0 530 MARIONETTE_DIR=$(PKG_STAGE)/marionette
michael@0 531 stage-marionette: make-stage-dir
michael@0 532 $(NSINSTALL) -D $(MARIONETTE_DIR)/tests
michael@0 533 $(NSINSTALL) -D $(MARIONETTE_DIR)/transport
michael@0 534 @(cd $(topsrcdir)/testing/marionette/client && tar --exclude marionette/tests $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/ && tar -xf -)
michael@0 535 @(cd $(topsrcdir)/testing/marionette/transport && tar $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/transport && tar -xf -)
michael@0 536 $(PYTHON) $(topsrcdir)/testing/marionette/client/marionette/tests/print-manifest-dirs.py \
michael@0 537 $(topsrcdir) \
michael@0 538 $(topsrcdir)/testing/marionette/client/marionette/tests/unit-tests.ini \
michael@0 539 | (cd $(topsrcdir) && xargs tar $(TAR_CREATE_FLAGS) -) \
michael@0 540 | (cd $(MARIONETTE_DIR)/tests && tar -xf -)
michael@0 541
michael@0 542 stage-mozbase: make-stage-dir
michael@0 543 $(MAKE) -C $(DEPTH)/testing/mozbase stage-package
michael@0 544 .PHONY: \
michael@0 545 mochitest \
michael@0 546 mochitest-plain \
michael@0 547 mochitest-chrome \
michael@0 548 mochitest-devtools \
michael@0 549 mochitest-a11y \
michael@0 550 mochitest-ipcplugins \
michael@0 551 reftest \
michael@0 552 crashtest \
michael@0 553 xpcshell-tests \
michael@0 554 jstestbrowser \
michael@0 555 package-tests \
michael@0 556 make-stage-dir \
michael@0 557 stage-b2g \
michael@0 558 stage-config \
michael@0 559 stage-mochitest \
michael@0 560 stage-reftest \
michael@0 561 stage-xpcshell \
michael@0 562 stage-jstests \
michael@0 563 stage-android \
michael@0 564 stage-jetpack \
michael@0 565 stage-mozbase \
michael@0 566 stage-tps \
michael@0 567 stage-modules \
michael@0 568 stage-marionette \
michael@0 569 stage-steeplechase \
michael@0 570 $(NULL)
michael@0 571

mercurial