test_dependencies = [
  dependency('glib-2.0', version : '>=2.16'),
  dependency('mm-glib', version : '>=1.14'),
  dependency('libcurl', version : '>7.70'),
  cc.find_library('dl'),
  cc.find_library('phonenumber', required: true)
]

test_vvmutil = executable('test-vvmutil',
  ['test-vvmutil.c', '../src/vvmutil.c', '../src/store.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_decode = executable('test_decode',
  ['test-decode.c', '../src/vvmutil.c', '../src/store.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_number_decode = executable('test_number_decode',
  ['test-number-decode.c', '../src/vvmutil.c', '../src/store.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_phone_utils = executable('test_phone_utils',
  ['test-phone-utils.c', '../src/phone-utils.cpp'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_service_providers = executable('test_service_providers',
  ['test-service-providers.c', '../src/service-providers.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_sms = executable('test_sms',
  ['test-sms.c', '../src/vvmutil.c', '../src/store.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_vvmparse = executable('test-vvmparse',
  ['test-vvmparse.c', '../src/vvmutil.c', '../src/store.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

test_vvm3 = executable('test_vvm3',
  ['test-vvm3.c', '../src/vvmutil.c', '../src/store.c', '../src/vvm3-activation.c'],
  include_directories : includes,
  dependencies : test_dependencies
)

# tests expect pwd to be at the project root, not in ./unit
test('test vvm attachment decode', test_vvmutil, workdir : meson.current_source_dir() + '/..')
test('test vvm headers', test_vvmparse, workdir : meson.current_source_dir() + '/..')
test('test decode', test_decode, workdir : meson.current_source_dir() + '/..')
test('test number decode', test_number_decode, workdir : meson.current_source_dir() + '/..')
test('test phone utils', test_phone_utils, workdir : meson.current_source_dir() + '/..')
test('test service providers', test_service_providers, workdir : meson.current_source_dir() + '/..')
test('test SMS', test_sms, workdir : meson.current_source_dir() + '/..')
test('test vvm3 parsers', test_vvm3, workdir : meson.current_source_dir() + '/..')
