summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--tests/lib/test_frrlua.py14
-rw-r--r--tests/lib/test_frrscript.py14
-rw-r--r--tests/subdir.am24
4 files changed, 44 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 96bacc9ed4..ad63364566 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,6 +289,8 @@ if test "$enable_clang_coverage" = "yes"; then
])
fi
+AM_CONDITIONAL([SCRIPTING], [test "$enable_scripting" = "yes"])
+
if test "$enable_scripting" = "yes"; then
AX_PROG_LUA([5.3], [5.4], [], [
AC_MSG_ERROR([Lua 5.3 is required to build with Lua support. No other version is supported.])
@@ -299,7 +301,9 @@ if test "$enable_scripting" = "yes"; then
AX_LUA_LIBS([
AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
LIBS="$LIBS $LUA_LIB"
+ SCRIPTING=true
], [
+ SCRIPTING=false
AC_MSG_ERROR([Lua 5.3 libraries are required to build with Lua support. No other version is supported.])
])
fi
diff --git a/tests/lib/test_frrlua.py b/tests/lib/test_frrlua.py
index e4943f9ae2..2f6ddc1c07 100644
--- a/tests/lib/test_frrlua.py
+++ b/tests/lib/test_frrlua.py
@@ -1,8 +1,14 @@
import frrtest
+import pytest
+if 'S["SCRIPTING_TRUE"]=""\n' not in open("../config.status").readlines():
+ class TestFrrlua:
+ @pytest.mark.skipif(True, reason="Test unsupported")
+ def test_exit_cleanly(self):
+ pass
+else:
-class TestFrrlua(frrtest.TestMultiOut):
- program = "./test_frrlua"
+ class TestFrrlua(frrtest.TestMultiOut):
+ program = "./test_frrlua"
-
-TestFrrlua.exit_cleanly()
+ TestFrrlua.exit_cleanly()
diff --git a/tests/lib/test_frrscript.py b/tests/lib/test_frrscript.py
index 46c6d99957..046d97b014 100644
--- a/tests/lib/test_frrscript.py
+++ b/tests/lib/test_frrscript.py
@@ -1,8 +1,14 @@
import frrtest
+import pytest
+if 'S["SCRIPTING_TRUE"]=""\n' not in open("../config.status").readlines():
+ class TestFrrscript:
+ @pytest.mark.skipif(True, reason="Test unsupported")
+ def test_exit_cleanly(self):
+ pass
+else:
-class TestFrrscript(frrtest.TestMultiOut):
- program = "./test_frrscript"
+ class TestFrrscript(frrtest.TestMultiOut):
+ program = "./test_frrscript"
-
-TestFrrscript.exit_cleanly()
+ TestFrrscript.exit_cleanly()
diff --git a/tests/subdir.am b/tests/subdir.am
index c9cfe8a324..c2153140f5 100644
--- a/tests/subdir.am
+++ b/tests/subdir.am
@@ -59,6 +59,15 @@ TESTS_ZEBRA =
IGNORE_ZEBRA = --ignore=zebra/
endif
+if SCRIPTING
+TESTS_SCRIPTING = \
+ tests/lib/test_frrlua \
+ tests/lib/test_frrscript \
+ #end
+else
+TESTS_SCRIPTING =
+endif
+
clippy_scan += \
tests/lib/cli/test_cli.c \
tests/ospf6d/test_lsdb.c \
@@ -70,8 +79,6 @@ check_PROGRAMS = \
tests/lib/test_atomlist \
tests/lib/test_buffer \
tests/lib/test_checksum \
- tests/lib/test_frrlua \
- tests/lib/test_frrscript \
tests/lib/test_heavy_thread \
tests/lib/test_heavy_wq \
tests/lib/test_heavy \
@@ -106,6 +113,7 @@ check_PROGRAMS = \
$(TESTS_OSPFD) \
$(TESTS_OSPF6D) \
$(TESTS_ZEBRA) \
+ $(TESTS_SCRIPTING) \
# end
if GRPC
@@ -291,6 +299,7 @@ tests_lib_test_checksum_CFLAGS = $(TESTS_CFLAGS)
tests_lib_test_checksum_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_test_checksum_LDADD = $(ALL_TESTS_LDADD)
tests_lib_test_checksum_SOURCES = tests/lib/test_checksum.c
+if SCRIPTING
tests_lib_test_frrlua_CFLAGS = $(TESTS_CFLAGS)
tests_lib_test_frrlua_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_test_frrlua_LDADD = $(ALL_TESTS_LDADD)
@@ -299,6 +308,7 @@ tests_lib_test_frrscript_CFLAGS = $(TESTS_CFLAGS)
tests_lib_test_frrscript_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_test_frrscript_LDADD = $(ALL_TESTS_LDADD)
tests_lib_test_frrscript_SOURCES = tests/lib/test_frrscript.c
+endif
tests_lib_test_graph_CFLAGS = $(TESTS_CFLAGS)
tests_lib_test_graph_CPPFLAGS = $(TESTS_CPPFLAGS)
tests_lib_test_graph_LDADD = $(ALL_TESTS_LDADD)
@@ -448,8 +458,6 @@ EXTRA_DIST += \
tests/lib/northbound/test_oper_data.refout \
tests/lib/test_assert.py \
tests/lib/test_atomlist.py \
- tests/lib/test_frrscript.py \
- tests/lib/test_frrlua.py \
tests/lib/test_nexthop_iter.py \
tests/lib/test_nexthop.py \
tests/lib/test_ntop.py \
@@ -476,6 +484,14 @@ EXTRA_DIST += \
tests/zebra/test_lm_plugin.refout \
# end
+
+if SCRIPTING
+EXTRA_DIST += \
+ tests/lib/test_frrscript.py \
+ tests/lib/test_frrlua.py \
+ #end
+endif
+
.PHONY: tests/tests.xml
tests/tests.xml: $(check_PROGRAMS)
( cd tests; $(PYTHON) ../$(srcdir)/tests/runtests.py --junitxml=tests.xml -v ../$(srcdir)/tests $(IGNORE_BGPD) $(IGNORE_ISISD) $(IGNORE_OSPF6D); )