# This file is in the public domain
check_SCRIPTS = [
    'test_anastasis_reducer_initialize_state',
    'test_anastasis_reducer_select_continent',
    'test_anastasis_reducer_select_country',
    'test_anastasis_reducer_backup_enter_user_attributes',
    'test_anastasis_reducer_add_authentication',
    'test_anastasis_reducer_done_authentication',
    'test_anastasis_reducer_done_policy_review',
    'test_anastasis_reducer_enter_secret',
    'test_anastasis_reducer_recovery_enter_user_attributes',
    'test_anastasis_reducer_recovery_no_pay',
    'test_anastasis_reducer_recovery_hanging',
    'test_iban',
]

foreach f : check_SCRIPTS
    t = configure_file(
        copy: true,
        input: '@0@.sh'.format(f),
        output: '@0@.sh'.format(f),
    )
    test(
        f,
        t,
        workdir: meson.current_build_dir(),
        suite: ['cli'],
        is_parallel: false,
    )
endforeach

EXTRA_DIST = [
    'setup.sh',
    'test_reducer.conf',
    'test_reducer_free.conf',
    'test_free_reducer.conf',
    'test_anastasis_reducer_1.conf',
    'test_anastasis_reducer_2.conf',
    'test_anastasis_reducer_3.conf',
    'test_anastasis_reducer_4.conf',
    'test_anastasis_reducer_free_1.conf',
    'test_anastasis_reducer_free_2.conf',
    'test_anastasis_reducer_free_3.conf',
    'test_anastasis_reducer_free_4.conf',
]

foreach f : EXTRA_DIST
    configure_file(input: f, output: f, copy: true)
endforeach

subdir('test_reducer_home' / '.local' / 'share' / 'taler' / 'exchange-offline')
subdir('resources')


executable(
    'anastasis-reducer',
    ['anastasis-cli-redux.c', 'anastasis-cli-common.c'],
    dependencies: [
        libanastasisutil_dep,
        libanastasisredux_dep,
        gnunetutil_dep,
        gnunetcurl_dep,
        gnunetjson_dep,
        json_dep,
        talerutil_dep,
        talerjson_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
)

executable(
    'anastasis-discover',
    ['anastasis-cli-discover.c', 'anastasis-cli-common.c'],
    dependencies: [
        libanastasisutil_dep,
        libanastasisredux_dep,
        gnunetutil_dep,
        gnunetcurl_dep,
        gnunetjson_dep,
        json_dep,
        talerutil_dep,
        talerjson_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
)


