Imported Upstream version 0.1.17
[platform/upstream/libnice.git] / tests / meson.build
1 nice_tests = [
2   'test-pseudotcp',
3   # 'test-pseudotcp-fuzzy', FIXME: this test is not reliable, times out sometimes
4   'test-bsd',
5   'test',
6   'test-address',
7   'test-add-remove-stream',
8   'test-build-io-stream',
9   'test-io-stream-thread',
10   'test-io-stream-closing-write',
11   'test-io-stream-closing-read',
12   'test-io-stream-cancelling',
13   'test-io-stream-pollable',
14   'test-send-recv',
15   'test-socket-is-based-on',
16   'test-udp-turn-fragmentation',
17   'test-priority',
18   'test-fullmode',
19   'test-different-number-streams',
20   'test-restart',
21   'test-fallback',
22   'test-thread',
23   'test-trickle',
24   'test-tcp',
25   'test-icetcp',
26   'test-credentials',
27   'test-turn',
28   'test-drop-invalid',
29   'test-nomination',
30   'test-interfaces',
31 ]
32
33 if cc.has_header('arpa/inet.h')
34   nice_tests += [
35     'test-pseudotcp-fin',
36     'test-new-trickle',
37   ]
38 endif
39
40 tenv = environment()
41 tenv.set('BUILT_WITH_MESON', '1')
42
43 foreach tname : nice_tests
44   if tname.startswith('test-io-stream') or tname.startswith('test-send-recv')
45     extra_src = ['test-io-stream-common.c']
46   else
47     extra_src = []
48   endif
49   exe = executable('nice-@0@'.format(tname),
50     '@0@.c'.format(tname), extra_src,
51     c_args: '-DG_LOG_DOMAIN="libnice-tests"',
52     include_directories: nice_incs,
53     dependencies: [nice_deps, libm],
54     link_with: [libagent, libstun, libsocket, librandom],
55     install: false)
56   set_variable(tname.underscorify(), exe)
57   test(tname, exe, env: tenv)
58
59   if tname == 'test-fullmode'
60     wrapper_exe = executable ('nice-test-fullmode-with-stun',
61                               'test-fullmode-with-stun.c',
62                               dependencies: gio_deps,
63                               install: false)
64     test('test-fullmode-with-stun', wrapper_exe,
65          args: [stund_exe, test_fullmode],
66          env: tenv,
67          is_parallel: false,
68          depends: exe)
69   endif
70 endforeach
71
72 if gst_dep.found()
73   gst_check = dependency('gstreamer-check-1.0', required: get_option('gstreamer'),
74                          fallback : ['gstreamer', 'gst_check_dep'])
75   if gst_check.found()
76     exe = executable('nice-test-gstreamer',
77       'test-gstreamer.c', extra_src,
78       c_args: '-DG_LOG_DOMAIN="libnice-tests"',
79       include_directories: nice_incs,
80       dependencies: [nice_deps, gst_check, libm],
81       link_with: libnice,
82       install: false)
83     gst_env = tenv
84     gst_env.append('GST_PLUGIN_PATH_1_0', join_paths(meson.current_build_dir(), '..', 'gst'))
85     test('test-gstreamer', exe, env: gst_env)
86   endif
87 endif
88
89 if find_program('sh', required : false).found() and find_program('dd', required : false).found() and find_program('diff', required : false).found()
90   test('test-pseudotcp-random', find_program('test-pseudotcp-random.sh'),
91        args: test_pseudotcp,
92        env: tenv)
93 endif
94
95 debugenv = environment()
96 debugenv.set('G_MESSAGES_DEBUG', 'all')
97 debugenv.set('NICE_DEBUG', 'all')
98 add_test_setup('debug', env: debugenv)