aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-06-29 13:01:18 -0700
committerHarald Welte <laforge@gnumonks.org>2012-06-30 22:01:42 +0200
commitea0e1eca2bc32b531242a3b0a3c471e492a6f493 (patch)
tree26b6bda92e3da6d056db3986c6ce942553e1ecfd /tests/Makefile.am
parent327009e4206dc5c50bcad21658872f547d3b6f25 (diff)
build: simplify test handling and speed up build.
Instead of using a ./configure parameter to decide whehter to build tests or not, use the check_PROGRAMS variable so that the tests are only built when running `make check`. To avoid slowing down the test phase itself, collapse the declaration of the test targets in the tests/Makefile.am file, this way they can be built and linked in parallel before the testsuite is executed. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am61
1 files changed, 50 insertions, 11 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index eff1ac4..308c691 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,9 +1,45 @@
-if ENABLE_TESTS
-SUBDIRS = timer sms ussd smscb bits a5 conv auth lapd gsm0808
+INCLUDES = $(all_includes) -I$(top_srcdir)/include
+
+check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \
+ smscb/smscb_test bits/bitrev_test a5/a5_test \
+ conv/conv_test auth/milenage_test lapd/lapd_test \
+ gsm0808/gsm0808_test
if ENABLE_MSGFILE
-SUBDIRS += msgfile
+check_PROGRAMS += msgfile/msgfile_test
endif
+a5_a5_test_SOURCES = a5/a5_test.c
+a5_a5_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+auth_milenage_test_SOURCES = auth/milenage_test.c
+auth_milenage_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+bits_bitrev_test_SOURCES = bits/bitrev_test.c
+bits_bitrev_test_LDADD = $(top_builddir)/src/libosmocore.la
+
+conv_conv_test_SOURCES = conv/conv_test.c
+conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la
+
+gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c
+gsm0808_gsm0808_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+lapd_lapd_test_SOURCES = lapd/lapd_test.c
+lapd_lapd_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+msgfile_msgfile_test_SOURCES = msgfile/msgfile_test.c
+msgfile_msgfile_test_LDADD = $(top_builddir)/src/libosmocore.la
+
+smscb_smscb_test_SOURCES = smscb/smscb_test.c
+smscb_smscb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+sms_sms_test_SOURCES = sms/sms_test.c
+sms_sms_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
+
+timer_timer_test_SOURCES = timer/timer_test.c
+timer_timer_test_LDADD = $(top_builddir)/src/libosmocore.la
+
+ussd_ussd_test_SOURCES = ussd/ussd_test.c
+ussd_ussd_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
@@ -22,26 +58,29 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
echo 'm4_define([AT_PACKAGE_URL],' && \
echo ' [$(PACKAGE_URL)])'; \
} >'$(srcdir)/package.m4'
-
-EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE)
+
+EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \
+ timer/timer_test.ok sms/sms_test.ok ussd/ussd_test.ok \
+ smscb/smscb_test.ok bits/bitrev_test.ok a5/a5_test.ok \
+ conv/conv_test.ok auth/milenage_test.ok \
+ lapd/lapd_test.ok gsm0808/gsm0808_test.ok \
+ msgfile/msgfile_test.ok msgfile/msgconfig.cfg
TESTSUITE = $(srcdir)/testsuite
-
+
check-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
-
+
installcheck-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
$(TESTSUITEFLAGS)
-
+
clean-local:
test ! -f '$(TESTSUITE)' || \
$(SHELL) '$(TESTSUITE)' --clean
$(RM) -f atconfig
-
+
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 $@
-
-endif