build: add enable-tools option
[platform/upstream/libxkbcommon.git] / test / log.c
index ac32867..384fabc 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include "config.h"
+
 #include "test.h"
 #include "context.h"
 
+#ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wmissing-format-attribute"
+#endif
 
 static const char *
 log_level_to_string(enum xkb_log_level level)
@@ -70,11 +74,11 @@ main(void)
     struct xkb_context *ctx;
     int ret;
 
-    ret = setenv("XKB_LOG", "warn", 1);
+    ret = setenv("XKB_LOG_LEVEL", "warn", 1);
     assert(ret == 0);
-    ret = setenv("XKB_VERBOSITY", "5", 1);
+    ret = setenv("XKB_LOG_VERBOSITY", "5", 1);
     assert(ret == 0);
-    ctx = xkb_context_new(0);
+    ctx = test_get_context(0);
     assert(ctx);
 
     darray_init(log_string);