~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# -*- 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/.
#

ifndef INCLUDED_TESTS_XPCSHELL_MK #{

ifdef XPCSHELL_TESTS #{

ifndef relativesrcdir
$(error Must define relativesrcdir when defining XPCSHELL_TESTS.)
endif

define _INSTALL_TESTS
$(call install_cmd, $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir))

endef # 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))
ifndef NO_XPCSHELL_MANIFEST_CHECK #{
	$(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \
	  $(topsrcdir) \
	  $(topsrcdir)/testing/xpcshell/xpcshell.ini \
	  $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))
endif #} 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:
	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
	  -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 \
	  $(EXTRA_TEST_ARGS) \
	  $(LIBXUL_DIST)/bin/xpcshell \
	  $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))

xpcshell-tests-remote: DM_TRANS?=adb
xpcshell-tests-remote:
	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
	  -I$(topsrcdir)/build \
	  -I$(topsrcdir)/build/mobile \
	  $(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
	  --symbols-path=$(DIST)/crashreporter-symbols \
	  --build-info-json=$(DEPTH)/mozinfo.json \
	  $(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:
	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
	  -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) \
	  --interactive \
	  $(LIBXUL_DIST)/bin/xpcshell \
	  $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))

# Execute a single test, specified in $(SOLO_FILE)
check-one:
	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
	  -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) \
	  --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 \
	  -I$(topsrcdir)/build \
	  -I$(topsrcdir)/build/mobile \
	  $(testxpcsrcdir)/remotexpcshelltests.py \
	  --symbols-path=$(DIST)/crashreporter-symbols \
	  --build-info-json=$(DEPTH)/mozinfo.json \
	  --test-path=$(SOLO_FILE) \
	  --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

endif #} XPCSHELL_TESTS

INCLUDED_TESTS_XPCSHELL_MK = 1
endif #} INCLUDED_TESTS_XPCSHELL_MK