[PATCH libinput 1/2] test: Make udev path variables more explicitly named

Jonas Ådahl jadahl at gmail.com
Mon Jul 27 21:52:44 PDT 2015


This is to make room for more types of rules files.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 test/Makefile.am |  4 ++--
 test/litest.c    | 18 ++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 1c2852e..a9ddc85 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -45,8 +45,8 @@ liblitest_la_SOURCES = \
 	litest.c
 liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
 liblitest_la_CFLAGS = $(AM_CFLAGS) \
-	      -DLIBINPUT_UDEV_RULES_FILE="\"$(abs_top_builddir)/udev/90-libinput-model-quirks-litest.rules\"" \
-	      -DLIBINPUT_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
+	      -DLIBINPUT_MODEL_QUIRKS_UDEV_RULES_FILE="\"$(abs_top_builddir)/udev/90-libinput-model-quirks-litest.rules\"" \
+	      -DLIBINPUT_MODEL_QUIRKS_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
 if HAVE_LIBUNWIND
 liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
 liblitest_la_CFLAGS += $(LIBUNWIND_CFLAGS)
diff --git a/test/litest.c b/test/litest.c
index 2daf23a..45dabaa 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -53,8 +53,10 @@
 #define UDEV_RULES_D "/run/udev/rules.d"
 #define UDEV_RULE_PREFIX "99-litest-"
 #define UDEV_HWDB_D "/etc/udev/hwdb.d"
-#define UDEV_COMMON_RULE_FILE UDEV_RULES_D "/91-litest-model-quirks-REMOVEME.rules"
-#define UDEV_COMMON_HWDB_FILE UDEV_HWDB_D "/91-litest-model-quirks-REMOVEME.hwdb"
+#define UDEV_MODEL_QUIRKS_RULE_FILE UDEV_RULES_D \
+	"/91-litest-model-quirks-REMOVEME.rules"
+#define UDEV_MODEL_QUIRKS_HWDB_FILE UDEV_HWDB_D \
+	"/91-litest-model-quirks-REMOVEME.hwdb"
 
 static int in_debugger = -1;
 static int verbose = 0;
@@ -947,19 +949,19 @@ litest_install_model_quirks(void)
 			 "# running, remove this file and update your hwdb: \n"
 			 "#       sudo udevadm hwdb --update\n"
 			 "#################################################################\n\n";
-	litest_copy_file(UDEV_COMMON_RULE_FILE,
-			 LIBINPUT_UDEV_RULES_FILE,
+	litest_copy_file(UDEV_MODEL_QUIRKS_RULE_FILE,
+			 LIBINPUT_MODEL_QUIRKS_UDEV_RULES_FILE,
 			 warning);
-	litest_copy_file(UDEV_COMMON_HWDB_FILE,
-			 LIBINPUT_UDEV_HWDB_FILE,
+	litest_copy_file(UDEV_MODEL_QUIRKS_HWDB_FILE,
+			 LIBINPUT_MODEL_QUIRKS_UDEV_HWDB_FILE,
 			 warning);
 }
 
 static inline void
 litest_remove_model_quirks(void)
 {
-	unlink(UDEV_COMMON_RULE_FILE);
-	unlink(UDEV_COMMON_HWDB_FILE);
+	unlink(UDEV_MODEL_QUIRKS_RULE_FILE);
+	unlink(UDEV_MODEL_QUIRKS_HWDB_FILE);
 }
 
 static void
-- 
2.1.0



More information about the wayland-devel mailing list