test: allow for absolute paths to be resolved This makes it possible to check a keymap sitting elsewhere than in the test directory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/test/common.c b/test/common.c
index 1ee34e3..c909707 100644
--- a/test/common.c
+++ b/test/common.c
@@ -161,6 +161,9 @@ test_get_path(const char *path_rel)
size_t path_len;
const char *srcdir = getenv("top_srcdir");
+ if (path_rel[0] == '/')
+ return strdup(path_rel);
+
path_len = strlen(srcdir ? srcdir : ".") +
strlen(path_rel ? path_rel : "") + 12;
path = malloc(path_len);