Commit 878bc085591d0853f0f8a4b9f36fef346bb34c88

Peter Hutterer 2018-08-20T16:46:19

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>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);