mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-03 15:27:58 +02:00
udev: make sure the udev callout path is valid for a test run
udev requires callout binaries to sit in /lib/udev or otherwise provide an absolute path. The test suite should work without installing everything first, so create two rule files - one to install, one with the path to the $builddir/test Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
cc59c8986f
commit
4e39443757
6 changed files with 24 additions and 3 deletions
10
configure.ac
10
configure.ac
|
|
@ -184,6 +184,12 @@ AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
|
||||||
AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
|
AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
|
||||||
AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
|
AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
|
||||||
|
|
||||||
|
# Used by the udev rules so we can use callouts during testing without
|
||||||
|
# installing everything first. Default is the empty string so the installed
|
||||||
|
# rule will use udev's default path. Override is in udev/Makefile.am
|
||||||
|
AC_SUBST(UDEV_TEST_PATH, "")
|
||||||
|
AC_PATH_PROG(SED, [sed])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
doc/libinput.doxygen
|
doc/libinput.doxygen
|
||||||
|
|
@ -192,7 +198,9 @@ AC_CONFIG_FILES([Makefile
|
||||||
src/libinput-version.h
|
src/libinput-version.h
|
||||||
test/Makefile
|
test/Makefile
|
||||||
tools/Makefile
|
tools/Makefile
|
||||||
udev/Makefile])
|
udev/Makefile
|
||||||
|
udev/80-libinput-device-groups.rules
|
||||||
|
udev/90-libinput-model-quirks.rules])
|
||||||
AC_CONFIG_FILES([test/symbols-leak-test],
|
AC_CONFIG_FILES([test/symbols-leak-test],
|
||||||
[chmod +x test/symbols-leak-test])
|
[chmod +x test/symbols-leak-test])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ liblitest_la_SOURCES = \
|
||||||
litest.c
|
litest.c
|
||||||
liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
|
liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
|
||||||
liblitest_la_CFLAGS = $(AM_CFLAGS) \
|
liblitest_la_CFLAGS = $(AM_CFLAGS) \
|
||||||
-DLIBINPUT_UDEV_RULES_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.rules\"" \
|
-DLIBINPUT_UDEV_RULES_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks-litest.rules\"" \
|
||||||
-DLIBINPUT_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
|
-DLIBINPUT_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
|
||||||
if HAVE_LIBUNWIND
|
if HAVE_LIBUNWIND
|
||||||
liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
|
liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
|
||||||
|
|
|
||||||
1
udev/.gitignore
vendored
1
udev/.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
libinput-device-group
|
libinput-device-group
|
||||||
|
*.rules
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ ACTION!="add|change", GOTO="libinput_device_group_end"
|
||||||
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
|
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
|
||||||
|
|
||||||
ATTRS{phys}=="?*", \
|
ATTRS{phys}=="?*", \
|
||||||
PROGRAM="libinput-device-group %S%p", \
|
PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \
|
||||||
ENV{LIBINPUT_DEVICE_GROUP}="%c"
|
ENV{LIBINPUT_DEVICE_GROUP}="%c"
|
||||||
|
|
||||||
LABEL="libinput_device_group_end"
|
LABEL="libinput_device_group_end"
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
udevdir=$(UDEV_DIR)
|
udevdir=$(UDEV_DIR)
|
||||||
udev_PROGRAMS = libinput-device-group
|
udev_PROGRAMS = libinput-device-group
|
||||||
|
|
||||||
|
litest_rules = 80-libinput-device-groups-litest.rules \
|
||||||
|
90-libinput-model-quirks-litest.rules
|
||||||
|
udev_SCRIPTS = $(litest_rules)
|
||||||
|
|
||||||
libinput_device_group_SOURCES = libinput-device-group.c
|
libinput_device_group_SOURCES = libinput-device-group.c
|
||||||
libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS)
|
libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS)
|
||||||
libinput_device_group_LDADD = $(LIBUDEV_LIBS)
|
libinput_device_group_LDADD = $(LIBUDEV_LIBS)
|
||||||
|
|
@ -13,3 +17,11 @@ dist_udev_rules_DATA = \
|
||||||
udev_hwdbdir=$(UDEV_DIR)/hwdb.d
|
udev_hwdbdir=$(UDEV_DIR)/hwdb.d
|
||||||
dist_udev_hwdb_DATA = \
|
dist_udev_hwdb_DATA = \
|
||||||
90-libinput-model-quirks.hwdb
|
90-libinput-model-quirks.hwdb
|
||||||
|
|
||||||
|
%-litest.rules: %.rules.in
|
||||||
|
$(SED) -e "s|\@UDEV_TEST_PATH\@|$(abs_builddir)/|" < $^ > $@
|
||||||
|
|
||||||
|
CLEANFILES = $(litest_rules)
|
||||||
|
DISTCLEANFILES = \
|
||||||
|
80-libinput-device-groups.rules \
|
||||||
|
90-libinput-model-quirks.rules
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue