aboutsummaryrefslogblamecommitdiffstats
path: root/lib/megaco/test/Makefile
blob: a6f50f87c451536731a37e214c5df89c241baf13 (plain) (tree)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611


































































































































































































































































































































































































































































































































































































































                                                                               
# 
# %CopyrightBegin%
# 
# Copyright Ericsson AB 1999-2009. All Rights Reserved.
# 
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
# 
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
# 
# %CopyrightEnd%

include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk


# ----------------------------------------------------
# Application version
# ----------------------------------------------------
include ../vsn.mk
VSN=$(MEGACO_VSN)


# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/megaco_test

ifeq ($(findstring win32,$(TARGET)),win32)

MAKEFILE_SRC = Makefile.win32.src

else

MAKEFILE_SRC = Makefile.src

endif

ifeq ($(TT_DIR),)
TT_DIR = /tmp
endif

# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------

include modules.mk

HRL_FILES = megaco_test_lib.hrl

ERL_FILES = $(MODULES:%=%.erl)

TARGET_FILES = $(MODULES:%=%.$(EMULATOR))

COVER_SPEC_FILE = megaco.cover

APP_CASES   = app appup

CODEC_CASES = codec1 codec2 codec3a codec3b codec3c

MISC_CASES  = tid sdp dm conf udp tcp ex timer flex

OP_CASES    = mess mib mreq pending trans actions load

ALL_CASES   = $(APP_CASES) $(CODEC_CASES) $(MISC_CASES) $(OP_CASES)


# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------

include ../src/app/megaco.mk 

ifeq ($(USE_MEGACO_TEST_CODE),true)
ERL_COMPILE_FLAGS += -DMEGACO_TEST_CODE=mona_lisa_spelar_doom
endif

ifeq ($(USE_MEGACO_HIPE),true)
ERL_COMPILE_FLAGS += +native -Dmegaco_hipe_special=true
endif

ERL_COMPILE_FLAGS += \
	$(MEGACO_ERL_COMPILE_FLAGS)         \
	-pa $(ERL_TOP)/lib/test_server/ebin \
	-I$(ERL_TOP)/lib/test_server/include

ERL_PATH = -pa ../../megaco/examples/simple \
           -pa ../../megaco/ebin \
           -pa ../../et/ebin

ifndef SUITE
SUITE = megaco_SUITE
endif

ESTOP = -s init stop

ifeq ($(DONT_STOP),true)
MAYBE_ESTOP =
else
MAYBE_ESTOP = $(ESTOP)
endif

ETVIEW = -s et_viewer
ifeq ($(USE_ET_VIEWER),true)
MAYBE_ETVIEW =
else
MAYBE_ETVIEW = $(ETVIEW)
endif

ifeq ($(MERL),)
MERL = erl
endif

ARGS += -noshell

ifeq ($(DISABLE_TC_TIMEOUT),true)
ARGS += -megaco_test_timeout
endif


# ----------------------------------------------------
# Targets
# ----------------------------------------------------

tests debug opt: $(TARGET_FILES)

clean:
	rm -f $(TARGET_FILES) 
	rm -f errs core *~

docs:

info:
	@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
	@echo "ERL  = $(ERL)"
	@echo "MERL = $(MERL)"
	@echo ""


# ----------------------------------------------------
# Special Targets
# ----------------------------------------------------

aall: make
	@echo "make sure epmd is new"
	@epmd -kill > /dev/null
	@echo "Running all app sub-suites separatelly"
	@for i in $(APP_CASES); do \
            echo "SUITE: $$i"; \
            clearmake -V $$i > $$i.log; \
        done
	echo "done"

call: make
	@echo "make sure epmd is new"
	@epmd -kill > /dev/null
	@echo "Running all codec sub-suites separatelly"
	@for i in $(CODEC_CASES); do \
            echo "SUITE: $$i"; \
            clearmake -V $$i > $$i.log; \
        done

mall: make
	@echo "make sure epmd is new"
	@epmd -kill > /dev/null
	@echo "Running all misc sub-suites separatelly"
	@for i in $(MISC_CASES); do \
            echo "SUITE: $$i"; \
            clearmake -V $$i > $$i.log; \
        done

oall: make
	@echo "make sure epmd is new"
	@epmd -kill > /dev/null
	@echo "Running all operation sub-suites separatelly"
	@for i in $(OP_CASES); do \
            echo "SUITE: $$i"; \
            clearmake -V $$i > $$i.log; \
        done

all: make
	@echo "make sure epmd is new"
	@epmd -kill > /dev/null
	@echo "Running all sub-suites separatelly"
	@for i in $(ALL_CASES); do \
            echo "SUITE: $$i"; \
            clearmake -V $$i > $$i.log; \
        done

make: targets

targets: $(TARGET_FILES)

test: make
	$(MERL) $(ARGS) -sname megaco_test $(ERL_PATH) \
            -s megaco_test_lib t $(SUITE) \
            $(MAYBE_ESTOP)

utest: make
	$(MERL) $(ARGS) -sname megaco_utest $(ERL_PATH) \
            $(MAYBE_ETVIEW) \
            -s megaco_test_lib t $(SUITE) \
            $(ESTOP)

ftest: make
	$(MERL) $(ARGS) -sname megaco_ftest $(ERL_PATH) \
            -s megaco_filter \
            -s megaco_test_lib t $(SUITE) \
            $(ESTOP)

decode_compact_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_compact $(ERL_PATH) \
            -s megaco_codec_v1_test profile_decode_compact_text_messages \
            $(ESTOP)

decode_compact_flex_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_compact_flex $(ERL_PATH) \
            -s megaco_codec_v1_test profile_decode_compact_flex_text_messages \
            $(ESTOP)

decode_compact_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_compact $(ERL_PATH) \
            -s megaco_codec_v2_test profile_decode_compact_text_messages \
            $(ESTOP)

decode_compact_flex_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_compact_flex $(ERL_PATH) \
            -s megaco_codec_v2_test profile_decode_compact_flex_text_messages \
            $(ESTOP)

decode_pretty_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_pretty $(ERL_PATH) \
            -s megaco_codec_v1_test profile_decode_pretty_text_messages \
            $(ESTOP)

decode_pretty_flex_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_pretty_flex $(ERL_PATH) \
            -s megaco_codec_v1_test profile_decode_pretty_flex_text_messages \
            $(ESTOP)

decode_pretty_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_pretty $(ERL_PATH) \
            -s megaco_codec_v2_test profile_decode_pretty_text_messages \
            $(ESTOP)

decode_pretty_flex_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_decode_pretty_flex $(ERL_PATH) \
            -s megaco_codec_v2_test profile_decode_pretty_flex_text_messages \
            $(ESTOP)

encode_compact_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_encode_compact $(ERL_PATH) \
            -s megaco_codec_v1_test profile_encode_compact_text_messages \
            $(ESTOP)

encode_compact_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_encode_compact $(ERL_PATH) \
            -s megaco_codec_v2_test profile_encode_compact_text_messages \
            $(ESTOP)

encode_pretty_prof1: make
	$(MERL) $(ARGS) -sname megaco_profile_encode_pretty $(ERL_PATH) \
            -s megaco_codec_v1_test profile_encode_pretty_text_messages \
            $(ESTOP)

encode_pretty_prof2: make
	$(MERL) $(ARGS) -sname megaco_profile_encode_pretty $(ERL_PATH) \
            -s megaco_codec_v2_test profile_encode_pretty_text_messages \
            $(ESTOP)


##########################

tickets: make
	$(MERL) $(ARGS) -sname megaco_tickets $(ERL_PATH) \
            -s megaco_test_lib tickets $(SUITE) \
            $(ESTOP)

app: make
	$(MERL) $(ARGS) -sname megaco_app $(ERL_PATH) \
            -s megaco_test_lib t megaco_app_test \
            $(ESTOP)

appup: make
	$(MERL) $(ARGS) -sname megaco_appup $(ERL_PATH) \
            -s megaco_test_lib t megaco_appup_test \
            $(ESTOP)

conf: make
	$(MERL) $(ARGS) -sname megaco_config $(ERL_PATH) \
            -s megaco_test_lib t megaco_config_test \
            $(ESTOP)


##########################

codec: make
	$(MERL) $(ARGS) -sname megaco_codec $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_test \
            $(MAYBE_ESTOP)

codec1: make
	$(MERL) $(ARGS) -sname megaco_codec1 $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_v1_test \
            $(MAYBE_ESTOP)

codec1_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec1_tickets $(ERL_PATH) \
            -s megaco_codec_v1_test tickets \
            $(ESTOP)

codec2: make
	$(MERL) $(ARGS) -sname megaco_codec2 $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_v2_test \
            $(MAYBE_ESTOP)

codec2_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec2_tickets $(ERL_PATH) \
            -s megaco_codec_v2_test tickets \
            $(ESTOP)

codec3a: make
	$(MERL) $(ARGS) -sname megaco_codec3a $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_prev3a_test \
            $(MAYBE_ESTOP)

codec3a_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec3a_tickets $(ERL_PATH) \
            -s megaco_codec_prev3a_test tickets \
            $(ESTOP)

codec3b: make
	$(MERL) $(ARGS) -sname megaco_codec3b $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_prev3b_test \
            $(MAYBE_ESTOP)

