2
# vim:set ts=8 sw=8 sts=8 noet:
4
# This Source Code Form is subject to the terms of the Mozilla Public
5
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
6
# You can obtain one at http://mozilla.org/MPL/2.0/.
9
ifndef INCLUDED_TESTS_XPCSHELL_MK #{
11
ifdef XPCSHELL_TESTS #{
14
$(error Must define relativesrcdir when defining XPCSHELL_TESTS.)
18
$(call install_cmd, $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir))
20
endef # do not remove the blank line!
22
SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
24
testxpcsrcdir = $(topsrcdir)/testing/xpcshell
26
libs:: libs-xpcshell-tests
28
###########################################################################
30
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
31
ifndef NO_XPCSHELL_MANIFEST_CHECK #{
32
$(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \
34
$(topsrcdir)/testing/xpcshell/xpcshell.ini \
35
$(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))
36
endif #} NO_XPCSHELL_MANIFEST_CHECK
38
###########################################################################
39
# Execute all tests in the $(XPCSHELL_TESTS) directories.
40
# See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
42
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
43
-I$(topsrcdir)/build \
44
-I$(DEPTH)/_tests/mozbase/mozinfo \
45
$(testxpcsrcdir)/runxpcshelltests.py \
46
--symbols-path=$(DIST)/crashreporter-symbols \
47
--build-info-json=$(DEPTH)/mozinfo.json \
48
--tests-root-dir=$(testxpcobjdir) \
49
--testing-modules-dir=$(DEPTH)/_tests/modules \
50
--xunit-file=$(testxpcobjdir)/$(relativesrcdir)/results.xml \
51
--xunit-suite-name=xpcshell \
53
$(LIBXUL_DIST)/bin/xpcshell \
54
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
56
xpcshell-tests-remote: DM_TRANS?=adb
57
xpcshell-tests-remote:
58
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
59
-I$(topsrcdir)/build \
60
-I$(topsrcdir)/build/mobile \
61
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
62
--symbols-path=$(DIST)/crashreporter-symbols \
63
--build-info-json=$(DEPTH)/mozinfo.json \
65
--dm_trans=$(DM_TRANS) \
66
--deviceIP=${TEST_DEVICE} \
68
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
70
###########################################################################
71
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
72
# start the test. Instead, present the xpcshell prompt so the user can
73
# attach a debugger and then start the test.
75
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
76
-I$(topsrcdir)/build \
77
-I$(DEPTH)/_tests/mozbase/mozinfo \
78
$(testxpcsrcdir)/runxpcshelltests.py \
79
--symbols-path=$(DIST)/crashreporter-symbols \
80
--build-info-json=$(DEPTH)/mozinfo.json \
81
--test-path=$(SOLO_FILE) \
82
--testing-modules-dir=$(DEPTH)/_tests/modules \
83
--profile-name=$(MOZ_APP_NAME) \
85
$(LIBXUL_DIST)/bin/xpcshell \
86
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
88
# Execute a single test, specified in $(SOLO_FILE)
90
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
91
-I$(topsrcdir)/build \
92
-I$(DEPTH)/_tests/mozbase/mozinfo \
93
$(testxpcsrcdir)/runxpcshelltests.py \
94
--symbols-path=$(DIST)/crashreporter-symbols \
95
--build-info-json=$(DEPTH)/mozinfo.json \
96
--test-path=$(SOLO_FILE) \
97
--testing-modules-dir=$(DEPTH)/_tests/modules \
98
--profile-name=$(MOZ_APP_NAME) \
101
$(LIBXUL_DIST)/bin/xpcshell \
102
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
104
check-one-remote: DM_TRANS?=adb
106
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
107
-I$(topsrcdir)/build \
108
-I$(topsrcdir)/build/mobile \
109
$(testxpcsrcdir)/remotexpcshelltests.py \
110
--symbols-path=$(DIST)/crashreporter-symbols \
111
--build-info-json=$(DEPTH)/mozinfo.json \
112
--test-path=$(SOLO_FILE) \
113
--profile-name=$(MOZ_APP_NAME) \
116
--dm_trans=$(DM_TRANS) \
117
--deviceIP=${TEST_DEVICE} \
120
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
123
.PHONY: xpcshell-tests check-interactive check-one libs-xpcshell-tests
125
endif #} XPCSHELL_TESTS
127
INCLUDED_TESTS_XPCSHELL_MK = 1
128
endif #} INCLUDED_TESTS_XPCSHELL_MK