test: Add flags argument to test_get_context()
authorDaniel Stone <daniel@fooishbar.org>
Mon, 18 Mar 2013 21:02:35 +0000 (21:02 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Tue, 19 Mar 2013 10:28:23 +0000 (10:28 +0000)
Allowing overriding of environment suppression, at first.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
13 files changed:
test/bench-key-proc.c
test/common.c
test/context.c
test/filecomp.c
test/interactive.c
test/keyseq.c
test/print-compiled-keymap.c
test/rmlvo-to-kccgst.c
test/rules-file.c
test/rulescomp.c
test/state.c
test/stringcomp.c
test/test.h

index 241c217..e345092 100644 (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",
index 400d872..df79272 100644 (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);
 
index e151dd0..63813f1 100644 (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);
 
index eafe568..0e41dea 100644 (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"));
index 789f932..f90f6eb 100644 (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");
index 461a439..57ea496 100644 (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);
index 0e14205..7e57fdd 100644 (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;
index 3443614..bba2bde 100644 (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;
index b3b3b6c..da14e3a 100644 (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")) {
index 55113f6..dfe4084 100644 (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);
 
index 83a8f45..34da201 100644 (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);
index ab5bbef..3aefba9 100644 (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;
 
index a72d6aa..b90bdd9 100644 (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);