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,56 +96,85 @@ 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 ],
},
'display-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
tests_server_protocol_h, tests_server_protocol_h,
tests_client_protocol_c, tests_client_protocol_c,
tests_protocol_c, tests_protocol_c,
], ],
'connection-test': [ },
'connection-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'event-loop-test': [ wayland_server_protocol_h ], },
'fixed-test': [], 'event-loop-test': {
'interface-test': [ wayland_client_protocol_h ], 'extra_sources': [ wayland_server_protocol_h ],
'list-test': [], },
'map-test': [], 'fixed-test': {},
'sanity-test' : [ 'interface-test': {
'extra_sources': [ wayland_client_protocol_h ],
},
'list-test': {},
'map-test': {},
'sanity-test' : {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'socket-test': [ },
'socket-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'queue-test': [ },
'queue-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'signal-test': [ wayland_server_protocol_h ], },
'newsignal-test': [ 'signal-test': {
'extra_sources': [ wayland_server_protocol_h ],
},
'newsignal-test': {
'extra_sources': [
# wayland-server.c is needed here to access wl_priv_* functions # wayland-server.c is needed here to access wl_priv_* functions
files('../src/wayland-server.c'), files('../src/wayland-server.c'),
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'resources-test': [ wayland_server_protocol_h ], },
'message-test': [ 'resources-test': {
'extra_sources': [ wayland_server_protocol_h ],
},
'message-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'compositor-introspection-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': [ },
'protocol-logger-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'headers-test': [ },
'headers-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
'headers-protocol-test.c', 'headers-protocol-test.c',
@ -153,15 +182,19 @@ tests = {
wayland_server_protocol_core_h, wayland_server_protocol_core_h,
'headers-protocol-core-test.c', 'headers-protocol-core-test.c',
], ],
'os-wrappers-test': [], },
'proxy-test': [ 'os-wrappers-test': {},
'proxy-test': {
'extra_sources': [
wayland_client_protocol_h, wayland_client_protocol_h,
wayland_server_protocol_h, wayland_server_protocol_h,
], ],
'enum-validator-test': [], },
'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)