blob: 0cbf998dafca8e07358c40f3ff47236287ef213b [file] [log] [blame]
Harald Welteb53e2bf2020-08-21 16:33:42 +02001SUBDIRS = \
2 $(NULL)
3
4# The `:;' works around a Bash 3.2 bug when the output is not writeable.
5$(srcdir)/package.m4: $(top_srcdir)/configure.ac
6 :;{ \
7 echo '# Signature of the current package.' && \
8 echo 'm4_define([AT_PACKAGE_NAME],' && \
9 echo ' [$(PACKAGE_NAME)])' && \
10 echo 'm4_define([AT_PACKAGE_TARNAME],' && \
11 echo ' [$(PACKAGE_TARNAME)])' && \
12 echo 'm4_define([AT_PACKAGE_VERSION],' && \
13 echo ' [$(PACKAGE_VERSION)])' && \
14 echo 'm4_define([AT_PACKAGE_STRING],' && \
15 echo ' [$(PACKAGE_STRING)])' && \
16 echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
17 echo ' [$(PACKAGE_BUGREPORT)])'; \
18 echo 'm4_define([AT_PACKAGE_URL],' && \
19 echo ' [$(PACKAGE_URL)])'; \
20 } >'$(srcdir)/package.m4'
21
22EXTRA_DIST = \
23 testsuite.at \
24 $(srcdir)/package.m4 \
25 $(TESTSUITE) \
26 test_nodes.vty \
Harald Welte97362c52020-08-23 20:29:20 +020027 test_nodes.ctrl \
Harald Welteb53e2bf2020-08-21 16:33:42 +020028 $(NULL)
29
30TESTSUITE = $(srcdir)/testsuite
31
32DISTCLEANFILES = \
33 atconfig \
34 $(NULL)
35
36if ENABLE_EXT_TESTS
37python-tests: $(BUILT_SOURCES)
38 $(MAKE) vty-test
39 $(MAKE) ctrl-test
40else
41python-tests: $(BUILT_SOURCES)
42 echo "Not running python-based tests (determined at configure-time)"
43endif
44
45# Run a specific test with: 'make vty-test VTY_TEST=osmo-smlc.vty'
46VTY_TEST ?= *.vty
47
48# To update the VTY script from current application behavior,
49# pass -u to vty_script_runner.py by doing:
50# make vty-test U=-u
51vty-test:
52 osmo_verify_transcript_vty.py -v \
53 -n OsmoSMLC -p 4271 \
54 -r "$(top_builddir)/src/osmo-smlc/osmo-smlc -c $(top_srcdir)/doc/examples/osmo-smlc/osmo-smlc.cfg" \
55 $(U) $(srcdir)/$(VTY_TEST)
56
57# To update the CTRL script from current application behavior,
58# pass -u to ctrl_script_runner.py by doing:
59# make ctrl-test U=-u
60ctrl-test:
61 -rm -f $(CTRL_TEST_DB)
62 osmo_verify_transcript_ctrl.py -v \
63 -p 4272 \
Harald Welte97362c52020-08-23 20:29:20 +020064 -r "$(top_builddir)/src/osmo-smlc/osmo-smlc -c $(top_srcdir)/doc/examples/osmo-smlc/osmo-smlc.cfg" \
Harald Welteb53e2bf2020-08-21 16:33:42 +020065 $(U) $(srcdir)/*.ctrl
66 -rm -f $(CTRL_TEST_DB)
67 -rm $(CTRL_TEST_DB)-*
68
69check-local: atconfig $(TESTSUITE)
70 $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
71 $(MAKE) $(AM_MAKEFLAGS) python-tests
72
73installcheck-local: atconfig $(TESTSUITE)
74 $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
75 $(TESTSUITEFLAGS)
76
77clean-local:
78 test ! -f '$(TESTSUITE)' || \
79 $(SHELL) '$(TESTSUITE)' --clean
80
81AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
82AUTOTEST = $(AUTOM4TE) --language=autotest
83$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
84 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
85 mv $@.tmp $@