aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2019-03-15 11:01:44 +0100
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2019-03-20 10:49:44 +0100
commit6cf91dd02d9d7e63025d5852a65db39ec9a1168e (patch)
tree3793c8ffc27b15ee0876622ca9b44475d715c12e
parentdb5f8cba64ada23a1b8014eda0f5f4b65d706992 (diff)
downloadlibgpiod-6cf91dd02d9d7e63025d5852a65db39ec9a1168e.tar.gz
tests: enable installing tests to bindir
Add an enable option to configure that allows to install the testing binary to <prefix>/bindir. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> [Bartosz: trimmed the patch to fit the new approach] Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
-rw-r--r--configure.ac7
-rw-r--r--tests/Makefile.am4
2 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4adff7b7..8a9b81db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,13 @@ then
AC_CHECK_HEADERS([sys/signalfd.h], [], [HEADER_NOT_FOUND_TOOLS([sys/signalfd.h])])
fi
+AC_ARG_ENABLE([install-tests],
+ [AC_HELP_STRING([--enable-install-tests],
+ [enable install tests [default=no]])],
+ [if test "x$enableval" = xyes; then with_install_tests=true; with_tests=true; fi],
+ [with_install_tests=false])
+AM_CONDITIONAL([WITH_INSTALL_TESTS], [test "x$with_install_tests" = xtrue])
+
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests],
[enable libgpiod tests [default=no]])],
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a6593b9e..4d1e6d5e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -11,7 +11,11 @@ AM_CFLAGS += -Wall -Wextra -g $(KMOD_CFLAGS) $(UDEV_CFLAGS)
AM_LDFLAGS = -pthread
LDADD = $(top_builddir)/lib/libgpiod.la $(KMOD_LIBS) $(UDEV_LIBS)
+if WITH_INSTALL_TESTS
+bin_PROGRAMS = gpiod-test
+else
check_PROGRAMS = gpiod-test
+endif
gpiod_test_SOURCES = gpiod-test.c \
gpiod-test.h \