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
|
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1999-2022. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions 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
EBIN = .
HRL_FILES = megaco_test_lib.hrl
ERL_FILES = $(MODULES:%=%.erl)
SOURCE = $(HRL_FILES) $(ERL_FILES)
TARGET_FILES = $(MODULES:%=%.$(EMULATOR))
EMAKEFILE = Emakefile
MAKE_EMAKE = $(wildcard $(ERL_TOP)/make/make_emakefile)
ifeq ($(MAKE_EMAKE),)
BUILDTARGET = $(TARGET_FILES)
RELTEST_FILES = $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) $(SOURCE)
else
BUILDTARGET = emakebuild
RELTEST_FILES = $(EMAKEFILE) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) $(SOURCE)
endif
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
include ../src/app/megaco.mk
ifeq ($(USE_MEGACO_TEST_CODE),true)
ERL_COMPILE_FLAGS += -DMEGACO_TEST_CODE=mona_lisa_spelar_doom
endif
ERL_COMPILE_FLAGS += $(MEGACO_ERL_COMPILE_FLAGS)
# We have a behaviour in the test catalog (megaco_test_generator)
ERL_COMPILE_FLAGS += -pa ../../megaco/test
ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
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 $(TYPES): $(BUILDTARGET)
targets: $(TARGET_FILES)
.PHONY: emakebuild
emakebuild: $(EMAKEFILE)
$(EMAKEFILE):
$(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' | grep -v Warning > $(EMAKEFILE)
$(MAKE_EMAKE) $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) | grep -v Warning >> $(EMAKEFILE)
clean:
rm -f $(EMAKEFILE)
rm -f $(TARGET_FILES)
rm -f errs core *~
docs:
info:
@echo "MAKE_EMAKE = $(MAKE_EMAKE)"
@echo "EMAKEFILE = $(EMAKEFILE)"
@echo "BUILDTARGET = $(BUILDTARGET)"
@echo ""
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
@echo "ERL = $(ERL)"
@echo "MERL = $(MERL)"
@echo ""
@echo "ARGS = $(ARGS)"
@echo ""
@echo "HRL_FILES = $(HRL_FILES)"
@echo "ERL_FILES = $(ERL_FILES)"
@echo "TARGET_FILES = $(TARGET_FILES)"
@echo ""
help:
@echo ""
@echo "This Makefile controls the test of the $(APPLICATION) application. "
@echo ""
@echo "There are two separate ways to perform the test of $(APPLICATION)."
@echo ""
@echo " a) Run the official OTP test-server (which we do not describe here)"
@echo ""
@echo " b) Run the test-server provided with this application. "
@echo " There are a number of targets to run the entire or parts"
@echo " of this applications ($(APPLICATION)) test-suite"
@echo ""
@echo "Targets:"
@echo ""
@echo " help"
@echo " Print this info"
@echo ""
@echo " info"
@echo " Prints various environment variables. "
@echo " May be useful when debugging the Makefile. "
@echo ""
@echo " tests | debug | opt "
@echo " Compile all test-code. "
@echo ""
@echo " clean "
@echo " Remove all targets. "
@echo ""
# ----------------------------------------------------
# Special Targets
# ----------------------------------------------------
make: targets
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_SUITE 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_SUITE profile_decode_compact_flex_text_messages \
$(ESTOP)
decode_compact_prof2: make
$(MERL) $(ARGS) -sname megaco_profile_decode_compact $(ERL_PATH) \
-s megaco_codec_v2_SUITE 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_SUITE profile_decode_compact_flex_text_messages \
$(ESTOP)
decode_pretty_prof1: make
$(MERL) $(ARGS) -sname megaco_profile_decode_pretty $(ERL_PATH) \
-s megaco_codec_v1_SUITE 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_SUITE profile_decode_pretty_flex_text_messages \
$(ESTOP)
decode_pretty_prof2: make
$(MERL) $(ARGS) -sname megaco_profile_decode_pretty $(ERL_PATH) \
-s megaco_codec_v2_SUITE 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_SUITE profile_decode_pretty_flex_text_messages \
$(ESTOP)
encode_compact_prof1: make
$(MERL) $(ARGS) -sname megaco_profile_encode_compact $(ERL_PATH) \
-s megaco_codec_v1_SUITE profile_encode_compact_text_messages \
$(ESTOP)
encode_compact_prof2: make
$(MERL) $(ARGS) -sname megaco_profile_encode_compact $(ERL_PATH) \
-s megaco_codec_v2_SUITE profile_encode_compact_text_messages \
$(ESTOP)
encode_pretty_prof1: make
$(MERL) $(ARGS) -sname megaco_profile_encode_pretty $(ERL_PATH) \
-s megaco_codec_v1_SUITE profile_encode_pretty_text_messages \
$(ESTOP)
encode_pretty_prof2: make
$(MERL) $(ARGS) -sname megaco_profile_encode_pretty $(ERL_PATH) \
-s megaco_codec_v2_SUITE profile_encode_pretty_text_messages \
$(ESTOP)
##########################
time1: make
$(MERL) $(ARGS) -sname megaco_time1 $(ERL_PATH) \
-run megaco_codec_v1_SUITE tt $(TT_DIR) \
$(ESTOP)
time2: make
$(MERL) $(ARGS) -sname megaco_time2 $(ERL_PATH) \
-run megaco_codec_v2_SUITE tt $(TT_DIR) \
$(ESTOP)
timeo1: make
$(MERL) $(ARGS) -sname megaco_timeo1 $(ERL_PATH) \
-run megaco_codec_v1_SUITE tt_official $(TT_DIR) \
$(ESTOP)
timeo2: make
$(MERL) $(ARGS) -sname megaco_timeo2 $(ERL_PATH) \
-run megaco_codec_v2_SUITE tt_official $(TT_DIR) \
$(ESTOP)
timeo3: make
$(MERL) $(ARGS) -sname megaco_timeo3 $(ERL_PATH) \
-run megaco_codec_v3_SUITE tt_official $(TT_DIR) \
$(ESTOP)
timet1: make
$(MERL) $(ARGS) -sname megaco_timet1 $(ERL_PATH) \
-run megaco_codec_v1_SUITE tt_texts $(TT_DIR) \
$(ESTOP)
timet2: make
$(MERL) $(ARGS) -sname megaco_timet2 $(ERL_PATH) \
-run megaco_codec_v2_SUITE tt_texts $(TT_DIR) \
$(ESTOP)
timet3: make
$(MERL) $(ARGS) -sname megaco_timet3 $(ERL_PATH) \
-run megaco_codec_v3_SUITE tt_texts $(TT_DIR) \
$(ESTOP)
timeb1: make
$(MERL) $(ARGS) -sname megaco_timeb1 $(ERL_PATH) \
-run megaco_codec_v1_SUITE tt_bins $(TT_DIR) \
$(ESTOP)
timeb2: make
$(MERL) $(ARGS) -sname megaco_timeb2 $(ERL_PATH) \
-run megaco_codec_v2_SUITE tt_bins $(TT_DIR) \
$(ESTOP)
timeb3: make
$(MERL) $(ARGS) -sname megaco_timeb3 $(ERL_PATH) \
-run megaco_codec_v3_SUITE tt_bins $(TT_DIR) \
$(ESTOP)
###################
gnuplot_gif: make
$(MERL) $(ARGS) -sname megaco_gnuplot_gif $(ERL_PATH) \
-s megaco_call_flow_SUITE gnuplot_gif \
$(ESTOP)
display_v1: make
$(MERL) $(ARGS) -sname megaco_display_text_msgs_v1 $(ERL_PATH) \
-s megaco_codec_v1_SUITE display_text_messages \
$(ESTOP)
generate_v1: make
$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v1 $(ERL_PATH) \
-s megaco_codec_v1_SUITE generate_text_messages \
$(ESTOP)
display_v2: make
$(MERL) $(ARGS) -sname megaco_display_text_msgs_v2 $(ERL_PATH) \
-s megaco_codec_v2_SUITE display_text_messages \
$(ESTOP)
generate_v2: make
$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v2 $(ERL_PATH) \
-s megaco_codec_v2_SUITE generate_text_messages \
$(ESTOP)
display_v3: make
$(MERL) $(ARGS) -sname megaco_display_text_msgs_v3 $(ERL_PATH) \
-s megaco_codec_v3_SUITE display_text_messages \
$(ESTOP)
generate_v3: make
$(MERL) $(ARGS) -sname megaco_generate_text_msgs_v3 $(ERL_PATH) \
-s megaco_codec_v3_SUITE generate_text_messages \
$(ESTOP)
generate: make
$(MERL) $(ARGS) -sname megaco_generate_text_msgs $(ERL_PATH) \
-s megaco_codec_v1_SUITE generate_text_messages \
-s megaco_codec_v2_SUITE generate_text_messages \
-s megaco_codec_v3_SUITE 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) $(RELTEST_FILES) "$(RELSYSDIR)"
# $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) \
# $(HRL_FILES) $(ERL_FILES) \
# "$(RELSYSDIR)"
#
chmod -R u+w "$(RELSYSDIR)"
|