From 951c1790fadf57e39c47f3d47451f86cca2d0889 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 15 Mar 2021 20:22:55 +0100 Subject: meson: Clean up test declarations a bit --- meson.build | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/meson.build b/meson.build index 5b06e57..83c942b 100644 --- a/meson.build +++ b/meson.build @@ -186,31 +186,18 @@ if get_option('examples').enabled() ) endif -test( - 'linked_list', - executable( - 'linked_list_test', - ['common/linked_list.c', 'tests/linked_list.c'], - include_directories: [include_directories('.', 'include')], - ) -) -test( - 'poller', - executable( - 'poller_test', - ['common/linked_list.c', 'seatd/poller.c', 'tests/poller.c'], - include_directories: [include_directories('.', 'include')], - ) -) - -test( - 'connection', - executable( - 'connection_test', - ['common/connection.c', 'tests/connection.c'], - include_directories: [include_directories('.', 'include')], - ) -) +tests = { + 'linked_list': ['common/linked_list.c'], + 'connection': ['common/connection.c'], + 'poller': ['common/linked_list.c', 'seatd/poller.c'], +} + +foreach name, value : tests + test(name, executable( + '@0@_test'.format(name), + ['tests/@0@.c'.format(name), value], + include_directories: [include_directories('.', 'include')])) +endforeach if get_option('server').enabled() scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true) -- cgit v1.2.3