[gtk/master.vs12: 3/3] testsuite/a11y: Skip building on Visual Studio 2013




commit c03289e696b8b717d03471d680915c9e28be62ad
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Dec 30 18:15:54 2020 +0800

    testsuite/a11y: Skip building on Visual Studio 2013
    
    Somehow, Visual Studio 2013 did not like the `__value` keyword to be
    used in plain C program, so we need to just skip building the A11Y tests
    on Visual Studio 2013.

 testsuite/a11y/meson.build | 58 ++++++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 28 deletions(-)
---
diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build
index 54c27fe2e5..cec308c3a1 100644
--- a/testsuite/a11y/meson.build
+++ b/testsuite/a11y/meson.build
@@ -40,7 +40,6 @@ xfail = [
 ]
 
 is_debug = get_option('buildtype').startswith('debug')
-
 test_cargs = []
 
 foreach flag: common_cflags
@@ -58,34 +57,37 @@ test_env.set('GIO_USE_VFS', 'local')
 test_env.set('GSETTINGS_BACKEND', 'memory')
 test_env.set('G_ENABLE_DIAGNOSTIC', '0')
 
-foreach t : tests
-  test_name = t.get('name')
-  test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', [])
-  test_extra_cargs = t.get('c_args', [])
-  test_extra_ldflags = t.get('link_args', [])
-  test_extra_suites = t.get('suites', [])
-  test_timeout = 60
+# Visual Studio 2013 could not cope with '__value' for C sources
+if cc.get_id() != 'msvc' or cc.version().version_compare('>=19')
+  foreach t : tests
+    test_name = t.get('name')
+    test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', [])
+    test_extra_cargs = t.get('c_args', [])
+    test_extra_ldflags = t.get('link_args', [])
+    test_extra_suites = t.get('suites', [])
+    test_timeout = 60
 
-  test_exe = executable(test_name, test_srcs,
-    c_args: test_cargs + test_extra_cargs,
-    link_args: test_extra_ldflags,
-    dependencies: libgtk_dep,
-    install: get_option('install-tests'),
-    install_dir: testexecdir,
-  )
+    test_exe = executable(test_name, test_srcs,
+      c_args: test_cargs + test_extra_cargs,
+      link_args: test_extra_ldflags,
+      dependencies: libgtk_dep,
+      install: get_option('install-tests'),
+      install_dir: testexecdir,
+    )
 
-  expect_fail = xfail.contains(test_name)
+    expect_fail = xfail.contains(test_name)
 
-  if test_extra_suites.contains('slow')
-    test_timeout = 90
-  endif
+    if test_extra_suites.contains('slow')
+      test_timeout = 90
+    endif
 
-  test(test_name, test_exe,
-    args: [ '--tap', '-k' ],
-    protocol: 'tap',
-    timeout: test_timeout,
-    env: test_env,
-    suite: ['a11y'] + test_extra_suites,
-    should_fail: expect_fail,
-  )
-endforeach
+    test(test_name, test_exe,
+      args: [ '--tap', '-k' ],
+      protocol: 'tap',
+      timeout: test_timeout,
+      env: test_env,
+      suite: ['a11y'] + test_extra_suites,
+      should_fail: expect_fail,
+    )
+  endforeach
+endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]