~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/inets/test/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# %CopyrightBegin%
 
3
#
 
4
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
 
5
#
 
6
# The contents of this file are subject to the Erlang Public License,
 
7
# Version 1.1, (the "License"); you may not use this file except in
 
8
# compliance with the License. You should have received a copy of the
 
9
# Erlang Public License along with this software. If not, it can be
 
10
# retrieved online at http://www.erlang.org/.
 
11
#
 
12
# Software distributed under the License is distributed on an "AS IS"
 
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
# the License for the specific language governing rights and limitations
 
15
# under the License.
 
16
#
 
17
# %CopyrightEnd%
 
18
#
 
19
#
 
20
# For an outline of how this all_SUITE_data stuff works, see the
 
21
# make file ../../ssl/test/Makefile.
 
22
#
 
23
include $(ERL_TOP)/make/target.mk
 
24
 
 
25
include $(ERL_TOP)/make/$(TARGET)/otp.mk
 
26
 
 
27
# ----------------------------------------------------
 
28
# Application version
 
29
# ----------------------------------------------------
 
30
include ../vsn.mk
 
31
VSN = $(INETS_VSN)
 
32
 
 
33
 
 
34
# ----------------------------------------------------
 
35
# Release directory specification
 
36
# ----------------------------------------------------
 
37
RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
 
38
 
 
39
 
 
40
# ----------------------------------------------------
 
41
# Target Specs
 
42
# ----------------------------------------------------
 
43
INCLUDES = -I. \
 
44
        -I$(ERL_TOP)/lib/test_server/include/ \
 
45
        -I$(ERL_TOP)/lib/inets/src/inets_app \
 
46
        -I$(ERL_TOP)/lib/inets/src/http_lib \
 
47
        -I$(ERL_TOP)/lib/inets/src/http_client \
 
48
        -I$(ERL_TOP)/lib/inets/src/ftp
 
49
 
 
50
CP = cp
 
51
 
 
52
ifeq ($(TESTROOT_DIR),)
 
53
TESTROOT_DIR = /ldisk/tests/$(USER)/inets
 
54
endif
 
55
 
 
56
ifeq ($(INETS_DATA_DIR),)
 
57
INETS_DATA_DIR = $(TESTROOT_DIR)/data_dir
 
58
endif
 
59
 
 
60
ifeq ($(INETS_PRIV_DIR),)
 
61
INETS_PRIV_DIR = $(TESTROOT_DIR)/priv_dir
 
62
endif
 
63
 
 
64
INETS_FLAGS = -Dinets_data_dir='"$(INETS_DATA_DIR)"'       \
 
65
              -Dinets_priv_dir='"$(INETS_PRIV_DIR)"'
 
66
 
 
67
 
 
68
### 
 
69
### test suite debug flags
 
70
### 
 
71
ifeq ($(FTP_DEBUG_CLIENT),)
 
72
  FTP_DEBUG_CLIENT = y
 
73
endif
 
74
 
 
75
ifeq ($(FTP_DEBUG_CLIENT),)
 
76
  FTP_FLAGS += -Dftp_debug_client
 
77
endif
 
78
 
 
79
ifeq ($(FTP_TRACE_CLIENT),)
 
80
  FTP_DEBUG_CLIENT = y
 
81
endif
 
82
 
 
83
ifeq ($(FTP_TRACE_CLIENT),y)
 
84
  FTP_FLAGS += -Dftp_trace_client
 
85
endif
 
86
 
 
87
ifneq ($(FTP_DEBUG),)
 
88
  FTP_DEBUG = s
 
89
endif
 
90
 
 
91
ifeq ($(FTP_DEBUG),l)
 
92
  FTP_FLAGS += -Dftp_log
 
93
endif
 
94
 
 
95
ifeq ($(FTP_DEBUG),d)
 
96
  FTP_FLAGS += -Dftp_debug -Dftp_log
 
97
endif
 
98
 
 
99
ifeq ($(INETS_DEBUG),)
 
100
  INETS_DEBUG = d
 
101
endif
 
102
 
 
103
ifeq ($(INETS_DEBUG),l)
 
104
  INETS_FLAGS += -Dinets_log
 
105
endif
 
106
 
 
107
ifeq ($(INETS_DEBUG),d)
 
