build: Skip building some tests on MSVC for now
authorAdrian Perez de Castro <aperez@igalia.com>
Mon, 5 Aug 2019 10:51:09 +0000 (13:51 +0300)
committerRan Benita <ran234@gmail.com>
Sat, 28 Dec 2019 14:12:15 +0000 (16:12 +0200)
This is a stopgap measure to quickly get tests building with MSVC for
now, at some point the tests could be rewritten to avoid using getopt()
and mkdtemp() or to ship an implementation.

meson.build

index d8b9430..a43fc0c 100644 (file)
@@ -344,11 +344,14 @@ test(
     executable('test-filecomp', 'test/filecomp.c', dependencies: test_dep),
     env: test_env,
 )
-test(
-    'context',
-    executable('test-context', 'test/context.c', dependencies: test_dep),
-    env: test_env,
-)
+# TODO: This test currently uses some functions that don't exist on Windows.
+if cc.get_id() != 'msvc'
+  test(
+      'context',
+      executable('test-context', 'test/context.c', dependencies: test_dep),
+      env: test_env,
+  )
+endif
 test(
     'rules-file',
     executable('test-rules-file', 'test/rules-file.c', dependencies: test_dep),
@@ -427,9 +430,11 @@ executable('fuzz-compose', 'fuzz/compose/target.c', dependencies: test_dep)
 
 
 # Demo programs.
-executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep)
-executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep)
-executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep)
+if cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE')
+    executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep)
+    executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep)
+    executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep)
+endif
 if cc.has_header('linux/input.h')
     executable('interactive-evdev', 'test/interactive-evdev.c', dependencies: test_dep)
 endif