blob: c33593a325e7a397efb9fab2e482b0cc0e1a8318 [file] [log] [blame]
Patrick Williams617e7492020-06-18 09:28:38 -05001gtest_dep = dependency('gtest', main: true, disabler: true)
2gmock_dep = dependency('gmock', disabler: true)
Patrick Williamsad145e02020-05-19 16:45:15 -05003
4tests = [
5 'bus/list_names',
6 'bus/match',
7 'exception/sdbus_error',
8 'message/append',
9 'message/read',
10 'message/native_types',
11 'message/types',
12 'timer',
13 'utility/tuple_to_array',
14 'utility/type_traits',
15]
16
17foreach t : tests
18 test(
19 'test_' + t.underscorify(),
20 executable(
21 'test-' + t.underscorify(),
22 t + '.cpp',
Patrick Williamsad145e02020-05-19 16:45:15 -050023 dependencies: [
24 gtest_dep,
25 gmock_dep,
Patrick Williamsd0285b92020-06-01 09:43:47 -050026 sdbusplus_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050027 ],
28 )
29 )
30endforeach
31
32test(
Patrick Williams3a6d5842020-06-09 14:59:58 -050033 'test-bus_aio',
34 executable(
35 'test-bus_aio',
36 'bus/aio.cpp',
37 dependencies: [
38 boost_dep,
39 gmock_dep,
Patrick Williams3a6d5842020-06-09 14:59:58 -050040 gtest_dep,
41 sdbusplus_dep,
42 ],
43 )
44)
45
46test(
Patrick Williamsad145e02020-05-19 16:45:15 -050047 'test-vtable',
48 executable(
49 'test-vtable',
50 'vtable/vtable.cpp',
51 'vtable/vtable_c.c',
Patrick Williams617e7492020-06-18 09:28:38 -050052 dependencies: [
53 gtest_dep,
54 sdbusplus_dep,
55 ],
Patrick Williamsad145e02020-05-19 16:45:15 -050056 ),
57)
58
59server_buildroot = meson.current_build_dir()
60server_files = files(
61 run_command(
62 sdbusgen_prog,
63 '--tool', sdbusplusplus_prog,
64 '--output', server_buildroot,
65 'server',
66 check: true
67 ).stdout().strip().split('\n')
68)
69
70test(
71 'test-server',
72 executable(
73 'test-server',
74 'server/object.cpp',
75 server_files,
Patrick Williamsd0285b92020-06-01 09:43:47 -050076 include_directories: include_directories('server'),
Patrick Williamsad145e02020-05-19 16:45:15 -050077 dependencies: [
78 gmock_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050079 gtest_dep,
Patrick Williamsd0285b92020-06-01 09:43:47 -050080 sdbusplus_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050081 ],
82 ),
83)