]> git.meshlink.io Git - meshlink/commitdiff
Add autoconf checks for LXC and cmocka.
authorGuus Sliepen <guus@meshlink.io>
Sun, 18 Nov 2018 14:15:13 +0000 (15:15 +0100)
committerGuus Sliepen <guus@meshlink.io>
Sun, 18 Nov 2018 14:15:13 +0000 (15:15 +0100)
If LXC or cmocka are not installed, don't build the blackbox test suite.

configure.ac
test/Makefile.am
test/blackbox/run_blackbox_tests/Makefile.am

index ed193cd42a17563f9de0db2bbe2b6cc03b176b76..275bf5f138cbbf54f6f2e1fd9763cf177e80b8d4 100644 (file)
@@ -91,6 +91,11 @@ AS_IF([test "x$enable_utcp_debug" = "xyes"],
   ]
 );
 
+dnl Blackbox test suite
+PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.0], [cmocka=true], [cmocka=false])
+PKG_CHECK_MODULES([LXC], [lxc >= 2.0.0], [lxc=true], [lxc=false])
+AM_CONDITIONAL(BLACKBOX_TESTS, test "$cmocka" = true -a "$lxc" = true)
+
 dnl Install test binaries
 AC_ARG_ENABLE([install_tests],
   [AS_HELP_STRING([--enable-install-tests], [include test binaries in installation])],
index 77fd5ef1828734e739aaa2d66b0b8504dd7f4f99..dce3747643128b3d2133f21f8cd6ead70b3d9841 100644 (file)
@@ -10,7 +10,9 @@ TESTS = \
        sign-verify.test \
        trio.test
 
+if BLACKBOX_TESTS
 SUBDIRS = blackbox
+endif
 
 dist_check_SCRIPTS = $(TESTS)
 
index 5b6877dfa2504072b9fb902ad81ccded8712199d..f5691ea49524c8814661b5e6c73f4f1bfba2453f 100644 (file)
@@ -47,6 +47,6 @@ run_blackbox_tests_SOURCES = \
        test_cases_channel_shutdown.c \
        test_cases_channel_conn.c
 
-run_blackbox_tests_LDADD = ../../../src/libmeshlink.la -llxc -lcmocka
-run_blackbox_tests_CFLAGS = -D_GNU_SOURCE
+run_blackbox_tests_LDADD = ../../../src/libmeshlink.la $(LXC_LIBS) $(CMOCKA_LIBS)
+run_blackbox_tests_CFLAGS = -D_GNU_SOURCE $(LXC_CFLAGS) $(CMOCKA_CFLAGS)