summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2014-08-21 11:32:38 -0500
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-08-22 17:47:33 +0300
commitc7210434d45cff0135e42bd3047988e1274d49dd (patch)
treed02d76301beeda015f4ecaee650800173cd0487a /shared
parent3d3f48548ad4691fbc7fbc12486ff61bca0779df (diff)
downloadweston-c7210434d45cff0135e42bd3047988e1274d49dd.tar.gz
tests: allow running make check without make install
desktop shell and weston keyboard both refer to themselves prefixed by LIBEXECDIR, however this is only valid once installed. make check will currently either fail or run pre-existing versions. This patch adds a way to override that location by setting the env var WESTON_BUILD_DIR - which is then set by the test env script so make check will test the versions in the build directory regardless of whether they're installed or not. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'shared')
-rw-r--r--shared/config-parser.c12
-rw-r--r--shared/config-parser.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/shared/config-parser.c b/shared/config-parser.c
index 8defbbb4..4542ca61 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -282,6 +282,18 @@ weston_config_section_get_bool(struct weston_config_section *section,
return 0;
}
+WL_EXPORT
+const char *
+weston_config_get_libexec_dir(void)
+{
+ const char *path = getenv("WESTON_BUILD_DIR");
+
+ if (path)
+ return path;
+
+ return LIBEXECDIR;
+}
+
static struct weston_config_section *
config_add_section(struct weston_config *config, const char *name)
{
diff --git a/shared/config-parser.h b/shared/config-parser.h
index 745562bc..1ecc8cc2 100644
--- a/shared/config-parser.h
+++ b/shared/config-parser.h
@@ -92,6 +92,9 @@ int
weston_config_section_get_bool(struct weston_config_section *section,
const char *key,
int *value, int default_value);
+const char *
+weston_config_get_libexec_dir(void);
+
struct weston_config *
weston_config_parse(const char *name);