[{"id":25319,"web_url":"https://patchwork.libcamera.org/comment/25319/","msgid":"<20221006072533.yv4tirjzhsbegq2d@uno.localdomain>","date":"2022-10-06T07:25:33","subject":"Re: [libcamera-devel] [PATCH 2/2] test: meson: Use dictionaries\n\tinstead of arrays to store test information","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Wed, Oct 05, 2022 at 10:39:44PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Tests are listed in meson.build using arrays that contain the test name\n> and source files at fixed positions. This isn't very readable, leading\n> to code using test[0], test[1] and test[2]. Replace the arrays with\n> dictionaries to improve readability.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks! This is much much nicer!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n\n> ---\n>  test/camera/meson.build           | 16 +++---\n>  test/controls/meson.build         | 12 ++---\n>  test/gstreamer/meson.build        |  8 +--\n>  test/ipa/meson.build              |  8 +--\n>  test/ipc/meson.build              |  8 +--\n>  test/log/meson.build              |  8 +--\n>  test/media_device/meson.build     | 10 ++--\n>  test/meson.build                  | 84 +++++++++++++++----------------\n>  test/pipeline/ipu3/meson.build    |  6 +--\n>  test/pipeline/rkisp1/meson.build  |  6 +--\n>  test/process/meson.build          |  6 +--\n>  test/serialization/meson.build    |  8 +--\n>  test/stream/meson.build           |  8 +--\n>  test/v4l2_subdevice/meson.build   |  8 +--\n>  test/v4l2_videodevice/meson.build | 24 ++++-----\n>  15 files changed, 110 insertions(+), 110 deletions(-)\n>\n> diff --git a/test/camera/meson.build b/test/camera/meson.build\n> index df0520293bdb..4f9f8c8c4784 100644\n> --- a/test/camera/meson.build\n> +++ b/test/camera/meson.build\n> @@ -3,18 +3,18 @@\n>  # Tests are listed in order of complexity.\n>  # They are not alphabetically sorted.\n>  camera_tests = [\n> -    ['configuration_default',   'configuration_default.cpp'],\n> -    ['configuration_set',       'configuration_set.cpp'],\n> -    ['buffer_import',           'buffer_import.cpp'],\n> -    ['statemachine',            'statemachine.cpp'],\n> -    ['capture',                 'capture.cpp'],\n> -    ['camera_reconfigure',      'camera_reconfigure.cpp'],\n> +    {'name': 'configuration_default', 'sources': ['configuration_default.cpp']},\n> +    {'name': 'configuration_set', 'sources': ['configuration_set.cpp']},\n> +    {'name': 'buffer_import', 'sources': ['buffer_import.cpp']},\n> +    {'name': 'statemachine', 'sources': ['statemachine.cpp']},\n> +    {'name': 'capture', 'sources': ['capture.cpp']},\n> +    {'name': 'camera_reconfigure', 'sources': ['camera_reconfigure.cpp']},\n>  ]\n>\n>  foreach test : camera_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'camera', is_parallel : false)\n> +    test(test['name'], exe, suite : 'camera', is_parallel : false)\n>  endforeach\n> diff --git a/test/controls/meson.build b/test/controls/meson.build\n> index 8cf23be6487c..763f8905e7c1 100644\n> --- a/test/controls/meson.build\n> +++ b/test/controls/meson.build\n> @@ -1,16 +1,16 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  control_tests = [\n> -    ['control_info',                'control_info.cpp'],\n> -    ['control_info_map',            'control_info_map.cpp'],\n> -    ['control_list',                'control_list.cpp'],\n> -    ['control_value',               'control_value.cpp'],\n> +    {'name': 'control_info', 'sources': ['control_info.cpp']},\n> +    {'name': 'control_info_map', 'sources': ['control_info_map.cpp']},\n> +    {'name': 'control_list', 'sources': ['control_list.cpp']},\n> +    {'name': 'control_value', 'sources': ['control_value.cpp']},\n>  ]\n>\n>  foreach test : control_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_public,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'controls', is_parallel : false)\n> +    test(test['name'], exe, suite : 'controls', is_parallel : false)\n>  endforeach\n> diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\n> index 46f6a77a771e..745725864eef 100644\n> --- a/test/gstreamer/meson.build\n> +++ b/test/gstreamer/meson.build\n> @@ -5,16 +5,16 @@ if not gst_enabled\n>  endif\n>\n>  gstreamer_tests = [\n> -    ['single_stream_test',   'gstreamer_single_stream_test.cpp'],\n> -    ['multi_stream_test',    'gstreamer_multi_stream_test.cpp'],\n> +    {'name': 'single_stream_test', 'sources': ['gstreamer_single_stream_test.cpp']},\n> +    {'name': 'multi_stream_test', 'sources': ['gstreamer_multi_stream_test.cpp']},\n>  ]\n>  gstreamer_dep = dependency('gstreamer-1.0', required: true)\n>\n>  foreach test : gstreamer_tests\n> -    exe = executable(test[0], test[1], 'gstreamer_test.cpp',\n> +    exe = executable(test['name'], test['sources'], 'gstreamer_test.cpp',\n>                       dependencies : [libcamera_private, gstreamer_dep],\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'gstreamer', is_parallel : false)\n> +    test(test['name'], exe, suite : 'gstreamer', is_parallel : false)\n>  endforeach\n> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> index 295807fd8a45..180b0da0a51a 100644\n> --- a/test/ipa/meson.build\n> +++ b/test/ipa/meson.build\n> @@ -1,15 +1,15 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  ipa_test = [\n> -    ['ipa_module_test',     'ipa_module_test.cpp'],\n> -    ['ipa_interface_test',  'ipa_interface_test.cpp'],\n> +    {'name': 'ipa_module_test', 'sources': ['ipa_module_test.cpp']},\n> +    {'name': 'ipa_interface_test', 'sources': ['ipa_interface_test.cpp']},\n>  ]\n>\n>  foreach test : ipa_test\n> -    exe = executable(test[0], [test[1], libcamera_generated_ipa_headers],\n> +    exe = executable(test['name'], test['sources'], libcamera_generated_ipa_headers,\n>                       dependencies : libcamera_private,\n>                       link_with : [libipa, test_libraries],\n>                       include_directories : [libipa_includes, test_includes_internal])\n>\n> -    test(test[0], exe, suite : 'ipa')\n> +    test(test['name'], exe, suite : 'ipa')\n>  endforeach\n> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> index ce21135b701d..8e447d228201 100644\n> --- a/test/ipc/meson.build\n> +++ b/test/ipc/meson.build\n> @@ -1,15 +1,15 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  ipc_tests = [\n> -    ['unixsocket_ipc', 'unixsocket_ipc.cpp'],\n> -    ['unixsocket',     'unixsocket.cpp'],\n> +    {'name': 'unixsocket_ipc', 'sources': ['unixsocket_ipc.cpp']},\n> +    {'name': 'unixsocket', 'sources': ['unixsocket.cpp']},\n>  ]\n>\n>  foreach test : ipc_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'ipc')\n> +    test(test['name'], exe, suite : 'ipc')\n>  endforeach\n> diff --git a/test/log/meson.build b/test/log/meson.build\n> index d2d51e471d52..2298ff84ee62 100644\n> --- a/test/log/meson.build\n> +++ b/test/log/meson.build\n> @@ -1,15 +1,15 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  log_test = [\n> -    ['log_api',     'log_api.cpp'],\n> -    ['log_process', 'log_process.cpp'],\n> +    {'name': 'log_api', 'sources': ['log_api.cpp']},\n> +    {'name': 'log_process', 'sources': ['log_process.cpp']},\n>  ]\n>\n>  foreach test : log_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'log')\n> +    test(test['name'], exe, suite : 'log')\n>  endforeach\n> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> index 7d34509d6797..84966c976192 100644\n> --- a/test/media_device/meson.build\n> +++ b/test/media_device/meson.build\n> @@ -5,9 +5,9 @@ lib_mdev_test_sources = files([\n>  ])\n>\n>  media_device_tests = [\n> -    ['media_device_acquire',            'media_device_acquire.cpp'],\n> -    ['media_device_print_test',         'media_device_print_test.cpp'],\n> -    ['media_device_link_test',          'media_device_link_test.cpp'],\n> +    {'name': 'media_device_acquire', 'sources': ['media_device_acquire.cpp']},\n> +    {'name': 'media_device_print_test', 'sources': ['media_device_print_test.cpp']},\n> +    {'name': 'media_device_link_test', 'sources': ['media_device_link_test.cpp']},\n>  ]\n>\n>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> @@ -15,10 +15,10 @@ lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n>                                 include_directories : test_includes_internal)\n>\n>  foreach test : media_device_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : [test_libraries, lib_mdev_test],\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'media_device', is_parallel : false)\n> +    test(test['name'], exe, suite : 'media_device', is_parallel : false)\n>  endforeach\n> diff --git a/test/meson.build b/test/meson.build\n> index 4bc01d78f4e6..05a54d5cad2f 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -26,82 +26,82 @@ subdir('v4l2_subdevice')\n>  subdir('v4l2_videodevice')\n>\n>  public_tests = [\n> -    ['color-space',                     'color-space.cpp'],\n> -    ['geometry',                        'geometry.cpp'],\n> -    ['public-api',                      'public-api.cpp'],\n> -    ['signal',                          'signal.cpp'],\n> -    ['span',                            'span.cpp'],\n> +    {'name': 'color-space', 'sources': ['color-space.cpp']},\n> +    {'name': 'geometry', 'sources': ['geometry.cpp']},\n> +    {'name': 'public-api', 'sources': ['public-api.cpp']},\n> +    {'name': 'signal', 'sources': ['signal.cpp']},\n> +    {'name': 'span', 'sources': ['span.cpp']},\n>  ]\n>\n>  internal_tests = [\n> -    ['bayer-format',                    'bayer-format.cpp'],\n> -    ['byte-stream-buffer',              'byte-stream-buffer.cpp'],\n> -    ['camera-sensor',                   'camera-sensor.cpp'],\n> -    ['delayed_controls',                'delayed_controls.cpp'],\n> -    ['event',                           'event.cpp'],\n> -    ['event-dispatcher',                'event-dispatcher.cpp'],\n> -    ['event-thread',                    'event-thread.cpp'],\n> -    ['file',                            'file.cpp'],\n> -    ['flags',                           'flags.cpp'],\n> -    ['hotplug-cameras',                 'hotplug-cameras.cpp'],\n> -    ['message',                         'message.cpp'],\n> -    ['object',                          'object.cpp'],\n> -    ['object-delete',                   'object-delete.cpp'],\n> -    ['object-invoke',                   'object-invoke.cpp'],\n> -    ['pixel-format',                    'pixel-format.cpp'],\n> -    ['shared-fd',                       'shared-fd.cpp'],\n> -    ['signal-threads',                  'signal-threads.cpp'],\n> -    ['threads',                         'threads.cpp', [libthreads]],\n> -    ['timer',                           'timer.cpp'],\n> -    ['timer-thread',                    'timer-thread.cpp'],\n> -    ['unique-fd',                       'unique-fd.cpp'],\n> -    ['utils',                           'utils.cpp'],\n> -    ['yaml-parser',                     'yaml-parser.cpp'],\n> +    {'name': 'bayer-format', 'sources': ['bayer-format.cpp']},\n> +    {'name': 'byte-stream-buffer', 'sources': ['byte-stream-buffer.cpp']},\n> +    {'name': 'camera-sensor', 'sources': ['camera-sensor.cpp']},\n> +    {'name': 'delayed_controls', 'sources': ['delayed_controls.cpp']},\n> +    {'name': 'event', 'sources': ['event.cpp']},\n> +    {'name': 'event-dispatcher', 'sources': ['event-dispatcher.cpp']},\n> +    {'name': 'event-thread', 'sources': ['event-thread.cpp']},\n> +    {'name': 'file', 'sources': ['file.cpp']},\n> +    {'name': 'flags', 'sources': ['flags.cpp']},\n> +    {'name': 'hotplug-cameras', 'sources': ['hotplug-cameras.cpp']},\n> +    {'name': 'message', 'sources': ['message.cpp']},\n> +    {'name': 'object', 'sources': ['object.cpp']},\n> +    {'name': 'object-delete', 'sources': ['object-delete.cpp']},\n> +    {'name': 'object-invoke', 'sources': ['object-invoke.cpp']},\n> +    {'name': 'pixel-format', 'sources': ['pixel-format.cpp']},\n> +    {'name': 'shared-fd', 'sources': ['shared-fd.cpp']},\n> +    {'name': 'signal-threads', 'sources': ['signal-threads.cpp']},\n> +    {'name': 'threads', 'sources': 'threads.cpp', 'dependencies': [libthreads]},\n> +    {'name': 'timer', 'sources': ['timer.cpp']},\n> +    {'name': 'timer-thread', 'sources': ['timer-thread.cpp']},\n> +    {'name': 'unique-fd', 'sources': ['unique-fd.cpp']},\n> +    {'name': 'utils', 'sources': ['utils.cpp']},\n> +    {'name': 'yaml-parser', 'sources': ['yaml-parser.cpp']},\n>  ]\n>\n>  internal_non_parallel_tests = [\n> -    ['fence',                           'fence.cpp'],\n> -    ['mapped-buffer',                   'mapped-buffer.cpp'],\n> +    {'name': 'fence', 'sources': ['fence.cpp']},\n> +    {'name': 'mapped-buffer', 'sources': ['mapped-buffer.cpp']},\n>  ]\n>\n>  foreach test : public_tests\n>      deps = [libcamera_public]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>      endif\n>\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>\n> -    test(test[0], exe)\n> +    test(test['name'], exe)\n>  endforeach\n>\n>  foreach test : internal_tests\n>      deps = [libcamera_private]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>      endif\n>\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe)\n> +    test(test['name'], exe)\n>  endforeach\n>\n>  foreach test : internal_non_parallel_tests\n>      deps = [libcamera_private]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>      endif\n>\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, is_parallel : false)\n> +    test(test['name'], exe, is_parallel : false)\n>  endforeach\n> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> index 5fcf5730b0b0..af075707f505 100644\n> --- a/test/pipeline/ipu3/meson.build\n> +++ b/test/pipeline/ipu3/meson.build\n> @@ -1,14 +1,14 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  ipu3_test = [\n> -    ['ipu3_pipeline_test',            'ipu3_pipeline_test.cpp'],\n> +    {'name': 'ipu3_pipeline_test', 'sources': ['ipu3_pipeline_test.cpp']},\n>  ]\n>\n>  foreach test : ipu3_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'ipu3', is_parallel : false)\n> +    test(test['name'], exe, suite : 'ipu3', is_parallel : false)\n>  endforeach\n> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> index c82cc78972f6..1d178ad9da6f 100644\n> --- a/test/pipeline/rkisp1/meson.build\n> +++ b/test/pipeline/rkisp1/meson.build\n> @@ -1,14 +1,14 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  rkisp1_test = [\n> -    ['rkisp1_pipeline_test',            'rkisp1_pipeline_test.cpp'],\n> +    {'name': 'rkisp1_pipeline_test', 'sources': ['rkisp1_pipeline_test.cpp']},\n>  ]\n>\n>  foreach test : rkisp1_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'rkisp1', is_parallel : false)\n> +    test(test['name'], exe, suite : 'rkisp1', is_parallel : false)\n>  endforeach\n> diff --git a/test/process/meson.build b/test/process/meson.build\n> index c656d7343e54..a80dc2d99fdd 100644\n> --- a/test/process/meson.build\n> +++ b/test/process/meson.build\n> @@ -1,14 +1,14 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  process_tests = [\n> -    ['process_test',   'process_test.cpp'],\n> +    {'name': 'process_test', 'sources': ['process_test.cpp']},\n>  ]\n>\n>  foreach test : process_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> -    test(test[0], exe, suite : 'process', is_parallel : false)\n> +    test(test['name'], exe, suite : 'process', is_parallel : false)\n>  endforeach\n> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> index c4206cb3632b..a6e8d79358d9 100644\n> --- a/test/serialization/meson.build\n> +++ b/test/serialization/meson.build\n> @@ -3,14 +3,14 @@\n>  subdir('generated_serializer')\n>\n>  serialization_tests = [\n> -    ['control_serialization',     'control_serialization.cpp'],\n> -    ['ipa_data_serializer_test',  'ipa_data_serializer_test.cpp'],\n> +    {'name': 'control_serialization', 'sources': ['control_serialization.cpp']},\n> +    {'name': 'ipa_data_serializer_test', 'sources': ['ipa_data_serializer_test.cpp']},\n>  ]\n>\n>  foreach test : serialization_tests\n> -    exe = executable(test[0], [test[1], 'serialization_test.cpp'],\n> +    exe = executable(test['name'], test['sources'], 'serialization_test.cpp',\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'serialization', is_parallel : false)\n> +    test(test['name'], exe, suite : 'serialization', is_parallel : false)\n>  endforeach\n> diff --git a/test/stream/meson.build b/test/stream/meson.build\n> index 3a97868bce1c..a3b19bf592a5 100644\n> --- a/test/stream/meson.build\n> +++ b/test/stream/meson.build\n> @@ -1,14 +1,14 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  stream_tests = [\n> -    ['stream_colorspace', 'stream_colorspace.cpp'],\n> -    ['stream_formats',  'stream_formats.cpp'],\n> +    {'name': 'stream_colorspace', 'sources': ['stream_colorspace.cpp']},\n> +    {'name': 'stream_formats', 'sources': ['stream_formats.cpp']},\n>  ]\n>\n>  foreach test : stream_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                       dependencies : libcamera_public,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n> -    test(test[0], exe, suite: 'stream')\n> +    test(test['name'], exe, suite: 'stream')\n>  endforeach\n> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> index 4e607d41fc54..277f29bbcc41 100644\n> --- a/test/v4l2_subdevice/meson.build\n> +++ b/test/v4l2_subdevice/meson.build\n> @@ -1,14 +1,14 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>\n>  v4l2_subdevice_tests = [\n> -  ['list_formats',              'list_formats.cpp'],\n> -  ['test_formats',              'test_formats.cpp'],\n> +    {'name': 'list_formats', 'sources': ['list_formats.cpp']},\n> +    {'name': 'test_formats', 'sources': ['test_formats.cpp']},\n>  ]\n>\n>  foreach test : v4l2_subdevice_tests\n> -    exe = executable(test[0], [test[1], 'v4l2_subdevice_test.cpp'],\n> +    exe = executable(test['name'], test['sources'], 'v4l2_subdevice_test.cpp',\n>          dependencies : libcamera_private,\n>          link_with : test_libraries,\n>          include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> +    test(test['name'], exe, suite : 'v4l2_subdevice', is_parallel : false)\n>  endforeach\n> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> index f85374854c48..87ea4f966ff1 100644\n> --- a/test/v4l2_videodevice/meson.build\n> +++ b/test/v4l2_videodevice/meson.build\n> @@ -3,22 +3,22 @@\n>  # Tests are listed in order of complexity.\n>  # They are not alphabetically sorted.\n>  v4l2_videodevice_tests = [\n> -    ['double_open',         'double_open.cpp'],\n> -    ['controls',            'controls.cpp'],\n> -    ['formats',             'formats.cpp'],\n> -    ['dequeue_watchdog',    'dequeue_watchdog.cpp'],\n> -    ['request_buffers',     'request_buffers.cpp'],\n> -    ['buffer_cache',        'buffer_cache.cpp'],\n> -    ['stream_on_off',       'stream_on_off.cpp'],\n> -    ['capture_async',       'capture_async.cpp'],\n> -    ['buffer_sharing',      'buffer_sharing.cpp'],\n> -    ['v4l2_m2mdevice',      'v4l2_m2mdevice.cpp'],\n> +    {'name': 'double_open', 'sources': ['double_open.cpp']},\n> +    {'name': 'controls', 'sources': ['controls.cpp']},\n> +    {'name': 'formats', 'sources': ['formats.cpp']},\n> +    {'name': 'dequeue_watchdog', 'sources': ['dequeue_watchdog.cpp']},\n> +    {'name': 'request_buffers', 'sources': ['request_buffers.cpp']},\n> +    {'name': 'buffer_cache', 'sources': ['buffer_cache.cpp']},\n> +    {'name': 'stream_on_off', 'sources': ['stream_on_off.cpp']},\n> +    {'name': 'capture_async', 'sources': ['capture_async.cpp']},\n> +    {'name': 'buffer_sharing', 'sources': ['buffer_sharing.cpp']},\n> +    {'name': 'v4l2_m2mdevice', 'sources': ['v4l2_m2mdevice.cpp']},\n>  ]\n>\n>  foreach test : v4l2_videodevice_tests\n> -    exe = executable(test[0], [test[1], 'v4l2_videodevice_test.cpp'],\n> +    exe = executable(test['name'], [test['sources'], 'v4l2_videodevice_test.cpp'],\n>                       dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n> +    test(test['name'], exe, suite : 'v4l2_videodevice', is_parallel : false)\n>  endforeach\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C78AEC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Oct 2022 07:25:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8D20462CEC;\n\tThu,  6 Oct 2022 09:25:36 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::221])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F36762CCD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Oct 2022 09:25:35 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id DC01D240007;\n\tThu,  6 Oct 2022 07:25:34 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665041136;\n\tbh=h8XtClat4yhklUGC0EREvNAuxCI+a3uF8KNKMwjcjMY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=GvTePNrXhBHWmeN83DeiYggCO5bIcu+ryt4otU15jjHhzon1f5K1g0dst3BkHynw0\n\t9ai8bWhqIuRcffBzsRh8b5nx8yN5f1KOTbt3g0Zepbguew7cXjRUyNyEfT+o+Xax0t\n\t5rZuZUqYP/NpIGKKxtqP6sTdZLOt/OuBvWjfkoxMkGCjfc3816wd099wID77EhYph1\n\tQaGh0jloQIrcVBubEg5sCwoxfQxngZUfY2Ce9U9u1UIoyWy5j9nxLC3+WN082K3rJp\n\t6N8K8iCwM34lcUhZCRfE4idnUwinOtBvCb72GGf1ypbs0MXQSJTrcqRtWcuo7kVXE3\n\tHFMDe+IKsKkJQ==","Date":"Thu, 6 Oct 2022 09:25:33 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221006072533.yv4tirjzhsbegq2d@uno.localdomain>","References":"<20221005193944.16383-1-laurent.pinchart@ideasonboard.com>\n\t<20221005193944.16383-3-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221005193944.16383-3-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] test: meson: Use dictionaries\n\tinstead of arrays to store test information","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25331,"web_url":"https://patchwork.libcamera.org/comment/25331/","msgid":"<4094a282-3414-d898-cfee-93e91cbe7000@ideasonboard.com>","date":"2022-10-07T13:37:54","subject":"Re: [libcamera-devel] [PATCH 2/2] test: meson: Use dictionaries\n\tinstead of arrays to store test information","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank for the patch\n\nOn 10/6/22 1:09 AM, Laurent Pinchart via libcamera-devel wrote:\n> Tests are listed in meson.build using arrays that contain the test name\n> and source files at fixed positions. This isn't very readable, leading\n> to code using test[0], test[1] and test[2]. Replace the arrays with\n> dictionaries to improve readability.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nLGTM,\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   test/camera/meson.build           | 16 +++---\n>   test/controls/meson.build         | 12 ++---\n>   test/gstreamer/meson.build        |  8 +--\n>   test/ipa/meson.build              |  8 +--\n>   test/ipc/meson.build              |  8 +--\n>   test/log/meson.build              |  8 +--\n>   test/media_device/meson.build     | 10 ++--\n>   test/meson.build                  | 84 +++++++++++++++----------------\n>   test/pipeline/ipu3/meson.build    |  6 +--\n>   test/pipeline/rkisp1/meson.build  |  6 +--\n>   test/process/meson.build          |  6 +--\n>   test/serialization/meson.build    |  8 +--\n>   test/stream/meson.build           |  8 +--\n>   test/v4l2_subdevice/meson.build   |  8 +--\n>   test/v4l2_videodevice/meson.build | 24 ++++-----\n>   15 files changed, 110 insertions(+), 110 deletions(-)\n>\n> diff --git a/test/camera/meson.build b/test/camera/meson.build\n> index df0520293bdb..4f9f8c8c4784 100644\n> --- a/test/camera/meson.build\n> +++ b/test/camera/meson.build\n> @@ -3,18 +3,18 @@\n>   # Tests are listed in order of complexity.\n>   # They are not alphabetically sorted.\n>   camera_tests = [\n> -    ['configuration_default',   'configuration_default.cpp'],\n> -    ['configuration_set',       'configuration_set.cpp'],\n> -    ['buffer_import',           'buffer_import.cpp'],\n> -    ['statemachine',            'statemachine.cpp'],\n> -    ['capture',                 'capture.cpp'],\n> -    ['camera_reconfigure',      'camera_reconfigure.cpp'],\n> +    {'name': 'configuration_default', 'sources': ['configuration_default.cpp']},\n> +    {'name': 'configuration_set', 'sources': ['configuration_set.cpp']},\n> +    {'name': 'buffer_import', 'sources': ['buffer_import.cpp']},\n> +    {'name': 'statemachine', 'sources': ['statemachine.cpp']},\n> +    {'name': 'capture', 'sources': ['capture.cpp']},\n> +    {'name': 'camera_reconfigure', 'sources': ['camera_reconfigure.cpp']},\n>   ]\n>   \n>   foreach test : camera_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'camera', is_parallel : false)\n> +    test(test['name'], exe, suite : 'camera', is_parallel : false)\n>   endforeach\n> diff --git a/test/controls/meson.build b/test/controls/meson.build\n> index 8cf23be6487c..763f8905e7c1 100644\n> --- a/test/controls/meson.build\n> +++ b/test/controls/meson.build\n> @@ -1,16 +1,16 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   control_tests = [\n> -    ['control_info',                'control_info.cpp'],\n> -    ['control_info_map',            'control_info_map.cpp'],\n> -    ['control_list',                'control_list.cpp'],\n> -    ['control_value',               'control_value.cpp'],\n> +    {'name': 'control_info', 'sources': ['control_info.cpp']},\n> +    {'name': 'control_info_map', 'sources': ['control_info_map.cpp']},\n> +    {'name': 'control_list', 'sources': ['control_list.cpp']},\n> +    {'name': 'control_value', 'sources': ['control_value.cpp']},\n>   ]\n>   \n>   foreach test : control_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_public,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'controls', is_parallel : false)\n> +    test(test['name'], exe, suite : 'controls', is_parallel : false)\n>   endforeach\n> diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\n> index 46f6a77a771e..745725864eef 100644\n> --- a/test/gstreamer/meson.build\n> +++ b/test/gstreamer/meson.build\n> @@ -5,16 +5,16 @@ if not gst_enabled\n>   endif\n>   \n>   gstreamer_tests = [\n> -    ['single_stream_test',   'gstreamer_single_stream_test.cpp'],\n> -    ['multi_stream_test',    'gstreamer_multi_stream_test.cpp'],\n> +    {'name': 'single_stream_test', 'sources': ['gstreamer_single_stream_test.cpp']},\n> +    {'name': 'multi_stream_test', 'sources': ['gstreamer_multi_stream_test.cpp']},\n>   ]\n>   gstreamer_dep = dependency('gstreamer-1.0', required: true)\n>   \n>   foreach test : gstreamer_tests\n> -    exe = executable(test[0], test[1], 'gstreamer_test.cpp',\n> +    exe = executable(test['name'], test['sources'], 'gstreamer_test.cpp',\n>                        dependencies : [libcamera_private, gstreamer_dep],\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'gstreamer', is_parallel : false)\n> +    test(test['name'], exe, suite : 'gstreamer', is_parallel : false)\n>   endforeach\n> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> index 295807fd8a45..180b0da0a51a 100644\n> --- a/test/ipa/meson.build\n> +++ b/test/ipa/meson.build\n> @@ -1,15 +1,15 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   ipa_test = [\n> -    ['ipa_module_test',     'ipa_module_test.cpp'],\n> -    ['ipa_interface_test',  'ipa_interface_test.cpp'],\n> +    {'name': 'ipa_module_test', 'sources': ['ipa_module_test.cpp']},\n> +    {'name': 'ipa_interface_test', 'sources': ['ipa_interface_test.cpp']},\n>   ]\n>   \n>   foreach test : ipa_test\n> -    exe = executable(test[0], [test[1], libcamera_generated_ipa_headers],\n> +    exe = executable(test['name'], test['sources'], libcamera_generated_ipa_headers,\n>                        dependencies : libcamera_private,\n>                        link_with : [libipa, test_libraries],\n>                        include_directories : [libipa_includes, test_includes_internal])\n>   \n> -    test(test[0], exe, suite : 'ipa')\n> +    test(test['name'], exe, suite : 'ipa')\n>   endforeach\n> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> index ce21135b701d..8e447d228201 100644\n> --- a/test/ipc/meson.build\n> +++ b/test/ipc/meson.build\n> @@ -1,15 +1,15 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   ipc_tests = [\n> -    ['unixsocket_ipc', 'unixsocket_ipc.cpp'],\n> -    ['unixsocket',     'unixsocket.cpp'],\n> +    {'name': 'unixsocket_ipc', 'sources': ['unixsocket_ipc.cpp']},\n> +    {'name': 'unixsocket', 'sources': ['unixsocket.cpp']},\n>   ]\n>   \n>   foreach test : ipc_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'ipc')\n> +    test(test['name'], exe, suite : 'ipc')\n>   endforeach\n> diff --git a/test/log/meson.build b/test/log/meson.build\n> index d2d51e471d52..2298ff84ee62 100644\n> --- a/test/log/meson.build\n> +++ b/test/log/meson.build\n> @@ -1,15 +1,15 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   log_test = [\n> -    ['log_api',     'log_api.cpp'],\n> -    ['log_process', 'log_process.cpp'],\n> +    {'name': 'log_api', 'sources': ['log_api.cpp']},\n> +    {'name': 'log_process', 'sources': ['log_process.cpp']},\n>   ]\n>   \n>   foreach test : log_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'log')\n> +    test(test['name'], exe, suite : 'log')\n>   endforeach\n> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> index 7d34509d6797..84966c976192 100644\n> --- a/test/media_device/meson.build\n> +++ b/test/media_device/meson.build\n> @@ -5,9 +5,9 @@ lib_mdev_test_sources = files([\n>   ])\n>   \n>   media_device_tests = [\n> -    ['media_device_acquire',            'media_device_acquire.cpp'],\n> -    ['media_device_print_test',         'media_device_print_test.cpp'],\n> -    ['media_device_link_test',          'media_device_link_test.cpp'],\n> +    {'name': 'media_device_acquire', 'sources': ['media_device_acquire.cpp']},\n> +    {'name': 'media_device_print_test', 'sources': ['media_device_print_test.cpp']},\n> +    {'name': 'media_device_link_test', 'sources': ['media_device_link_test.cpp']},\n>   ]\n>   \n>   lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> @@ -15,10 +15,10 @@ lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n>                                  include_directories : test_includes_internal)\n>   \n>   foreach test : media_device_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : [test_libraries, lib_mdev_test],\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'media_device', is_parallel : false)\n> +    test(test['name'], exe, suite : 'media_device', is_parallel : false)\n>   endforeach\n> diff --git a/test/meson.build b/test/meson.build\n> index 4bc01d78f4e6..05a54d5cad2f 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -26,82 +26,82 @@ subdir('v4l2_subdevice')\n>   subdir('v4l2_videodevice')\n>   \n>   public_tests = [\n> -    ['color-space',                     'color-space.cpp'],\n> -    ['geometry',                        'geometry.cpp'],\n> -    ['public-api',                      'public-api.cpp'],\n> -    ['signal',                          'signal.cpp'],\n> -    ['span',                            'span.cpp'],\n> +    {'name': 'color-space', 'sources': ['color-space.cpp']},\n> +    {'name': 'geometry', 'sources': ['geometry.cpp']},\n> +    {'name': 'public-api', 'sources': ['public-api.cpp']},\n> +    {'name': 'signal', 'sources': ['signal.cpp']},\n> +    {'name': 'span', 'sources': ['span.cpp']},\n>   ]\n>   \n>   internal_tests = [\n> -    ['bayer-format',                    'bayer-format.cpp'],\n> -    ['byte-stream-buffer',              'byte-stream-buffer.cpp'],\n> -    ['camera-sensor',                   'camera-sensor.cpp'],\n> -    ['delayed_controls',                'delayed_controls.cpp'],\n> -    ['event',                           'event.cpp'],\n> -    ['event-dispatcher',                'event-dispatcher.cpp'],\n> -    ['event-thread',                    'event-thread.cpp'],\n> -    ['file',                            'file.cpp'],\n> -    ['flags',                           'flags.cpp'],\n> -    ['hotplug-cameras',                 'hotplug-cameras.cpp'],\n> -    ['message',                         'message.cpp'],\n> -    ['object',                          'object.cpp'],\n> -    ['object-delete',                   'object-delete.cpp'],\n> -    ['object-invoke',                   'object-invoke.cpp'],\n> -    ['pixel-format',                    'pixel-format.cpp'],\n> -    ['shared-fd',                       'shared-fd.cpp'],\n> -    ['signal-threads',                  'signal-threads.cpp'],\n> -    ['threads',                         'threads.cpp', [libthreads]],\n> -    ['timer',                           'timer.cpp'],\n> -    ['timer-thread',                    'timer-thread.cpp'],\n> -    ['unique-fd',                       'unique-fd.cpp'],\n> -    ['utils',                           'utils.cpp'],\n> -    ['yaml-parser',                     'yaml-parser.cpp'],\n> +    {'name': 'bayer-format', 'sources': ['bayer-format.cpp']},\n> +    {'name': 'byte-stream-buffer', 'sources': ['byte-stream-buffer.cpp']},\n> +    {'name': 'camera-sensor', 'sources': ['camera-sensor.cpp']},\n> +    {'name': 'delayed_controls', 'sources': ['delayed_controls.cpp']},\n> +    {'name': 'event', 'sources': ['event.cpp']},\n> +    {'name': 'event-dispatcher', 'sources': ['event-dispatcher.cpp']},\n> +    {'name': 'event-thread', 'sources': ['event-thread.cpp']},\n> +    {'name': 'file', 'sources': ['file.cpp']},\n> +    {'name': 'flags', 'sources': ['flags.cpp']},\n> +    {'name': 'hotplug-cameras', 'sources': ['hotplug-cameras.cpp']},\n> +    {'name': 'message', 'sources': ['message.cpp']},\n> +    {'name': 'object', 'sources': ['object.cpp']},\n> +    {'name': 'object-delete', 'sources': ['object-delete.cpp']},\n> +    {'name': 'object-invoke', 'sources': ['object-invoke.cpp']},\n> +    {'name': 'pixel-format', 'sources': ['pixel-format.cpp']},\n> +    {'name': 'shared-fd', 'sources': ['shared-fd.cpp']},\n> +    {'name': 'signal-threads', 'sources': ['signal-threads.cpp']},\n> +    {'name': 'threads', 'sources': 'threads.cpp', 'dependencies': [libthreads]},\n> +    {'name': 'timer', 'sources': ['timer.cpp']},\n> +    {'name': 'timer-thread', 'sources': ['timer-thread.cpp']},\n> +    {'name': 'unique-fd', 'sources': ['unique-fd.cpp']},\n> +    {'name': 'utils', 'sources': ['utils.cpp']},\n> +    {'name': 'yaml-parser', 'sources': ['yaml-parser.cpp']},\n>   ]\n>   \n>   internal_non_parallel_tests = [\n> -    ['fence',                           'fence.cpp'],\n> -    ['mapped-buffer',                   'mapped-buffer.cpp'],\n> +    {'name': 'fence', 'sources': ['fence.cpp']},\n> +    {'name': 'mapped-buffer', 'sources': ['mapped-buffer.cpp']},\n>   ]\n>   \n>   foreach test : public_tests\n>       deps = [libcamera_public]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>       endif\n>   \n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : deps,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_public)\n>   \n> -    test(test[0], exe)\n> +    test(test['name'], exe)\n>   endforeach\n>   \n>   foreach test : internal_tests\n>       deps = [libcamera_private]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>       endif\n>   \n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : deps,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe)\n> +    test(test['name'], exe)\n>   endforeach\n>   \n>   foreach test : internal_non_parallel_tests\n>       deps = [libcamera_private]\n> -    if test.length() > 2\n> -        deps += test[2]\n> +    if 'dependencies' in test\n> +        deps += test['dependencies']\n>       endif\n>   \n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : deps,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, is_parallel : false)\n> +    test(test['name'], exe, is_parallel : false)\n>   endforeach\n> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> index 5fcf5730b0b0..af075707f505 100644\n> --- a/test/pipeline/ipu3/meson.build\n> +++ b/test/pipeline/ipu3/meson.build\n> @@ -1,14 +1,14 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   ipu3_test = [\n> -    ['ipu3_pipeline_test',            'ipu3_pipeline_test.cpp'],\n> +    {'name': 'ipu3_pipeline_test', 'sources': ['ipu3_pipeline_test.cpp']},\n>   ]\n>   \n>   foreach test : ipu3_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'ipu3', is_parallel : false)\n> +    test(test['name'], exe, suite : 'ipu3', is_parallel : false)\n>   endforeach\n> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> index c82cc78972f6..1d178ad9da6f 100644\n> --- a/test/pipeline/rkisp1/meson.build\n> +++ b/test/pipeline/rkisp1/meson.build\n> @@ -1,14 +1,14 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   rkisp1_test = [\n> -    ['rkisp1_pipeline_test',            'rkisp1_pipeline_test.cpp'],\n> +    {'name': 'rkisp1_pipeline_test', 'sources': ['rkisp1_pipeline_test.cpp']},\n>   ]\n>   \n>   foreach test : rkisp1_test\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'rkisp1', is_parallel : false)\n> +    test(test['name'], exe, suite : 'rkisp1', is_parallel : false)\n>   endforeach\n> diff --git a/test/process/meson.build b/test/process/meson.build\n> index c656d7343e54..a80dc2d99fdd 100644\n> --- a/test/process/meson.build\n> +++ b/test/process/meson.build\n> @@ -1,14 +1,14 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   process_tests = [\n> -    ['process_test',   'process_test.cpp'],\n> +    {'name': 'process_test', 'sources': ['process_test.cpp']},\n>   ]\n>   \n>   foreach test : process_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n>   \n> -    test(test[0], exe, suite : 'process', is_parallel : false)\n> +    test(test['name'], exe, suite : 'process', is_parallel : false)\n>   endforeach\n> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> index c4206cb3632b..a6e8d79358d9 100644\n> --- a/test/serialization/meson.build\n> +++ b/test/serialization/meson.build\n> @@ -3,14 +3,14 @@\n>   subdir('generated_serializer')\n>   \n>   serialization_tests = [\n> -    ['control_serialization',     'control_serialization.cpp'],\n> -    ['ipa_data_serializer_test',  'ipa_data_serializer_test.cpp'],\n> +    {'name': 'control_serialization', 'sources': ['control_serialization.cpp']},\n> +    {'name': 'ipa_data_serializer_test', 'sources': ['ipa_data_serializer_test.cpp']},\n>   ]\n>   \n>   foreach test : serialization_tests\n> -    exe = executable(test[0], [test[1], 'serialization_test.cpp'],\n> +    exe = executable(test['name'], test['sources'], 'serialization_test.cpp',\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'serialization', is_parallel : false)\n> +    test(test['name'], exe, suite : 'serialization', is_parallel : false)\n>   endforeach\n> diff --git a/test/stream/meson.build b/test/stream/meson.build\n> index 3a97868bce1c..a3b19bf592a5 100644\n> --- a/test/stream/meson.build\n> +++ b/test/stream/meson.build\n> @@ -1,14 +1,14 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   stream_tests = [\n> -    ['stream_colorspace', 'stream_colorspace.cpp'],\n> -    ['stream_formats',  'stream_formats.cpp'],\n> +    {'name': 'stream_colorspace', 'sources': ['stream_colorspace.cpp']},\n> +    {'name': 'stream_formats', 'sources': ['stream_formats.cpp']},\n>   ]\n>   \n>   foreach test : stream_tests\n> -    exe = executable(test[0], test[1],\n> +    exe = executable(test['name'], test['sources'],\n>                        dependencies : libcamera_public,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n> -    test(test[0], exe, suite: 'stream')\n> +    test(test['name'], exe, suite: 'stream')\n>   endforeach\n> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> index 4e607d41fc54..277f29bbcc41 100644\n> --- a/test/v4l2_subdevice/meson.build\n> +++ b/test/v4l2_subdevice/meson.build\n> @@ -1,14 +1,14 @@\n>   # SPDX-License-Identifier: CC0-1.0\n>   \n>   v4l2_subdevice_tests = [\n> -  ['list_formats',              'list_formats.cpp'],\n> -  ['test_formats',              'test_formats.cpp'],\n> +    {'name': 'list_formats', 'sources': ['list_formats.cpp']},\n> +    {'name': 'test_formats', 'sources': ['test_formats.cpp']},\n>   ]\n>   \n>   foreach test : v4l2_subdevice_tests\n> -    exe = executable(test[0], [test[1], 'v4l2_subdevice_test.cpp'],\n> +    exe = executable(test['name'], test['sources'], 'v4l2_subdevice_test.cpp',\n>           dependencies : libcamera_private,\n>           link_with : test_libraries,\n>           include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> +    test(test['name'], exe, suite : 'v4l2_subdevice', is_parallel : false)\n>   endforeach\n> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> index f85374854c48..87ea4f966ff1 100644\n> --- a/test/v4l2_videodevice/meson.build\n> +++ b/test/v4l2_videodevice/meson.build\n> @@ -3,22 +3,22 @@\n>   # Tests are listed in order of complexity.\n>   # They are not alphabetically sorted.\n>   v4l2_videodevice_tests = [\n> -    ['double_open',         'double_open.cpp'],\n> -    ['controls',            'controls.cpp'],\n> -    ['formats',             'formats.cpp'],\n> -    ['dequeue_watchdog',    'dequeue_watchdog.cpp'],\n> -    ['request_buffers',     'request_buffers.cpp'],\n> -    ['buffer_cache',        'buffer_cache.cpp'],\n> -    ['stream_on_off',       'stream_on_off.cpp'],\n> -    ['capture_async',       'capture_async.cpp'],\n> -    ['buffer_sharing',      'buffer_sharing.cpp'],\n> -    ['v4l2_m2mdevice',      'v4l2_m2mdevice.cpp'],\n> +    {'name': 'double_open', 'sources': ['double_open.cpp']},\n> +    {'name': 'controls', 'sources': ['controls.cpp']},\n> +    {'name': 'formats', 'sources': ['formats.cpp']},\n> +    {'name': 'dequeue_watchdog', 'sources': ['dequeue_watchdog.cpp']},\n> +    {'name': 'request_buffers', 'sources': ['request_buffers.cpp']},\n> +    {'name': 'buffer_cache', 'sources': ['buffer_cache.cpp']},\n> +    {'name': 'stream_on_off', 'sources': ['stream_on_off.cpp']},\n> +    {'name': 'capture_async', 'sources': ['capture_async.cpp']},\n> +    {'name': 'buffer_sharing', 'sources': ['buffer_sharing.cpp']},\n> +    {'name': 'v4l2_m2mdevice', 'sources': ['v4l2_m2mdevice.cpp']},\n>   ]\n>   \n>   foreach test : v4l2_videodevice_tests\n> -    exe = executable(test[0], [test[1], 'v4l2_videodevice_test.cpp'],\n> +    exe = executable(test['name'], [test['sources'], 'v4l2_videodevice_test.cpp'],\n>                        dependencies : libcamera_private,\n>                        link_with : test_libraries,\n>                        include_directories : test_includes_internal)\n> -    test(test[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n> +    test(test['name'], exe, suite : 'v4l2_videodevice', is_parallel : false)\n>   endforeach","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 80003C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 Oct 2022 13:38:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D698B62D15;\n\tFri,  7 Oct 2022 15:38:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6174660A88\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 Oct 2022 15:38:01 +0200 (CEST)","from [192.168.1.103] (unknown [103.251.226.3])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B4ACDBBE;\n\tFri,  7 Oct 2022 15:37:59 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665149882;\n\tbh=gXZwpJ/z/ixkr8EXCJ3RrRTktENb/EeuWX632+DNvYg=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=eYnyGwutr9n4HUbXeXnDG6nQnWId2339IcGRcmllvVmFZ7CA7XZsZwFA23aEw8AXb\n\tWGubTcCJyv3Bb4eDW7y/CIfB2706DoTczB/S6W69XBZEk5B7UO0jmhcxgvcHPS7UOo\n\tsx/yX7aOlu/wyI56ljC5giRO+lFUgVWnPR6Abx1LnJbm7SqdlAJ4YosaJbIIAFlYsY\n\t17U7vOugTr4S0oAKZAHxKqO1WG24Lmk3zgfXamU6BBeBlVCpsI1klwaIr5yBLWRFcz\n\t8k/7KAPUSZhtaE7dOBgSXQtO3JfmXOfzFQDPtjA3pseKql2/9mauy2ELtUqvfmPm1T\n\tZ0UWGQGW+Hm0Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665149880;\n\tbh=gXZwpJ/z/ixkr8EXCJ3RrRTktENb/EeuWX632+DNvYg=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=I4D1CBzxXOTcWqoPdqXzeW125Ovmh2ouyaA33zQm8dxhJxlkmqhfyl5efMQLYVsc3\n\t9BLuIUmzrGxxtF5L+ZAE6HMKEYQ+y3Ml86ccDG8TI0yguvpu48gnOnOHdk9R+WiW1U\n\toSwf4wKsbtrD7CGd065TMwZho02yOv01ZuhbccvQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"I4D1CBzx\"; dkim-atps=neutral","Message-ID":"<4094a282-3414-d898-cfee-93e91cbe7000@ideasonboard.com>","Date":"Fri, 7 Oct 2022 19:07:54 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20221005193944.16383-1-laurent.pinchart@ideasonboard.com>\n\t<20221005193944.16383-3-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221005193944.16383-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] test: meson: Use dictionaries\n\tinstead of arrays to store test information","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]