summaryrefslogtreecommitdiffstats
path: root/openbsc/tests/Makefile.am
blob: 1df4d026b8d35ddc9d29e4dd478e8095fbd90534 (plain)
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
SUBDIRS = \
	libiudummy \
	gsm0408 \
	channel \
	mgcp \
	gprs \
	abis \
	gbproxy \
	trau \
	subscr \
	mm_auth \
	nanobts_omlattr \
	vlr \
	sms_queue \
	msc_vlr \
	$(NULL)

if BUILD_NAT
SUBDIRS += \
	bsc-nat \
	bsc-nat-trie \
	$(NULL)
endif
if BUILD_BSC
SUBDIRS += \
	bsc \
	$(NULL)
endif
if BUILD_SMPP
SUBDIRS += \
	smpp \
	$(NULL)
endif
if HAVE_LIBGTP
SUBDIRS += \
	gtphub \
	$(NULL)

if HAVE_LIBCARES
SUBDIRS += \
	sgsn \
	oap \
	xid \
	sndcp_xid \
	slhc \
	v42bis \
	$(NULL)
endif
endif

# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
	:;{ \
               echo '# Signature of the current package.' && \
               echo 'm4_define([AT_PACKAGE_NAME],' && \
               echo '  [$(PACKAGE_NAME)])' && \
               echo 'm4_define([AT_PACKAGE_TARNAME],' && \
               echo '  [$(PACKAGE_TARNAME)])' && \
               echo 'm4_define([AT_PACKAGE_VERSION],' && \
               echo '  [$(PACKAGE_VERSION)])' && \
               echo 'm4_define([AT_PACKAGE_STRING],' && \
               echo '  [$(PACKAGE_STRING)])' && \
               echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
               echo '  [$(PACKAGE_BUGREPORT)])'; \
               echo 'm4_define([AT_PACKAGE_URL],' && \
               echo '  [$(PACKAGE_URL)])'; \
             } >'$(srcdir)/package.m4'

EXTRA_DIST = \
	testsuite.at \
	$(srcdir)/package.m4 \
	$(TESTSUITE) \
	vty_test_runner.py \
	ctrl_test_runner.py \
	smpp_test_runner.py \
	$(NULL)

TESTSUITE = $(srcdir)/testsuite

DISTCLEANFILES = \
	atconfig \
	$(NULL)

if ENABLE_EXT_TESTS
python-tests: $(BUILT_SOURCES)
	osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
	osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
	$(PYTHON) $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
	$(PYTHON) $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
if BUILD_SMPP
	$(PYTHON) $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v
endif
	rm -f $(top_builddir)/hlr.sqlite3
else
python-tests: $(BUILT_SOURCES)
	echo "Not running python-based tests (determined at configure-time)"
endif

check-local: atconfig $(TESTSUITE)
	$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
	$(MAKE) $(AM_MAKEFLAGS) python-tests

installcheck-local: atconfig $(TESTSUITE)
	$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
		$(TESTSUITEFLAGS)

clean-local:
	test ! -f '$(TESTSUITE)' || \
		$(SHELL) '$(TESTSUITE)' --clean

AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
	$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
	mv $@.tmp $@