108
  INETS_FLAGS += -Dinets_debug -Dinets_log
 
109
endif
 
110
 
 
111
 
 
112
### 
 
113
### HTTPD verbosity flags
 
114
### 
 
115
 
 
116
ifneq ($(MANV),)
 
117
  INETS_FLAGS += -Dhttpd_manager_verbosity=$(MANV)
 
118
else
 
119
  INETS_FLAGS += -Dhttpd_manager_verbosity=trace
 
120
endif
 
121
 
 
122
ifneq ($(REQV),)
 
123
  INETS_FLAGS += -Dhttpd_request_handler_verbosity=$(REQV)
 
124
else
 
125
  INETS_FLAGS += -Dhttpd_request_handler_verbosity=trace
 
126
endif
 
127
 
 
128
ifneq ($(ACCV),)
 
129
  INETS_FLAGS += -Dhttpd_acceptor_verbosity=$(ACCV)
 
130
else
 
131
  INETS_FLAGS += -Dhttpd_acceptor_verbosity=trace
 
132
endif
 
133
 
 
134
ifneq ($(AUTHV),)
 
135
  INETS_FLAGS += -Dhttpd_auth_verbosity=$(AUTHV)
 
136
else
 
137
  INETS_FLAGS += -Dhttpd_auth_verbosity=log
 
138
endif
 
139
 
 
140
ifneq ($(SECV),)
 
141
  INETS_FLAGS += -Dhttpd_security_verbosity=$(SECV)
 
142
else
 
143
  INETS_FLAGS += -Dhttpd_security_verbosity=log
 
144
endif
 
145
 
 
146
INETS_FLAGS += -pa ../../inets/ebin
 
147
 
 
148
INETS_ROOT = ../../inets
 
149
 
 
150
MODULES =                               \
 
151
        inets_test_lib                  \
 
152
        ftp_SUITE                       \
 
153
        ftp_format_SUITE                \
 
154
        ftp_solaris8_sparc_test         \
 
155
        ftp_solaris9_sparc_test         \
 
156
        ftp_solaris10_sparc_test        \
 
157
        ftp_solaris10_x86_test          \
 
158
        ftp_linux_x86_test              \
 
159
        ftp_linux_ppc_test              \
 
160
        ftp_macosx_x86_test             \
 
161
        ftp_macosx_ppc_test             \
 
162
        ftp_openbsd_x86_test            \
 
163
        ftp_freebsd_x86_test            \
 
164
        ftp_netbsd_x86_test             \
 
165
        ftp_windows_xp_test             \
 
166
        ftp_windows_2003_server_test    \
 
167
        ftp_suite_lib                   \
 
168
        ftp_ticket_test                 \
 
169
        http_format_SUITE               \
 
170
        httpc_SUITE                     \
 
171
        httpc_cookie_SUITE              \
 
172
        httpd_SUITE                     \
 
173
        httpd_basic_SUITE               \
 
174
        httpd_mod                       \
 
175
        httpd_block                     \
 
176
        httpd_load                      \
 
177
        httpd_time_test                 \
 
178
        httpd_1_1                       \
 
179
        httpd_test_lib                  \
 
180
        inets_sup_SUITE                 \
 
181
        inets_SUITE                     \
 
182
        inets_app_test                  \
 
183
        inets_appup_test                \
 
184
        tftp_test_lib                   \
 
185
        tftp_SUITE
 
186
 
 
187
 
 
188
EBIN = .
 
189
 
 
190
HRL_FILES = inets_test_lib.hrl \
 
191
            inets_internal.hrl \
 
192
            ftp_internal.hrl   \
 
193
            httpc_internal.hrl \
 
194
            http_internal.hrl \
 
195
            tftp_test_lib.hrl
 
196
 
 
197
ERL_FILES = $(MODULES:%=%.erl)
 
198
 
 
199
SOURCE = $(ERL_FILES) $(HRL_FILES) 
 
200
 
 
201
TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
 
202
 
 
203
INETS_SPECS = inets.spec
 
204
COVER_FILE = inets.cover
 
205
INETS_FILES = inets.config $(INETS_SPECS)
 
206
 
 
207
# SUB_SUITES = \
 
208
#       inets_sup_suite \
 
