# Copyright (c) 2022-2026, PostgreSQL Global Development Group

tests += {
  'name': 'subscription',
  'sd': meson.current_source_dir(),
  'bd': meson.current_build_dir(),
  'tap': {
    'env': {
      'with_icu': icu.found() ? 'yes' : 'no',
      'enable_injection_points': get_option('injection_points') ? 'yes' : 'no',
    },
    'tests': [
      't/001_rep_changes.pl',
      't/002_types.pl',
      't/003_constraints.pl',
      't/004_sync.pl',
      't/005_encoding.pl',
      't/006_rewrite.pl',
      't/007_ddl.pl',
      't/008_diff_schema.pl',
      't/009_matviews.pl',
      't/010_truncate.pl',
      't/011_generated.pl',
      't/012_collation.pl',
      't/013_partition.pl',
      't/014_binary.pl',
      't/015_stream.pl',
      't/016_stream_subxact.pl',
      't/017_stream_ddl.pl',
      't/018_stream_subxact_abort.pl',
      't/019_stream_subxact_ddl_abort.pl',
      't/020_messages.pl',
      't/021_twophase.pl',
      't/022_twophase_cascade.pl',
      't/023_twophase_stream.pl',
      't/024_add_drop_pub.pl',
      't/025_rep_changes_for_schema.pl',
      't/026_stats.pl',
      't/027_nosuperuser.pl',
      't/028_row_filter.pl',
      't/029_on_error.pl',
      't/030_origin.pl',
      't/031_column_list.pl',
      't/032_subscribe_use_index.pl',
      't/033_run_as_table_owner.pl',
      't/034_temporal.pl',
      't/035_conflicts.pl',
      't/036_sequences.pl',
      't/037_except.pl',
      't/038_walsnd_shutdown_timeout.pl',
      't/100_bugs.pl',
    ],
  },
}

# [PG_CUSTOM: CFS]
# CFS logical replication TAP tests registered as a separate test suite
# 'subscription_cfs', appended after the vanilla subscription block.
# CFS tests are only registered when the 'cfs' feature is enabled.
if get_option('cfs').enabled() or get_option('cfs').auto()
  tests += {
    'name': 'subscription_cfs',
    'sd': meson.current_source_dir(),
    'bd': meson.current_build_dir(),
    'tap': {
      'tests': [
        't/500_cfs_logical.pl',
        't/501_cfs_stream.pl',
      ],
    },
  }
endif
