diff options
author | Daniel Stone <daniel@fooishbar.org> | 2013-03-19 10:29:49 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2013-03-19 10:54:23 +0000 |
commit | 964b2a40239454e1c1e56b88a6aff27cdaa7c3be (patch) | |
tree | 5c01dc80175672e07ac85deee2cc99d7cd262f19 /test | |
parent | fbe5e6751e7ac806f8d55689e02966a1b995f3af (diff) |
test: Suppress RMLVO environment inheritance by default
But add a flag to allow it for later usage.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/common.c | 16 | ||||
-rw-r--r-- | test/test.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/test/common.c b/test/common.c index df79272..2ed23cf 100644 --- a/test/common.c +++ b/test/common.c @@ -185,8 +185,22 @@ test_read_file(const char *path_rel) struct xkb_context * test_get_context(enum test_context_flags test_flags) { - struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES); + enum xkb_context_flags ctx_flags; + struct xkb_context *ctx; + + ctx_flags = XKB_CONTEXT_NO_DEFAULT_INCLUDES; + if (test_flags & CONTEXT_ALLOW_ENVIRONMENT_NAMES) { + unsetenv("XKB_DEFAULT_RULES"); + unsetenv("XKB_DEFAULT_MODEL"); + unsetenv("XKB_DEFAULT_LAYOUT"); + unsetenv("XKB_DEFAULT_VARIANT"); + unsetenv("XKB_DEFAULT_OPTIONS"); + } + else { + ctx_flags |= XKB_CONTEXT_NO_ENVIRONMENT_NAMES; + } + ctx = xkb_context_new(ctx_flags); if (!ctx) return NULL; diff --git a/test/test.h b/test/test.h index b90bdd9..d3e3f62 100644 --- a/test/test.h +++ b/test/test.h @@ -54,6 +54,7 @@ test_read_file(const char *path_rel); enum test_context_flags { CONTEXT_NO_FLAG = 0, + CONTEXT_ALLOW_ENVIRONMENT_NAMES = (1 << 0), }; struct xkb_context * |