From 964b2a40239454e1c1e56b88a6aff27cdaa7c3be Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 19 Mar 2013 10:29:49 +0000 Subject: test: Suppress RMLVO environment inheritance by default But add a flag to allow it for later usage. Signed-off-by: Daniel Stone --- test/common.c | 16 +++++++++++++++- test/test.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'test') 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 * -- cgit v1.2.3