2012-05-16 22:46:28 +04:00
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
i f n d e f I N C L U D E D _ T E S T S _ X P C S H E L L _ M K #{
i f d e f X P C S H E L L _ T E S T S #{
i f n d e f r e l a t i v e s r c d i r
$( error Must define relativesrcdir when defining XPCSHELL_TESTS .)
e n d i f
d e f i n e _ I N S T A L L _ T E S T S
2012-07-25 18:26:41 +04:00
$( call install_cmd , $ ( filter -out %~,$ ( wildcard $ ( srcdir ) /$ ( dir ) /*) ) $ ( testxpcobjdir ) /$ ( relativesrcdir ) /$ ( dir ) )
2012-05-16 22:46:28 +04:00
e n d e f # do not remove the blank line!
SOLO_FILE ?= $( error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
testxpcsrcdir = $( topsrcdir) /testing/xpcshell
libs :: libs -xpcshell -tests
###########################################################################
libs-xpcshell-tests :
$( foreach dir,$( XPCSHELL_TESTS) ,$( _INSTALL_TESTS) )
i f n d e f N O _ X P C S H E L L _ M A N I F E S T _ C H E C K #{
2013-07-12 00:42:26 +04:00
$( call py_action,xpccheck,$( topsrcdir) $( addprefix $( MOZILLA_DIR) /$( relativesrcdir) /,$( XPCSHELL_TESTS) ) )
2012-05-16 22:46:28 +04:00
e n d i f #} NO_XPCSHELL_MANIFEST_CHECK
###########################################################################
# Execute all tests in the $(XPCSHELL_TESTS) directories.
# See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
xpcshell-tests :
2013-08-15 04:43:04 +04:00
$( info Please consider running xpcshell tests via | mach xpcshell-test| . mach is more powerful, easier to use, and will be the only supported way to run tests in the future. Consider switching to mach today!)
2012-05-16 22:46:28 +04:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
2012-12-20 12:43:19 +04:00
-I$( DEPTH) /build \
2012-05-16 22:46:28 +04:00
-I$( topsrcdir) /build \
-I$( DEPTH) /_tests/mozbase/mozinfo \
$( testxpcsrcdir) /runxpcshelltests.py \
--symbols-path= $( DIST) /crashreporter-symbols \
--build-info-json= $( DEPTH) /mozinfo.json \
--tests-root-dir= $( testxpcobjdir) \
--testing-modules-dir= $( DEPTH) /_tests/modules \
--xunit-file= $( testxpcobjdir) /$( relativesrcdir) /results.xml \
--xunit-suite-name= xpcshell \
2012-12-17 22:08:00 +04:00
--test-plugin-path= $( DIST) /plugins \
2012-05-16 22:46:28 +04:00
$( EXTRA_TEST_ARGS) \
$( LIBXUL_DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( relativesrcdir) /$( dir) )
xpcshell-tests-remote : DM_TRANS ?=adb
xpcshell-tests-remote :
2012-12-20 12:43:19 +04:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
-I$( DEPTH) /build \
$( topsrcdir) /testing/xpcshell/remotexpcshelltests.py \
2012-05-16 22:46:28 +04:00
--symbols-path= $( DIST) /crashreporter-symbols \
--build-info-json= $( DEPTH) /mozinfo.json \
2012-11-14 03:37:53 +04:00
--testing-modules-dir= $( DEPTH) /_tests/modules \
2012-05-16 22:46:28 +04:00
$( EXTRA_TEST_ARGS) \
--dm_trans= $( DM_TRANS) \
--deviceIP= ${ TEST_DEVICE } \
--objdir= $( DEPTH) \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( relativesrcdir) /$( dir) )
###########################################################################
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
# start the test. Instead, present the xpcshell prompt so the user can
# attach a debugger and then start the test.
check-interactive :
2013-08-15 04:43:04 +04:00
$( info Please consider running xpcshell tests via mach: | mach xpcshell-test --interactive path/to/test| .)
2012-05-16 22:46:28 +04:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
2012-12-20 12:43:19 +04:00
-I$( DEPTH) /build \
2012-05-16 22:46:28 +04:00
-I$( topsrcdir) /build \
-I$( DEPTH) /_tests/mozbase/mozinfo \
$( testxpcsrcdir) /runxpcshelltests.py \
--symbols-path= $( DIST) /crashreporter-symbols \
--build-info-json= $( DEPTH) /mozinfo.json \
--test-path= $( SOLO_FILE) \
--testing-modules-dir= $( DEPTH) /_tests/modules \
--profile-name= $( MOZ_APP_NAME) \
2012-12-17 22:08:00 +04:00
--test-plugin-path= $( DIST) /plugins \
2012-05-16 22:46:28 +04:00
--interactive \
$( LIBXUL_DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( relativesrcdir) /$( dir) )
# Execute a single test, specified in $(SOLO_FILE)
check-one :
2013-08-15 04:43:04 +04:00
$( info Please consider running xpcshell tests via mach: | mach xpcshell-test path/to/test| .)
2012-05-16 22:46:28 +04:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
2012-12-20 12:43:19 +04:00
-I$( DEPTH) /build \
2012-05-16 22:46:28 +04:00
-I$( topsrcdir) /build \
-I$( DEPTH) /_tests/mozbase/mozinfo \
$( testxpcsrcdir) /runxpcshelltests.py \
--symbols-path= $( DIST) /crashreporter-symbols \
--build-info-json= $( DEPTH) /mozinfo.json \
--test-path= $( SOLO_FILE) \
--testing-modules-dir= $( DEPTH) /_tests/modules \
--profile-name= $( MOZ_APP_NAME) \
2012-12-17 22:08:00 +04:00
--test-plugin-path= $( DIST) /plugins \
2012-05-16 22:46:28 +04:00
--verbose \
$( EXTRA_TEST_ARGS) \
$( LIBXUL_DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( relativesrcdir) /$( dir) )
check-one-remote : DM_TRANS ?=adb
check-one-remote :
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
2012-12-20 12:43:19 +04:00
-I$( DEPTH) /build \
2012-05-16 22:46:28 +04:00
-I$( topsrcdir) /build \
-I$( topsrcdir) /build/mobile \
2012-11-02 23:19:54 +04:00
-I$( topsrcdir) /testing/mozbase/mozdevice/mozdevice \
2012-05-16 22:46:28 +04:00
$( testxpcsrcdir) /remotexpcshelltests.py \
--symbols-path= $( DIST) /crashreporter-symbols \
--build-info-json= $( DEPTH) /mozinfo.json \
--test-path= $( SOLO_FILE) \
2012-11-14 03:37:53 +04:00
--testing-modules-dir= $( DEPTH) /_tests/modules \
2012-05-16 22:46:28 +04:00
--profile-name= $( MOZ_APP_NAME) \
--verbose \
$( EXTRA_TEST_ARGS) \
--dm_trans= $( DM_TRANS) \
--deviceIP= ${ TEST_DEVICE } \
--objdir= $( DEPTH) \
--noSetup \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( relativesrcdir) /$( dir) )
.PHONY : xpcshell -tests check -interactive check -one libs -xpcshell -tests
e n d i f #} XPCSHELL_TESTS
INCLUDED_TESTS_XPCSHELL_MK = 1
e n d i f #} INCLUDED_TESTS_XPCSHELL_MK