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>
master
Peter Hutterer 2018-08-20 16:46:19 +10:00
parent 16c84cdd81
commit 878bc08559
1 changed files with 3 additions and 0 deletions

View File

@ -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);