blob: 1fad55288344ec4d679bb183cac339c93245fb1f [file] [log] [blame]
Alexander Huemer7b6673f2016-09-09 00:43:15 +02001SUBDIRS = \
Harald Welte2483f1b2016-06-19 18:06:02 +02002 sms_queue \
Neels Hofmeyr6a29d322017-01-25 15:04:16 +01003 msc_vlr \
Vadim Yanitskiye1e72472019-04-09 16:55:44 +07004 db_sms \
Alexander Huemer7b6673f2016-09-09 00:43:15 +02005 $(NULL)
Philipp22611be2016-08-10 12:08:03 +02006
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +02007if BUILD_SMPP
Alexander Huemer7b6673f2016-09-09 00:43:15 +02008SUBDIRS += \
9 smpp \
10 $(NULL)
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +020011endif
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010012
13# The `:;' works around a Bash 3.2 bug when the output is not writeable.
Holger Hans Peter Freyther93ef33e2012-01-09 22:53:04 +010014$(srcdir)/package.m4: $(top_srcdir)/configure.ac
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010015 :;{ \
16 echo '# Signature of the current package.' && \
17 echo 'm4_define([AT_PACKAGE_NAME],' && \
18 echo ' [$(PACKAGE_NAME)])' && \
19 echo 'm4_define([AT_PACKAGE_TARNAME],' && \
20 echo ' [$(PACKAGE_TARNAME)])' && \
21 echo 'm4_define([AT_PACKAGE_VERSION],' && \
22 echo ' [$(PACKAGE_VERSION)])' && \
23 echo 'm4_define([AT_PACKAGE_STRING],' && \
24 echo ' [$(PACKAGE_STRING)])' && \
25 echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
26 echo ' [$(PACKAGE_BUGREPORT)])'; \
27 echo 'm4_define([AT_PACKAGE_URL],' && \
28 echo ' [$(PACKAGE_URL)])'; \
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +010029 } >'$(srcdir)/package.m4'
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010030
Alexander Huemer7b6673f2016-09-09 00:43:15 +020031EXTRA_DIST = \
32 testsuite.at \
33 $(srcdir)/package.m4 \
34 $(TESTSUITE) \
35 vty_test_runner.py \
36 ctrl_test_runner.py \
37 smpp_test_runner.py \
Neels Hofmeyr18333fa2018-12-05 02:24:30 +010038 test_nodes.vty \
Alexander Huemer7b6673f2016-09-09 00:43:15 +020039 $(NULL)
40
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +010041TESTSUITE = $(srcdir)/testsuite
Alexander Huemer7b6673f2016-09-09 00:43:15 +020042
43DISTCLEANFILES = \
44 atconfig \
45 $(NULL)
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010046
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +020047if ENABLE_EXT_TESTS
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010048# don't run multiple tests concurrently so that the ports don't conflict
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +020049python-tests: $(BUILT_SOURCES)
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010050 $(MAKE) vty-test
51 $(MAKE) ctrl-test
Holger Hans Peter Freythered0d4f62014-03-06 23:43:13 +010052if BUILD_SMPP
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010053 $(MAKE) smpp-test
Holger Hans Peter Freythered0d4f62014-03-06 23:43:13 +010054endif
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010055
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +020056else
57python-tests: $(BUILT_SOURCES)
58 echo "Not running python-based tests (determined at configure-time)"
59endif
60
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010061vty-python-test: $(BUILT_SOURCES)
62 osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
63 osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
64 $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
65 rm -f $(top_builddir)/sms.db
66
67# To update the VTY script from current application behavior,
68# pass -u to vty_script_runner.py by doing:
69# make vty-transcript-test U=-u
70vty-transcript-test:
Neels Hofmeyr18333fa2018-12-05 02:24:30 +010071 osmo_verify_transcript_vty.py -v \
72 -n OsmoMSC -p 4254 \
73 -r "$(top_builddir)/src/osmo-msc/osmo-msc -c $(top_srcdir)/doc/examples/osmo-msc/osmo-msc.cfg" \
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010074 $(U) $${T:-$(srcdir)/*.vty}
Neels Hofmeyr18333fa2018-12-05 02:24:30 +010075 rm -f $(builddir)/sms.db
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010076
77# don't run multiple tests concurrently so that the ports don't conflict
78vty-test:
79 $(MAKE) vty-python-test
80 $(MAKE) vty-transcript-test
81
82ctrl-python-test: $(BUILT_SOURCES)
83 $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
84 rm -f $(top_builddir)/sms.db
85
86# To update the CTRL script from current application behavior,
87# pass -u to ctrl_script_runner.py by doing:
88# make ctrl-transcript-test U=-u
89ctrl-transcript-test:
90 echo "No ctrl-transcript-test exists yet"
91
92# don't run multiple tests concurrently so that the ports don't conflict
93ctrl-test:
94 $(MAKE) ctrl-python-test
95 $(MAKE) ctrl-transcript-test
96
97smpp-test:
98 $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v
99 rm -f $(top_builddir)/sms.db
100
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100101check-local: atconfig $(TESTSUITE)
102 $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200103 $(MAKE) $(AM_MAKEFLAGS) python-tests
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100104
105installcheck-local: atconfig $(TESTSUITE)
106 $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
107 $(TESTSUITEFLAGS)
108
109clean-local:
110 test ! -f '$(TESTSUITE)' || \
111 $(SHELL) '$(TESTSUITE)' --clean
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100112
113AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
114AUTOTEST = $(AUTOM4TE) --language=autotest
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +0100115$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100116 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
117 mv $@.tmp $@