tests: Make tests dict elements dicts themselves

Previously each value was a list of extra sources. The next commit will add an
additional field to each test, so they need to be dicts themselves.

Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Matt Turner 2024-12-19 21:44:00 -05:00 committed by Simon Ser
parent 4a0c4e2119
commit ca83185e8a

View file

@ -96,72 +96,105 @@ if get_option('scanner')
endif endif
tests = { tests = {
'array-test': [], 'array-test': {},
'client-test': [ wayland_server_protocol_h ], 'client-test': {
'display-test': [ 'extra_sources': [ wayland_server_protocol_h ],
wayland_client_protocol_h, },
wayland_server_protocol_h, 'display-test': {
tests_server_protocol_h, 'extra_sources': [
tests_client_protocol_c, wayland_client_protocol_h,
tests_protocol_c, wayland_server_protocol_h,
], tests_server_protocol_h,
'connection-test': [ tests_client_protocol_c,
wayland_client_protocol_h, tests_protocol_c,
wayland_server_protocol_h, ],
], },
'event-loop-test': [ wayland_server_protocol_h ], 'connection-test': {
'fixed-test': [], 'extra_sources': [
'interface-test': [ wayland_client_protocol_h ], wayland_client_protocol_h,
'list-test': [], wayland_server_protocol_h,
'map-test': [], ],
'sanity-test' : [ },
wayland_client_protocol_h, 'event-loop-test': {
wayland_server_protocol_h, 'extra_sources': [ wayland_server_protocol_h ],
], },
'socket-test': [ 'fixed-test': {},
wayland_client_protocol_h, 'interface-test': {
wayland_server_protocol_h, 'extra_sources': [ wayland_client_protocol_h ],
], },
'queue-test': [ 'list-test': {},
wayland_client_protocol_h, 'map-test': {},
wayland_server_protocol_h, 'sanity-test' : {
], 'extra_sources': [
'signal-test': [ wayland_server_protocol_h ], wayland_client_protocol_h,
'newsignal-test': [ wayland_server_protocol_h,
# wayland-server.c is needed here to access wl_priv_* functions ],
files('../src/wayland-server.c'), },
wayland_server_protocol_h, 'socket-test': {
], 'extra_sources': [
'resources-test': [ wayland_server_protocol_h ], wayland_client_protocol_h,
'message-test': [ wayland_server_protocol_h,
wayland_client_protocol_h, ],
wayland_server_protocol_h, },
], 'queue-test': {
'compositor-introspection-test': [ 'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'protocol-logger-test': [ },
wayland_client_protocol_h, 'signal-test': {
wayland_server_protocol_h, 'extra_sources': [ wayland_server_protocol_h ],
], },
'headers-test': [ 'newsignal-test': {
wayland_client_protocol_h, 'extra_sources': [
wayland_server_protocol_h, # wayland-server.c is needed here to access wl_priv_* functions
'headers-protocol-test.c', files('../src/wayland-server.c'),
wayland_client_protocol_core_h, wayland_server_protocol_h,
wayland_server_protocol_core_h, ],
'headers-protocol-core-test.c', },
], 'resources-test': {
'os-wrappers-test': [], 'extra_sources': [ wayland_server_protocol_h ],
'proxy-test': [ },
wayland_client_protocol_h, 'message-test': {
wayland_server_protocol_h, 'extra_sources': [
], wayland_client_protocol_h,
'enum-validator-test': [], wayland_server_protocol_h,
],
},
'compositor-introspection-test': {
'extra_sources': [
wayland_client_protocol_h,
wayland_server_protocol_h,
],
},
'protocol-logger-test': {
'extra_sources': [
wayland_client_protocol_h,
wayland_server_protocol_h,
],
},
'headers-test': {
'extra_sources': [
wayland_client_protocol_h,
wayland_server_protocol_h,
'headers-protocol-test.c',
wayland_client_protocol_core_h,
wayland_server_protocol_core_h,
'headers-protocol-core-test.c',
],
},
'os-wrappers-test': {},
'proxy-test': {
'extra_sources': [
wayland_client_protocol_h,
wayland_server_protocol_h,
],
},
'enum-validator-test': {},
} }
foreach test_name, test_extra_sources: tests foreach test_name, test_extras : tests
test_extra_sources = test_extras.get('extra_sources', [])
test_sources = [ test_name + '.c' ] + test_extra_sources test_sources = [ test_name + '.c' ] + test_extra_sources
test_deps = [test_runner_dep, epoll_dep] test_deps = [test_runner_dep, epoll_dep]
bin = executable(test_name, test_sources, dependencies: test_deps) bin = executable(test_name, test_sources, dependencies: test_deps)