test: Add flags argument to test_get_context()

Allowing overriding of environment suppression, at first.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2013-03-18 21:02:35 +00:00
parent a1f203c031
commit 54f95f496f
13 changed files with 17 additions and 13 deletions

View File

@ -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",

View File

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

View File

@ -29,7 +29,7 @@
int
main(void)
{
struct xkb_context *context = test_get_context();
struct xkb_context *context = test_get_context(0);
assert(context);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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")) {

View File

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

View File

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

View File

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

View File

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