Rewrite integration test suite in Python
[tinc] / test / integration / meson.build
1 tests = [
2   'basic.py',
3   'command_fsck.py',
4   'commandline.py',
5   'executables.py',
6   'import_export.py',
7   'invite_tinc_up.py',
8   'invite.py',
9   'scripts.py',
10   'security.py',
11   'splice.py',
12   'sptps_basic.py',
13   'variables.py',
14 ]
15
16 if opt_crypto != 'nolegacy'
17   tests += [
18     'algorithms.py',
19     'legacy_protocol.py',
20   ]
21 endif
22
23 if os_name == 'linux'
24   tests += [
25     'ns_ping.py',
26     'compression.py',
27   ]
28 endif
29
30 exe_splice = executable(
31   'splice',
32   sources: 'splice.c',
33   dependencies: deps_common,
34   implicit_include_directories: false,
35   include_directories: inc_conf,
36   build_by_default: false,
37 )
38
39 env_vars = {
40   'TINC_PATH': exe_tinc.full_path(),
41   'TINCD_PATH': exe_tincd.full_path(),
42   'PYTHON_PATH': python_path,
43   'SPLICE_PATH': exe_splice.full_path(),
44   'SPTPS_TEST_PATH': exe_sptps_test.full_path(),
45   'SPTPS_KEYPAIR_PATH': exe_sptps_keypair.full_path(),
46 }
47
48 deps_test = [
49   exe_tinc,
50   exe_tincd,
51   exe_splice,
52   exe_sptps_test,
53   exe_sptps_keypair,
54 ]
55
56 test_wd = meson.current_build_dir()
57 test_src = meson.current_source_dir()
58
59 foreach test_name : tests
60   if meson_version.version_compare('>=0.52')
61     env = environment(env_vars)
62   else
63     env = environment()
64     foreach k, v : env_vars
65       env.set(k, v)
66     endforeach
67   endif
68   env.set('TEST_NAME', test_name)
69
70   test(test_name,
71        python,
72        args: test_src / test_name,
73        suite: 'integration',
74        timeout: 60,
75        env: env,
76        depends: deps_test,
77        workdir: test_wd)
78 endforeach
79