codec3b_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec3b_tickets $(ERL_PATH) \
            -s megaco_codec_prev3b_test tickets \
            $(ESTOP)

codec3c: make
	$(MERL) $(ARGS) -sname megaco_codec3c $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_prev3c_test \
            $(MAYBE_ESTOP)

codec3c_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec3c_tickets $(ERL_PATH) \
            -s megaco_codec_prev3c_test tickets \
            $(ESTOP)

codec3: make
	$(MERL) $(ARGS) -sname megaco_codec3 $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_v3_test \
            $(MAYBE_ESTOP)

codec3_tickets: make
	$(MERL) $(ARGS) -sname megaco_codec3_tickets $(ERL_PATH) \
            -s megaco_codec_v3_test tickets \
            $(ESTOP)

codecm: make
	$(MERL) $(ARGS) -sname megaco_codec1 $(ERL_PATH) \
            -s megaco_test_lib t megaco_codec_mini_test \
            $(MAYBE_ESTOP)


##########################

time1: make
	$(MERL) $(ARGS) -sname megaco_time1 $(ERL_PATH) \
            -run megaco_codec_v1_test tt $(TT_DIR) \
            $(ESTOP)

time2: make
	$(MERL) $(ARGS) -sname megaco_time2 $(ERL_PATH) \
            -run megaco_codec_v2_test tt $(TT_DIR) \
            $(ESTOP)

timeo1: make
	$(MERL) $(ARGS) -sname megaco_timeo1 $(ERL_PATH) \
            -run megaco_codec_v1_test tt_official $(TT_DIR) \
            $(ESTOP)

timeo2: make
	$(MERL) $(ARGS) -sname megaco_timeo2 $(ERL_PATH) \
            -run megaco_codec_v2_test tt_official $(TT_DIR) \
            $(ESTOP)

timeo3: make
	$(MERL) $(ARGS) -sname megaco_timeo3 $(ERL_PATH) \
            -run megaco_codec_v3_test tt_official $(TT_DIR) \
            $(ESTOP)

timet1: make
	$(MERL) $(ARGS) -sname megaco_timet1 $(ERL_PATH) \
            -run megaco_codec_v1_test tt_texts $(TT_DIR) \
            $(ESTOP)

timet2: make
	$(MERL) $(ARGS) -sname megaco_timet2 $(ERL_PATH) \
            -run megaco_codec_v2_test tt_texts $(TT_DIR) \
            $(ESTOP)

timet3: make
	$(MERL) $(ARGS) -sname megaco_timet3 $(ERL_PATH) \
            -run megaco_codec_v3_test tt_texts $(TT_DIR) \
            $(ESTOP)

timeb1: make
	$(MERL) $(ARGS) -sname megaco_timeb1 $(ERL_PATH) \
            -run megaco_codec_v1_test tt_bins $(TT_DIR) \
            $(ESTOP)

timeb2: make
	$(MERL) $(ARGS) -sname megaco_timeb2 $(ERL_PATH) \
            -run megaco_codec_v2_test tt_bins $(TT_DIR) \
            $(ESTOP)

timeb3: make
	$(MERL) $(ARGS) -sname megaco_timeb3 $(ERL_PATH) \
            -run megaco_codec_v3_test tt_bins $(TT_DIR) \
            $(ESTOP)


##########################

flex: make
	$(MERL) $(ARGS) -sname megaco_flex $(ERL_PATH) \
            -s megaco_test_lib t megaco_flex_test \
            $(ESTOP)

dm: make
	$(MERL) $(ARGS) -sname megaco_dm $(ERL_PATH) \
            -s megaco_test_lib t megaco_digit_map_test \
            $(ESTOP)

tid: make
	$(MERL) $(ARGS) -sname megaco_tid $(ERL_PATH) \
            -s megaco_test_lib t megaco_binary_term_id_test \
            $(ESTOP)

sdp: make
	$(MERL) $(ARGS) -sname megaco_sdp $(ERL_PATH) \
            -s megaco_test_lib t megaco_sdp_test \
            $(MAYBE_ESTOP)

actions: make
	$(MERL) $(ARGS) -sname megaco_actions $(ERL_PATH) \
            -s megaco_test_lib t megaco_actions_test \
            $(MAYBE_ESTOP)

mess: make
	$(MERL) $(ARGS) -sname megaco_mess $(ERL_PATH) \
            $(MAYBE_ETVIEW) \
            -s megaco_test_lib t megaco_mess_test \
            $(ESTOP)

trans: make
	$(MERL) $(ARGS) -sname megaco_trans $(ERL_PATH) \
            -s megaco_test_lib t megaco_trans_test \
            $(MAYBE_ESTOP)

