
buffer_tests = [
  'blank',
  'buffer_copy',
  'buffer_copy_abyss',
  'buffer_copy_lower_left',
  'buffer_copy_lower_right',
  'buffer_copy_self',
  'buffer_copy_upper_left',
  'buffer_copy_upper_right',
  'buffer_dup_copy1',
  'buffer_dup_copy2',
  'buffer_dup_delete1',
  'buffer_dup_delete2',
  'buffer_dup_write1',
  'buffer_dup_write2',
  'buffer_dup_write3',
  'buffer_dup_write4',
  'buffer_iterator1',
  'buffer_iterator1sub',
  'buffer_iterator2',
  'buffer_iterator2sub',
  'buffer_iterator3',
  'buffer_iterator3sub',
  'buffer_iterator4',
  'buffer_iterator4sub',
  'buffer_linear_copy',
  'buffer_linear_iter',
  'buffer_linear_iter2',
  'buffer_multcopy',
  'buffer_set_pattern',
  'buffer_shift_diagonal',
  'buffer_shift_horizontal',
  'buffer_shift_vertical',
  'checks',
  'disabled_abyss',
  'dup_linear_from_data',
  'get_abyss_black',
  'get_abyss_clamp',
  'get_abyss_empty_buffer',
  'get_abyss_loop',
  'get_abyss_none',
  'get_abyss_white',
  'get_buffer_scaled',
  'get_buffer_scaled2',
  'get_shifted',
  'gray',
  'grow_extent',
  'linear_from_data',
  'linear_from_data_rows',
  'linear_modify',
  'linear_new',
  'linear_proxy_modify',
  'linear_shift',
  'mipmap_iterator',
  'mipmap_iterator2',
  'mipmap_sampler',
  'mipmap_set',
  'mipmap_set2',
  'rect',
  'sample',
  'save_small_roi',
  'sub_rect_fills_and_gets',
  'sub_sub_fill',
  'sub_sub_fill2',
  'vertical_gradient',
]

buffer_test = find_program('buffer-test.py')
foreach _test : buffer_tests
  _test_exe = executable(_test,
    'buffer-test-wrapper.c',
    include_directories: gegl_test_includes,
    link_with: gegl_lib,
    dependencies: gegl_test_deps,
    c_args: [
      '-Wno-unused-function',
      '-DTEST_NAME="@0@"'.format(_test),
      '-DTEST_INCLUDE="@0@"'.format('tests' / _test + '.c'),
    ],
  )

  test(_test,
    buffer_test,
    args: [
      '--reference-dir', meson.current_source_dir() / 'reference',
      _test_exe,
    ],
    env: gegl_test_env,
    workdir: meson.current_build_dir(),
    suite: 'buffer',
    is_parallel: gegl_test_parallel,
  )
endforeach
