test: Add flags argument to test_get_context()
Allowing overriding of environment suppression, at first. Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
a1f203c031
commit
54f95f496f
|
@ -58,7 +58,7 @@ main(void)
|
|||
struct xkb_state *state;
|
||||
struct timespec start, stop, elapsed;
|
||||
|
||||
ctx = test_get_context();
|
||||
ctx = test_get_context(0);
|
||||
assert(ctx);
|
||||
|
||||
keymap = test_compile_rules(ctx, "evdev", "pc104", "us,ru,il,de",
|
||||
|
|
|
@ -183,7 +183,7 @@ test_read_file(const char *path_rel)
|
|||
}
|
||||
|
||||
struct xkb_context *
|
||||
test_get_context(void)
|
||||
test_get_context(enum test_context_flags test_flags)
|
||||
{
|
||||
struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
struct xkb_context *context = test_get_context();
|
||||
struct xkb_context *context = test_get_context(0);
|
||||
|
||||
assert(context);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ test_file(struct xkb_context *ctx, const char *path_rel)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
struct xkb_context *ctx = test_get_context();
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
|
||||
assert(test_file(ctx, "keymaps/basic.xkb"));
|
||||
assert(test_file(ctx, "keymaps/comprehensive-plus-geom.xkb"));
|
||||
|
|
|
@ -497,7 +497,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
ctx = test_get_context();
|
||||
ctx = test_get_context(0);
|
||||
if (!ctx) {
|
||||
ret = -1;
|
||||
fprintf(stderr, "Couldn't create xkb context\n");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
struct xkb_context *ctx = test_get_context();
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
|
||||
assert(ctx);
|
||||
|
|
|
@ -71,7 +71,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
ctx = test_get_context();
|
||||
ctx = test_get_context(0);
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Couldn't create xkb context\n");
|
||||
goto err_out;
|
||||
|
|
|
@ -68,7 +68,7 @@ main(int argc, char *argv[])
|
|||
if (isempty(rmlvo.layout))
|
||||
rmlvo.layout = DEFAULT_XKB_LAYOUT;
|
||||
|
||||
ctx = test_get_context();
|
||||
ctx = test_get_context(0);
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Failed to get xkb context\n");
|
||||
return 1;
|
||||
|
|
|
@ -132,7 +132,7 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct xkb_context *ctx;
|
||||
|
||||
ctx = test_get_context();
|
||||
ctx = test_get_context(0);
|
||||
assert(ctx);
|
||||
|
||||
if (argc > 1 && streq(argv[1], "bench")) {
|
||||
|
|
|
@ -93,7 +93,7 @@ benchmark(struct xkb_context *context)
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct xkb_context *ctx = test_get_context();
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
|
||||
assert(ctx);
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ test_consume(struct xkb_keymap *keymap)
|
|||
int
|
||||
main(void)
|
||||
{
|
||||
struct xkb_context *context = test_get_context();
|
||||
struct xkb_context *context = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
|
||||
assert(context);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct xkb_context *ctx = test_get_context();
|
||||
struct xkb_context *ctx = test_get_context(0);
|
||||
struct xkb_keymap *keymap;
|
||||
char *original, *dump;
|
||||
|
||||
|
|
|
@ -52,8 +52,12 @@ test_get_path(const char *path_rel);
|
|||
char *
|
||||
test_read_file(const char *path_rel);
|
||||
|
||||
enum test_context_flags {
|
||||
CONTEXT_NO_FLAG = 0,
|
||||
};
|
||||
|
||||
struct xkb_context *
|
||||
test_get_context(void);
|
||||
test_get_context(enum test_context_flags flags);
|
||||
|
||||
struct xkb_keymap *
|
||||
test_compile_file(struct xkb_context *context, const char *path_rel);
|
||||
|
|
Loading…
Reference in New Issue