[glib: 1/2] Meson: Cleanup a FIXME now that we have dict addition
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] Meson: Cleanup a FIXME now that we have dict addition
- Date: Tue, 30 Oct 2018 11:33:37 +0000 (UTC)
commit aff686a2fbbdbf3be608b2b83abf6b4d55db731e
Author: Xavier Claessens <xavier claessens collabora com>
Date: Thu Oct 25 10:50:10 2018 -0400
Meson: Cleanup a FIXME now that we have dict addition
glib/tests/meson.build | 87 +++++++++++++++++++++++++-------------------------
1 file changed, 44 insertions(+), 43 deletions(-)
---
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index 2468d8767..b020cc90d 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -4,9 +4,6 @@ glib_tests = {
'atomic' : {
'c_args' : cc.get_id() == 'gcc' ? ['-Wstrict-aliasing=2'] : [],
},
- 'autoptr' : {
- 'skip' : cc.get_id() == 'msvc',
- },
'base64' : {},
'bitlock' : {},
'bookmarkfile' : {},
@@ -32,19 +29,10 @@ glib_tests = {
'source' : ['gwakeuptest.c', '../gwakeup.c'],
'install' : false,
},
- 'gwakeup-fallback' : {
- 'skip' : not glib_conf.has('HAVE_EVENTFD'),
- 'source' : ['gwakeuptest.c', '../gwakeup.c'],
- 'c_args' : ['-DTEST_EVENTFD_FALLBACK'],
- 'install' : false,
- },
'hash' : {},
'hmac' : {},
'hook' : {},
'hostutils' : {},
- 'include' : {
- 'skip' : host_machine.system() == 'windows',
- },
'keyfile' : {},
'list' : {},
'logging' : {},
@@ -109,9 +97,6 @@ glib_tests = {
'utf8-misc' : {},
'utils' : {},
'unicode' : {},
- 'unix' : {
- 'skip' : host_machine.system() == 'windows',
- },
'uri' : {},
'1bit-mutex' : {},
'1bit-emufutex' : {
@@ -130,6 +115,27 @@ glib_tests = {
},
}
+if cc.get_id() != 'msvc'
+ glib_tests += {'autoptr' : {}}
+endif
+
+if glib_conf.has('HAVE_EVENTFD')
+ glib_tests += {
+ 'gwakeup-fallback' : {
+ 'source' : ['gwakeuptest.c', '../gwakeup.c'],
+ 'c_args' : ['-DTEST_EVENTFD_FALLBACK'],
+ 'install' : false,
+ },
+ }
+endif
+
+if host_machine.system() != 'windows'
+ glib_tests += {
+ 'include' : {},
+ 'unix' : {},
+ }
+endif
+
if installed_tests_enabled
install_data(
'keyfiletest.ini',
@@ -159,37 +165,32 @@ test_deps = [libm, thread_dep, libglib_dep]
test_cargs = ['-DG_LOG_DOMAIN="GLib"']
foreach test_name, extra_args : glib_tests
- # FIXME: This condition is ugly, meson should either have 'continue'
- # keyword (https://github.com/mesonbuild/meson/issues/3601), or support
- # mutable to dictionaries (https://github.com/mesonbuild/meson/pull/3820).
- if not extra_args.get('skip', false)
- source = extra_args.get('source', test_name + '.c')
- install = installed_tests_enabled and extra_args.get('install', true)
-
- if install
- test_conf = configuration_data()
- test_conf.set('installed_tests_dir', installed_tests_execdir)
- test_conf.set('program', test_name)
- configure_file(
- input: installed_tests_template_tap,
- output: test_name + '.test',
- install_dir: installed_tests_metadir,
- configuration: test_conf
- )
- endif
+ source = extra_args.get('source', test_name + '.c')
+ install = installed_tests_enabled and extra_args.get('install', true)
- exe = executable(test_name, source,
- c_args : test_cargs + extra_args.get('c_args', []),
- dependencies : test_deps + extra_args.get('dependencies', []),
- install_dir: installed_tests_execdir,
- install: install,
+ if install
+ test_conf = configuration_data()
+ test_conf.set('installed_tests_dir', installed_tests_execdir)
+ test_conf.set('program', test_name)
+ configure_file(
+ input: installed_tests_template_tap,
+ output: test_name + '.test',
+ install_dir: installed_tests_metadir,
+ configuration: test_conf
)
-
- suite = ['glib'] + extra_args.get('suite', [])
- timeout = suite.contains('slow') ? 120 : 30
- test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
- args : ['--tap'])
endif
+
+ exe = executable(test_name, source,
+ c_args : test_cargs + extra_args.get('c_args', []),
+ dependencies : test_deps + extra_args.get('dependencies', []),
+ install_dir: installed_tests_execdir,
+ install: install,
+ )
+
+ suite = ['glib'] + extra_args.get('suite', [])
+ timeout = suite.contains('slow') ? 120 : 30
+ test(test_name, exe, env : test_env, timeout : timeout, suite : suite,
+ args : ['--tap'])
endforeach
# test-spawn-echo helper binary required by the spawn tests above
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]