summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-02-18 16:26:29 +0100
committerTormod Volden <debian.tormod@gmail.com>2022-03-18 18:49:21 +0100
commit50b5838183611144d1133b5a58def2f058db0e6e (patch)
treebe8ca06a9f62f5be701764f9ecb78444ab7ea51a /configure.ac
parent74059154ee1541e18f42e6815ece97be0df2c661 (diff)
downloadlibusb-50b5838183611144d1133b5a58def2f058db0e6e.tar.gz
tests: Add some umockdev based tests
Add some basic umockdev tests. The setup in this case is all in one process, but umockdev in principle could also work between processes. This is just a start, more tests would make sense.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 97712d9..d4f1251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,6 +179,14 @@ linux)
dnl system has udev. use it or fail!
AC_CHECK_HEADER([libudev.h], [], [AC_MSG_ERROR([udev support requested but libudev header not installed])])
AC_CHECK_LIB([udev], [udev_new], [], [AC_MSG_ERROR([udev support requested but libudev not installed])])
+
+ # We can build umockdev tests (if available)
+ PKG_PROG_PKG_CONFIG
+ PKG_CHECK_MODULES(UMOCKDEV, umockdev-1.0 >= 0.16.0, ac_have_umockdev=yes, ac_have_umockdev=no)
+ PKG_CHECK_MODULES(UMOCKDEV_HOTPLUG, umockdev-1.0 >= 0.17.7, ac_umockdev_hotplug=yes, ac_umockdev_hotplug=no)
+ if test "x$ac_umockdev_hotplug" = xyes; then
+ AC_DEFINE([UMOCKDEV_HOTPLUG], [1], [UMockdev hotplug code is not racy])
+ fi
else
AC_CHECK_HEADERS([asm/types.h])
AC_CHECK_HEADER([linux/netlink.h], [], [AC_MSG_ERROR([Linux netlink header not found])])
@@ -358,6 +366,7 @@ AC_ARG_ENABLE([tests-build],
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != xno])
AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != xno])
+AM_CONDITIONAL([BUILD_UMOCKDEV_TEST], [test "x$ac_have_umockdev" = xyes -a "x$log_enabled" != xno])
AM_CONDITIONAL([CREATE_IMPORT_LIB], [test "x$create_import_lib" = xyes])
AM_CONDITIONAL([OS_DARWIN], [test "x$backend" = xdarwin])
AM_CONDITIONAL([OS_HAIKU], [test "x$backend" = xhaiku])