From 8abcce31ee2b528cba1798fbb738294e5760dccf Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 5 Oct 2022 21:16:13 +0300 Subject: test: meson: Use dictionaries instead of arrays to store test information Tests are listed in meson.build using arrays that contain the test name and source files at fixed positions. This isn't very readable, leading to code using test[0], test[1] and test[2]. Replace the arrays with dictionaries to improve readability. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Umang Jain --- test/v4l2_videodevice/meson.build | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'test/v4l2_videodevice') diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build index f8537485..87ea4f96 100644 --- a/test/v4l2_videodevice/meson.build +++ b/test/v4l2_videodevice/meson.build @@ -3,22 +3,22 @@ # Tests are listed in order of complexity. # They are not alphabetically sorted. v4l2_videodevice_tests = [ - ['double_open', 'double_open.cpp'], - ['controls', 'controls.cpp'], - ['formats', 'formats.cpp'], - ['dequeue_watchdog', 'dequeue_watchdog.cpp'], - ['request_buffers', 'request_buffers.cpp'], - ['buffer_cache', 'buffer_cache.cpp'], - ['stream_on_off', 'stream_on_off.cpp'], - ['capture_async', 'capture_async.cpp'], - ['buffer_sharing', 'buffer_sharing.cpp'], - ['v4l2_m2mdevice', 'v4l2_m2mdevice.cpp'], + {'name': 'double_open', 'sources': ['double_open.cpp']}, + {'name': 'controls', 'sources': ['controls.cpp']}, + {'name': 'formats', 'sources': ['formats.cpp']}, + {'name': 'dequeue_watchdog', 'sources': ['dequeue_watchdog.cpp']}, + {'name': 'request_buffers', 'sources': ['request_buffers.cpp']}, + {'name': 'buffer_cache', 'sources': ['buffer_cache.cpp']}, + {'name': 'stream_on_off', 'sources': ['stream_on_off.cpp']}, + {'name': 'capture_async', 'sources': ['capture_async.cpp']}, + {'name': 'buffer_sharing', 'sources': ['buffer_sharing.cpp']}, + {'name': 'v4l2_m2mdevice', 'sources': ['v4l2_m2mdevice.cpp']}, ] foreach test : v4l2_videodevice_tests - exe = executable(test[0], [test[1], 'v4l2_videodevice_test.cpp'], + exe = executable(test['name'], [test['sources'], 'v4l2_videodevice_test.cpp'], dependencies : libcamera_private, link_with : test_libraries, include_directories : test_includes_internal) - test(test[0], exe, suite : 'v4l2_videodevice', is_parallel : false) + test(test['name'], exe, suite : 'v4l2_videodevice', is_parallel : false) endforeach -- cgit v1.2.1