41a9d3b709bb46b4d44a56051787414ab16935b1
[tinc] / test / integration / meson.build
1 tests = [
2   'address_cache.py',
3   'basic.py',
4   'bind_port.py',
5   'cmd_dump.py',
6   'cmd_fsck.py',
7   'cmd_import.py',
8   'cmd_join.py',
9   'cmd_keys.py',
10   'cmd_misc.py',
11   'cmd_net.py',
12   'cmd_sign_verify.py',
13   'commandline.py',
14   'device.py',
15   'device_multicast.py',
16   'executables.py',
17   'import_export.py',
18   'invite.py',
19   'invite_tinc_up.py',
20   'net.py',
21   'proxy.py',
22   'sandbox.py',
23   'scripts.py',
24   'security.py',
25   'splice.py',
26   'sptps_basic.py',
27   'variables.py',
28 ]
29
30 if opt_crypto != 'nolegacy'
31   tests += [
32     'algorithms.py',
33     'legacy_protocol.py',
34   ]
35 endif
36
37 if os_name == 'linux'
38   tests += [
39     'bind_address.py',
40     'compression.py',
41     'device_raw_socket.py',
42     'device_tap.py',
43     'ns_ping.py',
44   ]
45   if not opt_systemd.disabled()
46     tests += 'systemd.py'
47   endif
48 endif
49
50 if cdata.has('HAVE_FD_DEVICE')
51   tests += 'device_fd.py'
52 endif
53
54 exe_splice = executable(
55   'splice',
56   sources: 'splice.c',
57   dependencies: deps_common,
58   implicit_include_directories: false,
59   include_directories: inc_conf,
60   build_by_default: false,
61 )
62
63 env_vars = {
64   'TINC_PATH': exe_tinc.full_path(),
65   'TINCD_PATH': exe_tincd.full_path(),
66   'PYTHON_PATH': python_path,
67   'SPLICE_PATH': exe_splice.full_path(),
68   'SPTPS_TEST_PATH': exe_sptps_test.full_path(),
69   'SPTPS_KEYPAIR_PATH': exe_sptps_keypair.full_path(),
70 }
71
72 deps_test = [
73   exe_tinc,
74   exe_tincd,
75   exe_splice,
76   exe_sptps_test,
77   exe_sptps_keypair,
78 ]
79
80 test_wd = meson.current_build_dir()
81 test_src = meson.current_source_dir()
82
83 foreach test_name : tests
84   if meson_version.version_compare('>=0.52')
85     env = environment(env_vars)
86   else
87     env = environment()
88     foreach k, v : env_vars
89       env.set(k, v)
90     endforeach
91   endif
92   env.set('TEST_NAME', test_name)
93
94   test(test_name,
95        python,
96        args: test_src / test_name,
97        suite: 'integration',
98        timeout: 60,
99        env: env,
100        depends: deps_test,
101        workdir: test_wd)
102 endforeach
103