mib: make
	$(MERL) $(ARGS) -sname megaco_mib $(ERL_PATH) \
            -s megaco_test_lib t megaco_mib_test \
            $(MAYBE_ESTOP)

mreq: make
	$(MERL) $(ARGS) -sname megaco_mreq $(ERL_PATH) \
            -s megaco_test_lib t megaco_mreq_test \
            $(MAYBE_ESTOP)

pending: make
	$(MERL) $(ARGS) -sname megaco_pending $(ERL_PATH) \
            -s megaco_test_lib t megaco_pending_limit_test \
            $(MAYBE_ESTOP)

pl: make
	$(MERL) $(ARGS) -sname megaco_pl $(ERL_PATH) \
            -s megaco_test_lib t megaco_pending_limit_test \
            $(MAYBE_ESTOP)

udp: make
	$(MERL) $(ARGS) -sname megaco_pl $(ERL_PATH) \
            -s megaco_test_lib t megaco_udp_test \
            $(MAYBE_ESTOP)

tcp: make
	$(MERL) $(ARGS) -sname megaco_pl $(ERL_PATH) \
            -s megaco_test_lib t megaco_tcp_test \
            $(MAYBE_ESTOP)

load: make
	$(MERL) $(ARGS) -sname megaco_load $(ERL_PATH) \
            -s megaco_test_lib t megaco_load_test \
            $(MAYBE_ESTOP)

ex: make
	$(MERL) $(ARGS) -sname megaco_ex $(ERL_PATH) \
            -s megaco_test_lib t megaco_examples_test \
            $(MAYBE_ESTOP)

segment: make
	$(MERL) $(ARGS) -sname megaco_segment $(ERL_PATH) \
            -s megaco_test_lib t megaco_segment_test \
            $(ESTOP)

timer: make
	$(MERL) $(ARGS) -sname megaco_timer $(ERL_PATH) \
            -s megaco_test_lib t megaco_timer_test \
            $(ESTOP)


###################

gnuplot_gif: make
	$(MERL) $(ARGS) -sname megaco_gnuplot_gif $(ERL_PATH) \
            -s megaco_call_flow_test gnuplot_gif \
            $(ESTOP)

display_v1: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_v1 $(ERL_PATH) \
            -s megaco_codec_v1_test display_text_messages \
            $(ESTOP)

generate_v1: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v1 $(ERL_PATH) \
            -s megaco_codec_v1_test generate_text_messages \
            $(ESTOP)

display_v2: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_v2 $(ERL_PATH) \
            -s megaco_codec_v2_test display_text_messages \
            $(ESTOP)

generate_v2: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v2 $(ERL_PATH) \
            -s megaco_codec_v2_test generate_text_messages \
            $(ESTOP)

display_prev3a: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3a $(ERL_PATH) \
            -s megaco_codec_prev3a_test display_text_messages \
            $(ESTOP)

display_prev3b: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3b $(ERL_PATH) \
            -s megaco_codec_prev3b_test display_text_messages \
            $(ESTOP)

generate_prev3b: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs_prev3b $(ERL_PATH) \
            -s megaco_codec_prev3b_test generate_text_messages \
            $(ESTOP)

display_prev3c: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3c $(ERL_PATH) \
            -s megaco_codec_prev3c_test display_text_messages \
            $(ESTOP)

generate_prev3c: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs_prev3c $(ERL_PATH) \
            -s megaco_codec_prev3c_test generate_text_messages \
            $(ESTOP)

display_v3: make
	$(MERL) $(ARGS) -sname megaco_display_text_msgs_v3 $(ERL_PATH) \
            -s megaco_codec_v3_test display_text_messages \
            $(ESTOP)

generate_v3: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v3 $(ERL_PATH) \
            -s megaco_codec_v3_test generate_text_messages \
            $(ESTOP)

generate: make
	$(MERL) $(ARGS) -sname megaco_generate_text_msgs $(ERL_PATH) \
            -s megaco_codec_v1_test generate_text_messages \
            -s megaco_codec_v2_test generate_text_messages \
            -s megaco_codec_v3_test generate_text_messages \
            $(ESTOP)

node:
	$(MERL) -sname megaco $(ERL_PATH)


# ----------------------------------------------------
# Release Targets
# ---------------------------------------------------- 

include $(ERL_TOP)/make/otp_release_targets.mk

release_spec: 

release_docs_spec:

release_tests_spec: tests
	$(INSTALL_DIR)  $(RELSYSDIR)
	$(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) \
                        $(HRL_FILES) $(ERL_FILES) \
                        $(RELSYSDIR)
	$(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)
	chmod -f -R u+w $(RELSYSDIR)