blob: 59e17bb47b31f685f3060405b617c7900a170714 [file] [log] [blame]
Patrick Williamsad145e02020-05-19 16:45:15 -05001gtest_dep = dependency('gtest')
2gtest_main_dep = dependency('gtest_main')
3gmock_dep = dependency('gmock')
4gmock_main_dep = dependency('gmock_main')
5
6tests = [
7 'bus/list_names',
8 'bus/match',
9 'exception/sdbus_error',
10 'message/append',
11 'message/read',
12 'message/native_types',
13 'message/types',
14 'timer',
15 'utility/tuple_to_array',
16 'utility/type_traits',
17]
18
19foreach t : tests
20 test(
21 'test_' + t.underscorify(),
22 executable(
23 'test-' + t.underscorify(),
24 t + '.cpp',
Patrick Williamsad145e02020-05-19 16:45:15 -050025 dependencies: [
26 gtest_dep,
27 gmock_dep,
28 gmock_main_dep,
Patrick Williamsd0285b92020-06-01 09:43:47 -050029 sdbusplus_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050030 ],
31 )
32 )
33endforeach
34
35test(
36 'test-vtable',
37 executable(
38 'test-vtable',
39 'vtable/vtable.cpp',
40 'vtable/vtable_c.c',
Patrick Williamsd0285b92020-06-01 09:43:47 -050041 dependencies: [ gtest_dep, gtest_main_dep, sdbusplus_dep ],
Patrick Williamsad145e02020-05-19 16:45:15 -050042 ),
43)
44
45server_buildroot = meson.current_build_dir()
46server_files = files(
47 run_command(
48 sdbusgen_prog,
49 '--tool', sdbusplusplus_prog,
50 '--output', server_buildroot,
51 'server',
52 check: true
53 ).stdout().strip().split('\n')
54)
55
56test(
57 'test-server',
58 executable(
59 'test-server',
60 'server/object.cpp',
61 server_files,
Patrick Williamsd0285b92020-06-01 09:43:47 -050062 include_directories: include_directories('server'),
Patrick Williamsad145e02020-05-19 16:45:15 -050063 dependencies: [
64 gmock_dep,
65 gmock_main_dep,
66 gtest_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050067 pthread_dep,
Patrick Williamsd0285b92020-06-01 09:43:47 -050068 sdbusplus_dep,
Patrick Williamsad145e02020-05-19 16:45:15 -050069 ],
70 ),
71)