aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-24 22:24:44 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-24 22:28:35 +0200
commitf896df6b8ed6b3751086d36e9738a143365f968c (patch)
tree52a42f236f0f48cd79d46c65e65c02e98f6e6edd
parent9a333be20be5715993c9a6d4f14bd9826d0a30de (diff)
distcheck/tests: Add the referenced osmoappdesc.py for testing
distcheck fails because the file is not present. Write it out to get our standard vty checking to work. Add simple Makefile and call it.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac20
-rw-r--r--osmoappdesc.py29
-rw-r--r--tests/Makefile.am11
4 files changed, 61 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 2145cce..abb1d66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
-SUBDIRS = src
+SUBDIRS = src tests
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen osmoappdesc.py .version
diff --git a/configure.ac b/configure.ac
index d4a39a8..0b42951 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,7 +11,27 @@ PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.8.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)
PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)
+AC_ARG_ENABLE([vty_tests],
+ AC_HELP_STRING([--enable-vty-tests],
+ [Include the VTY/CTRL tests in make check (deprecated)
+ [default=no]]),
+ [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
+AC_ARG_ENABLE([external_tests],
+ AC_HELP_STRING([--enable-external-tests],
+ [Include the VTY/CTRL tests in make check [default=no]]),
+ [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
+if test "x$enable_ext_tests" = "xyes" ; then
+ AM_PATH_PYTHON
+ AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
+ if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
+ AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.])
+ fi
+fi
+AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
+AC_MSG_RESULT([$enable_ext_tests])
+AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
AC_OUTPUT(
src/Makefile
+ tests/Makefile
Makefile)
diff --git a/osmoappdesc.py b/osmoappdesc.py
new file mode 100644
index 0000000..7b8bdf8
--- /dev/null
+++ b/osmoappdesc.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+# (C) 2016 by Holger Hans Peter Freyther
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>
+
+
+app_configs = {
+ "osmo-sip-connector": ["doc/examples/osmo-sip-connector.cfg"]
+}
+
+apps = [
+ (4256, "src/osmo-sip-connector", "OsmoMNCC", "osmo-sip-connector")
+]
+
+vty_command = ["./src/osmo-sip-connector", "-c",
+ "doc/examples/osmo-sip-connector.cfg"]
+vty_app = apps[0]
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..a8e6738
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,11 @@
+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
+else
+python-tests: $(BUILT_SOURCES)
+ echo "Not running python-based tests (determined at configure-time)"
+endif
+
+check-local:
+ $(MAKE) $(AM_MAKEFLAGS) python-tests