209
#       inets_httpd_suite \
 
210
#       inets_httpc_suite \
 
211
#       inets_ftp_suite \
 
212
#       inets_tftp_suite
 
213
 
 
214
INETS_DATADIRS = inets_SUITE_data inets_sup_SUITE_data 
 
215
HTTPD_DATADIRS = httpd_test_data httpd_SUITE_data
 
216
HTTPC_DATADIRS = httpc_SUITE_data
 
217
FTP_DATADIRS   = ftp_SUITE_data  
 
218
 
 
219
DATADIRS     = $(INETS_DATADIRS) $(HTTPD_DATADIRS) $(HTTPC_DATADIRS) $(FTP_DATADIRS)
 
220
 
 
221
EMAKEFILE  = Emakefile
 
222
MAKE_EMAKE = $(wildcard $(ERL_TOP)/make/make_emakefile)
 
223
 
 
224
ifeq ($(MAKE_EMAKE),)
 
225
BUILDTARGET   = $(TARGET_FILES)
 
226
RELTEST_FILES = $(COVER_FILE) $(INETS_SPECS) $(SOURCE)
 
227
else
 
228
BUILDTARGET   = emakebuild
 
229
RELTEST_FILES = $(EMAKEFILE) $(COVER_FILE) $(INETS_SPECS) $(SOURCE)
 
230
endif
 
231
 
 
232
 
 
233
# ----------------------------------------------------
 
234
# Release directory specification
 
235
# ----------------------------------------------------
 
236
 
 
237
RELTESTSYSDIR        = $(RELEASE_PATH)/inets_test
 
238
RELTESTSYSALLDATADIR = $(RELTESTSYSDIR)/all_SUITE_data
 
239
RELTESTSYSBINDIR     = $(RELTESTSYSALLDATADIR)/bin
 
240
 
 
241
 
 
242
# ----------------------------------------------------
 
243
# FLAGS
 
244
# The path to the test_server ebin dir is needed when 
 
245
# running the target "targets".
 
246
# ----------------------------------------------------
 
247
ERL_COMPILE_FLAGS += \
 
248
        -pa ../../../internal_tools/test_server/ebin \
 
249
        $(INCLUDES) \
 
250
        $(FTP_FLAGS) \
 
251
        $(INETS_FLAGS)
 
252
 
 
253
# ----------------------------------------------------
 
254
# Targets
 
255
# erl -sname kalle -pa ../ebin
 
256
# If you intend to run the test suite locally (private), then
 
257
# there is some requirements:
 
258
# 1) INETS_PRIV_DIR must be created
 
259
# ----------------------------------------------------
 
260
 
 
261
tests debug opt: $(BUILDTARGET)
 
262
 
 
263
targets: $(TARGET_FILES)
 
264
 
 
265
.PHONY: emakebuild
 
266
 
 
267
emakebuild: $(EMAKEFILE)
 
268
 
 
269
$(EMAKEFILE): 
 
