From 93ef33edb6f7436759e6276b5b208faf49a87f31 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 9 Jan 2012 22:53:04 +0100 Subject: tests: Use atlocal/atlocal.in to enable/disable the NAT test Kill the hacking, use atlocal to remember if the NAT test should be enabled and then skip the test (exit with 77). --- openbsc/tests/Makefile.am | 6 +----- openbsc/tests/atlocal.in | 1 + openbsc/tests/testsuite.at | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) create mode 100644 openbsc/tests/atlocal.in (limited to 'openbsc/tests') diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am index 73e8b89e6..9722b1458 100644 --- a/openbsc/tests/Makefile.am +++ b/openbsc/tests/Makefile.am @@ -2,14 +2,11 @@ SUBDIRS = debug gsm0408 db channel mgcp gprs if BUILD_NAT SUBDIRS += bsc-nat -ENABLE_NAT_TEST = echo 'm4_define([ENABLE_NAT_TEST], [1])'; -else -ENABLE_NAT_TEST = echo ''; endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. -$(srcdir)/package.m4: $(top_srcdir)/configure.ac $(top_builddir)/config.log +$(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ echo '# Signature of the current package.' && \ echo 'm4_define([AT_PACKAGE_NAME],' && \ @@ -24,7 +21,6 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac $(top_builddir)/config.log echo ' [$(PACKAGE_BUGREPORT)])'; \ echo 'm4_define([AT_PACKAGE_URL],' && \ echo ' [$(PACKAGE_URL)])'; \ - $(ENABLE_NAT_TEST) \ } >'$(srcdir)/package.m4' EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) diff --git a/openbsc/tests/atlocal.in b/openbsc/tests/atlocal.in new file mode 100644 index 000000000..0ce168b6a --- /dev/null +++ b/openbsc/tests/atlocal.in @@ -0,0 +1 @@ +enable_nat_test='@osmo_ac_build_nat@' diff --git a/openbsc/tests/testsuite.at b/openbsc/tests/testsuite.at index fb57d07b0..22f0b74fd 100644 --- a/openbsc/tests/testsuite.at +++ b/openbsc/tests/testsuite.at @@ -31,9 +31,9 @@ cat $abs_srcdir/gprs/gprs_test.ok > expout AT_CHECK([$abs_top_builddir/tests/gprs/gprs_test], [], [expout], [ignore]) AT_CLEANUP -m4_ifdef([ENABLE_NAT_TEST],[ AT_SETUP([bsc-nat]) AT_KEYWORDS([bsc-nat]) +AT_CHECK([test "$enable_nat_test" != no || exit 77]) cat $abs_srcdir/bsc-nat/bsc_nat_test.ok > expout AT_CHECK([$abs_top_builddir/tests/bsc-nat/bsc_nat_test], [], [expout], [ignore]) -AT_CLEANUP]) +AT_CLEANUP -- cgit v1.2.3