From ea0e1eca2bc32b531242a3b0a3c471e492a6f493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Fri, 29 Jun 2012 13:01:18 -0700 Subject: build: simplify test handling and speed up build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ò --- tests/Makefile.am | 61 ++++++++++++++++++++++++++++++++++++++--------- tests/a5/Makefile.am | 6 ----- tests/auth/Makefile.am | 8 ------- tests/bits/Makefile.am | 7 ------ tests/conv/Makefile.am | 6 ----- tests/gsm0808/Makefile.am | 6 ----- tests/lapd/Makefile.am | 9 ------- tests/msgfile/Makefile.am | 6 ----- tests/sms/Makefile.am | 6 ----- tests/smscb/Makefile.am | 6 ----- tests/timer/Makefile.am | 7 ------ tests/ussd/Makefile.am | 6 ----- 12 files changed, 50 insertions(+), 84 deletions(-) delete mode 100644 tests/a5/Makefile.am delete mode 100644 tests/auth/Makefile.am delete mode 100644 tests/bits/Makefile.am delete mode 100644 tests/conv/Makefile.am delete mode 100644 tests/gsm0808/Makefile.am delete mode 100644 tests/lapd/Makefile.am delete mode 100644 tests/msgfile/Makefile.am delete mode 100644 tests/sms/Makefile.am delete mode 100644 tests/smscb/Makefile.am delete mode 100644 tests/timer/Makefile.am delete mode 100644 tests/ussd/Makefile.am (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index eff1ac44..308c6910 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 diff --git a/tests/a5/Makefile.am b/tests/a5/Makefile.am deleted file mode 100644 index 3c6e6ba4..00000000 --- a/tests/a5/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = a5_test -EXTRA_DIST = a5_test.ok - -a5_test_SOURCES = a5_test.c -a5_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la diff --git a/tests/auth/Makefile.am b/tests/auth/Makefile.am deleted file mode 100644 index 52976d02..00000000 --- a/tests/auth/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = milenage_test -EXTRA_DIST = milenage_test.ok - -milenage_test_SOURCES = milenage_test.c -milenage_test_LDADD = $(top_builddir)/src/libosmocore.la \ - $(top_builddir)/src/gsm/libosmogsm.la - diff --git a/tests/bits/Makefile.am b/tests/bits/Makefile.am deleted file mode 100644 index d6fb2f2f..00000000 --- a/tests/bits/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = bitrev_test -EXTRA_DIST = bitrev_test.ok - -bitrev_test_SOURCES = bitrev_test.c -bitrev_test_LDADD = $(top_builddir)/src/libosmocore.la - diff --git a/tests/conv/Makefile.am b/tests/conv/Makefile.am deleted file mode 100644 index 75cfec8d..00000000 --- a/tests/conv/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = conv_test -EXTRA_DIST = conv_test.ok - -conv_test_SOURCES = conv_test.c -conv_test_LDADD = $(top_builddir)/src/libosmocore.la diff --git a/tests/gsm0808/Makefile.am b/tests/gsm0808/Makefile.am deleted file mode 100644 index a238e7f3..00000000 --- a/tests/gsm0808/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = gsm0808_test -EXTRA_DIST = gsm0808_test.ok - -gsm0808_test_SOURCES = gsm0808_test.c -gsm0808_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la diff --git a/tests/lapd/Makefile.am b/tests/lapd/Makefile.am deleted file mode 100644 index f7e2ab0e..00000000 --- a/tests/lapd/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -AM_FLAGS = -Wall -O0 -noinst_PROGRAMS = lapd_test -EXTRA_DIST = lapd_test.ok - -lapd_test_SOURCES = lapd_test.c -lapd_test_LDADD = \ - $(top_builddir)/src/libosmocore.la \ - $(top_builddir)/src/gsm/libosmogsm.la diff --git a/tests/msgfile/Makefile.am b/tests/msgfile/Makefile.am deleted file mode 100644 index 88c355db..00000000 --- a/tests/msgfile/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = msgfile_test -EXTRA_DIST = msgfile_test.ok msgconfig.cfg - -msgfile_test_SOURCES = msgfile_test.c -msgfile_test_LDADD = $(top_builddir)/src/libosmocore.la diff --git a/tests/sms/Makefile.am b/tests/sms/Makefile.am deleted file mode 100644 index 02860afe..00000000 --- a/tests/sms/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = sms_test -EXTRA_DIST = sms_test.ok - -sms_test_SOURCES = sms_test.c -sms_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la diff --git a/tests/smscb/Makefile.am b/tests/smscb/Makefile.am deleted file mode 100644 index 7045ea76..00000000 --- a/tests/smscb/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = smscb_test -EXTRA_DIST = smscb_test.ok - -smscb_test_SOURCES = smscb_test.c -smscb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la diff --git a/tests/timer/Makefile.am b/tests/timer/Makefile.am deleted file mode 100644 index 062d81b3..00000000 --- a/tests/timer/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = timer_test -EXTRA_DIST = timer_test.ok - -timer_test_SOURCES = timer_test.c -timer_test_LDADD = $(top_builddir)/src/libosmocore.la - diff --git a/tests/ussd/Makefile.am b/tests/ussd/Makefile.am deleted file mode 100644 index de9ff892..00000000 --- a/tests/ussd/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -noinst_PROGRAMS = ussd_test -EXTRA_DIST = ussd_test.ok - -ussd_test_SOURCES = ussd_test.c -ussd_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la -- cgit v1.2.3