test: Add flags argument to test_get_context() Allowing overriding of environment suppression, at first. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
diff --git a/test/bench-key-proc.c b/test/bench-key-proc.c
index 241c217..e345092 100644
--- a/test/bench-key-proc.c
+++ b/test/bench-key-proc.c
@@ -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",
diff --git a/test/common.c b/test/common.c
index 400d872..df79272 100644
--- a/test/common.c
+++ b/test/common.c
@@ -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);
diff --git a/test/context.c b/test/context.c
index e151dd0..63813f1 100644
--- a/test/context.c
+++ b/test/context.c
@@ -29,7 +29,7 @@
int
main(void)
{
- struct xkb_context *context = test_get_context();
+ struct xkb_context *context = test_get_context(0);
assert(context);
diff --git a/test/filecomp.c b/test/filecomp.c
index eafe568..0e41dea 100644
--- a/test/filecomp.c
+++ b/test/filecomp.c
@@ -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"));
diff --git a/test/interactive.c b/test/interactive.c
index 789f932..f90f6eb 100644
--- a/test/interactive.c
+++ b/test/interactive.c
@@ -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");
diff --git a/test/keyseq.c b/test/keyseq.c
index 461a439..57ea496 100644
--- a/test/keyseq.c
+++ b/test/keyseq.c
@@ -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);
diff --git a/test/print-compiled-keymap.c b/test/print-compiled-keymap.c
index 0e14205..7e57fdd 100644
--- a/test/print-compiled-keymap.c
+++ b/test/print-compiled-keymap.c
@@ -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;
diff --git a/test/rmlvo-to-kccgst.c b/test/rmlvo-to-kccgst.c
index 3443614..bba2bde 100644
--- a/test/rmlvo-to-kccgst.c
+++ b/test/rmlvo-to-kccgst.c
@@ -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;
diff --git a/test/rules-file.c b/test/rules-file.c
index b3b3b6c..da14e3a 100644
--- a/test/rules-file.c
+++ b/test/rules-file.c
@@ -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")) {
diff --git a/test/rulescomp.c b/test/rulescomp.c
index 55113f6..dfe4084 100644
--- a/test/rulescomp.c
+++ b/test/rulescomp.c
@@ -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);
diff --git a/test/state.c b/test/state.c
index 83a8f45..34da201 100644
--- a/test/state.c
+++ b/test/state.c
@@ -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);
diff --git a/test/stringcomp.c b/test/stringcomp.c
index ab5bbef..3aefba9 100644
--- a/test/stringcomp.c
+++ b/test/stringcomp.c
@@ -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;
diff --git a/test/test.h b/test/test.h
index a72d6aa..b90bdd9 100644
--- a/test/test.h
+++ b/test/test.h
@@ -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);