summaryrefslogtreecommitdiff
path: root/libnm-core/tests/meson.build
blob: 6e8a2493d8bbf76e2c791bd55304d436f1b6ae67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# test-cert.p12 created with:
#
# openssl pkcs12 -export \
# -in test_key_and_cert.pem \
# -inkey test_key_and_cert.pem \
# -certfile test_ca_cert.pem \
# -name "test-pkcs12" \
# -out test-cert.p12

enum_types = 'nm-core-tests-enum-types'

enum = gnome.mkenums(
  enum_types,
  sources: 'test-general-enums.h',
  identifier_prefix: nm_id_prefix,
  c_template: enum_types + '.c.template',
  h_template: enum_types + '.h.template'
)

test_units = [
  'test-compare',
  'test-crypto',
  'test-general',
  'test-keyfile',
  'test-secrets',
  'test-setting',
  'test-settings-defaults'
]

test_cert_dir = join_paths(meson.current_source_dir(), 'certs')

cflags = [
  '-DNETWORKMANAGER_COMPILATION_TEST',
  '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
  '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir),
]

foreach test_unit: test_units
  exe = executable(
    'libnm-core-' + test_unit,
    [test_unit + '.c'] + enum,
    dependencies: nm_core_dep,
    c_args: cflags,
    link_with: libnm_core
  )
  test(
    'libnm-core/' + test_unit,
    test_script,
    args: test_args + [exe.full_path()]
  )
endforeach