270
        $(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' | grep -v Warning > $(EMAKEFILE)
 
271
        $(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) | grep -v Warning >> $(EMAKEFILE)
 
272
 
 
273
clean:
 
274
        rm -f $(EMAKEFILE)
 
275
        rm -f $(TARGET_FILES)
 
276
        rm -f core *~
 
277
 
 
278
docs:
 
279
 
 
280
 
 
281
# ----------------------------------------------------
 
282
# Release Target
 
283
# ---------------------------------------------------- 
 
284
include $(ERL_TOP)/make/otp_release_targets.mk
 
285
 
 
286
release_spec: opt
 
287
        $(INSTALL_DIR)  $(RELSYSDIR)/test
 
288
        $(INSTALL_DATA) $(HRL_FILES)   $(ERL_FILES) $(RELSYSDIR)/test
 
289
        $(INSTALL_DATA) $(INETS_FILES) $(RELSYSDIR)/test
 
290
        @for d in $(DATADIRS); do \
 
291
            echo "installing data dir $$d"; \
 
292
            if test -f $$d/TAR.exclude; then \
 
293
                echo $$d/TAR.exclude2 > $$d/TAR.exclude2; \
 
294
                cat $$d/TAR.exclude >> $$d/TAR.exclude2; \
 
295
                find $$d -name '*.contrib*'     >> $$d/TAR.exclude2; \
 
296
                find $$d -name '*.keep*'        >> $$d/TAR.exclude2; \
 
297
                find $$d -name '*.mkelem*'      >> $$d/TAR.exclude2; \
 
298
                find $$d -name '*~'             >> $$d/TAR.exclude2; \
 
299
                find $$d -name 'erl_crash.dump' >> $$d/TAR.exclude2; \
 
300
                find $$d -name 'core'           >> $$d/TAR.exclude2; \
 
301
                find $$d -name '.cmake.state'   >> $$d/TAR.exclude2; \
 
302
                tar cfX - $$d/TAR.exclude2 $$d | (cd $(RELSYSDIR)/test; tar xf -); \
 
303
            else \
 
304
                tar cf - $$d | (cd $(RELSYSDIR)/test; tar xf -); \
 
305
            fi; \
 
306
        done
 
307
 
 
308
release_tests_spec: opt
 
309
        $(INSTALL_DIR) $(RELTESTSYSDIR)
 
310
        $(INSTALL_DATA) $(RELTEST_FILES) $(RELTESTSYSDIR)
 
311
        chmod -f -R u+w $(RELTESTSYSDIR)
 
312
        tar chf - $(DATADIRS) | (cd $(RELTESTSYSDIR); tar xf -)
 
313
        $(INSTALL_DIR) $(RELTESTSYSALLDATADIR)
 
314
        $(INSTALL_DIR) $(RELTESTSYSBINDIR)
 
315
        chmod -f -R +x $(RELTESTSYSBINDIR)
 
316
        $(INSTALL_DIR) $(RELTESTSYSALLDATADIR)/win32/lib        
 
317
 
 
318
release_docs_spec:
 
319
 
 
320
info:
 
321
        @echo "MAKE_EMAKE        = $(MAKE_EMAKE)"
 
322
        @echo "EMAKEFILE         = $(EMAKEFILE)"
 
323
        @echo "BUILDTARGET       = $(BUILDTARGET)"
 
324
        @echo ""
 
325
        @echo "MODULES           = $(MODULES)"
 
326
        @echo "ERL_FILES         = $(ERL_FILES)"
 
327
        @echo "SOURCE            = $(SOURCE)"
 
328
        @echo "TARGET_FILES      = $(TARGET_FILES)"
 
329
        @echo ""
 
330
        @echo "INETS_SPECS       = $(INETS_SPECS)"
 
331
        @echo "INETS_FILES       = $(INETS_FILES)"
 
332
        @echo ""
 
333
        @echo "RELEASE_PATH      = $(RELEASE_PATH)"
 
334
        @echo "RELSYSDIR         = $(RELSYSDIR)"
 
335
        @echo "RELTESTSYSDIR     = $(RELTESTSYSDIR)"
 
336
        @echo "RELTESTSYSALLDATADIR = $(RELTESTSYSALLDATADIR)"
 
337
        @echo "RELTESTSYSBINDIR     = $(RELTESTSYSBINDIR)"
 
338
        @echo ""
 
339
        @echo "DATADIRS          = $(DATADIRS)"
 
340
        @echo "REL_DATADIRS      = $(REL_DATADIRS)"
 
341
        @echo ""
 
342
        @echo "INETS_DATA_DIR    = $(INETS_DATA_DIR)"
 
343
        @echo "INETS_PRIV_DIR    = $(INETS_PRIV_DIR)"
 
344
        @echo "INETS_ROOT        = $(INETS_ROOT)"
 
345
        @echo "INETS_FLAGS       = $(INETS_FLAGS)"
 
346
        @echo "FTP_FLAGS         = $(FTP_FLAGS)"
 
347
 
 
348
tftp:
 
349
        erlc $(ERL_COMPILE_FLAGS) tftp_test_lib.erl tftp_SUITE.erl && erl -pa ../../inets/ebin -s tftp_SUITE t -s erlang halt
 
350
 
 
351
tftp_work:
 
352
        echo "tftp_test_lib:t([{tftp_SUITE, all}])."
 
353
        erlc $(ERL_COMPILE_FLAGS) tftp_test_lib.erl tftp_SUITE.erl && erl -pa ../../inets/ebin