16 'G_TEST_SRCDIR=' + meson.current_source_dir(),
17 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
20 if backends.contains('gnutls')
21 mock_pkcs11_module = shared_module('mock-pkcs11',
22 sources: 'mock-pkcs11.c',
24 gnu_symbol_visibility: 'hidden',
29 install: enable_installed_tests,
30 install_dir: installed_tests_execdir
33 mock_pkcs11_module = []
36 if enable_installed_tests
37 install_subdir('files', install_dir: installed_tests_execdir)
41 ['certificate', [], deps, [], [mock_pkcs11_module]],
42 ['file-database', [], deps, [], []],
43 ['connection', ['mock-interaction.c'], deps, [], [mock_pkcs11_module]],
44 # DTLS tests are disabled until we fix https://gitlab.gnome.org/GNOME/glib-networking/issues/49
45 # ['dtls-connection', ['mock-interaction.c', 'lossy-socket.c'], deps, [], [mock_pkcs11_module]],
48 foreach backend: backends
49 foreach program: test_programs
50 program_name = program[0] + '-' + backend
52 test_conf = configuration_data()
53 test_conf.set('installed_tests_dir', installed_tests_execdir)
54 test_conf.set('program', program_name)
55 test_conf.set('environment', '')
57 if enable_installed_tests
60 output: program_name + '.test',
61 install_dir: installed_tests_metadir,
62 configuration: test_conf
67 '-DBACKEND="@0@"'.format(backend),
68 '-DBACKEND_IS_' + backend.to_upper(),
69 '-DSIZEOF_TIME_T=@0@'.format(cc.sizeof('time_t', prefix: '#include <time.h>')),
72 if backend == 'openssl'
78 [program[0] + '.c'] + program[1],
79 include_directories: incs,
80 dependencies: program[2],
82 install: enable_installed_tests,
83 install_dir: installed_tests_execdir
87 'GIO_MODULE_DIR=' + join_paths(meson.project_build_root(), 'tls', backend),
88 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
89 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
92 test(program_name, exe, env: test_envs, depends: program[4])
94 if program[0] == 'connection'
95 # Run the tests again, this time with TLS 1.3 disabled so we can test TLS 1.2.
96 if backend == 'gnutls'
97 test(program_name + '-tls1.2', exe, env: test_envs + ['G_TLS_GNUTLS_PRIORITY=NORMAL:%COMPAT:!VERS-TLS1.3'])
98 elif backend == 'openssl'
99 test(program_name + '-tls1.2', exe, env: test_envs + ['G_TLS_OPENSSL_MAX_PROTO=0x0303'])
105 if enable_installed_tests
107 'files/ca-alternative.pem',
110 'files/ca-roots-bad.pem',
111 'files/ca-roots.pem',
112 'files/ca-verisign-sha1.pem',
114 'files/chain-with-verisign-md2.pem',
115 'files/client2-and-key.pem',
116 'files/client2-key.pem',
118 'files/client-and-key.pem',
119 'files/client-future.pem',
120 'files/client-past.pem',
123 'files/intermediate-ca.pem',
125 'files/server-and-key.pem',
127 'files/server-intermediate-key.pem',
128 'files/server-intermediate.pem',
129 'files/server-key.der',
130 'files/server-key.pem',
132 'files/server-self.pem'
137 install_dir: join_paths(installed_tests_execdir, 'files')