test/common: avoid double // in path
[platform/upstream/libxkbcommon.git] / test / rules-file.c
index ee53f09..d217ba9 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <assert.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
+#include "config.h"
 
 #include "test.h"
-#include "xkb-priv.h"
-#include "rules.h"
+#include "xkbcomp/xkbcomp-priv.h"
+#include "xkbcomp/rules.h"
 
 struct test_data {
     /* Rules file */
@@ -90,19 +87,13 @@ test_rules(struct xkb_context *ctx, struct test_data *data)
 }
 
 int
-main(void)
+main(int argc, char *argv[])
 {
     struct xkb_context *ctx;
-    const char *srcdir = getenv("srcdir");
-    char *path;
 
-    ctx = xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES);
+    ctx = test_get_context(0);
     assert(ctx);
 
-    assert(asprintf(&path, "%s/test/data", srcdir ? srcdir : ".") > 0);
-    assert(xkb_context_include_path_append(ctx, test_get_path("")));
-    free(path);
-
     struct test_data test1 = {
         .rules = "simple",
 
@@ -110,7 +101,7 @@ main(void)
         .options = "my_option",
 
         .keycodes = "my_keycodes", .types = "my_types",
-        .compat = "my_compat+some:compat",
+        .compat = "my_compat|some:compat",
         .symbols = "my_symbols+extra_variant",
     };
     assert(test_rules(ctx, &test1));