# This file is in the public domain
libanastasistesting_SOURCES = [
    'testing_api_cmd_policy_store.c',
    'testing_api_cmd_truth_challenge.c',
    'testing_api_cmd_truth_solve.c',
    'testing_api_cmd_truth_store.c',
    'testing_api_cmd_policy_lookup.c',
    'testing_api_cmd_config.c',
    'testing_api_helpers.c',
    'testing_api_traits.c',
    'testing_cmd_truth_upload.c',
    'testing_cmd_policy_create.c',
    'testing_cmd_secret_share.c',
    'testing_cmd_recover_secret.c',
    'testing_cmd_challenge_answer.c',
]
libanastasistesting = library(
    'anastasistesting',
    libanastasistesting_SOURCES,
    soversion: solibversions['libanastasistesting']['soversion'],
    version: solibversions['libanastasistesting']['soversion'],
    install_rpath: rpath_option,
    dependencies: [
        libanastasis_dep,
        libanastasisrest_dep,
        talerexchange_dep,
        talermerchant_dep,
        talerjson_dep,
        talerutil_dep,
        gnunetutil_dep,
        gnunetcurl_dep,
        gnunetjson_dep,
        json_dep,
        talertesting_dep,
        libanastasisutil_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
    install_dir: get_option('libdir'),
)

libanastasistesting_dep = declare_dependency(link_with: libanastasistesting)
pkg.generate(
    libanastasistesting,
    url: 'https://taler.net',
    description: 'GNU Taler anastasis testing library',
)


test_anastasisrest_api = executable(
    'test_anastasisrest_api',
    ['test_anastasis_api.c'],
    dependencies: [
        libanastasistesting_dep,
        talermerchanttesting_dep,
        talertesting_dep,
        gnunetutil_dep,
        json_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: false,
)
test(
    'test_anastasisrest_api',
    test_anastasisrest_api,
    workdir: meson.current_build_dir(),
    suite: ['testing'],
    is_parallel: false,
    timeout: 300,
)



test_anastasis = executable(
    'test_anastasis',
    ['test_anastasis.c'],
    dependencies: [
        libanastasistesting_dep,
        talermerchanttesting_dep,
        talertesting_dep,
        talerexchange_dep,
        gnunetutil_dep,
        json_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: false,
)
test(
    'test_anastasis',
    test_anastasis,
    workdir: meson.current_build_dir(),
    suite: ['testing'],
    is_parallel: false,
    timeout: 300,
)



EXTRA_DIST = ['test_anastasis_api.conf', 'sms_authentication.sh']
foreach f : EXTRA_DIST
    configure_file(input: f, output: f, copy: true)
endforeach

subdir('test_anastasis_api_home' / 'taler' / 'exchange' / 'offline-keys')
