Patrick Williams | 617e749 | 2020-06-18 09:28:38 -0500 | [diff] [blame^] | 1 | gtest_dep = dependency('gtest', main: true, disabler: true) |
| 2 | gmock_dep = dependency('gmock', disabler: true) |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 3 | |
| 4 | tests = [ |
| 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 | |
| 17 | foreach t : tests |
| 18 | test( |
| 19 | 'test_' + t.underscorify(), |
| 20 | executable( |
| 21 | 'test-' + t.underscorify(), |
| 22 | t + '.cpp', |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 23 | dependencies: [ |
| 24 | gtest_dep, |
| 25 | gmock_dep, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 26 | sdbusplus_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 27 | ], |
| 28 | ) |
| 29 | ) |
| 30 | endforeach |
| 31 | |
| 32 | test( |
Patrick Williams | 3a6d584 | 2020-06-09 14:59:58 -0500 | [diff] [blame] | 33 | 'test-bus_aio', |
| 34 | executable( |
| 35 | 'test-bus_aio', |
| 36 | 'bus/aio.cpp', |
| 37 | dependencies: [ |
| 38 | boost_dep, |
| 39 | gmock_dep, |
Patrick Williams | 3a6d584 | 2020-06-09 14:59:58 -0500 | [diff] [blame] | 40 | gtest_dep, |
| 41 | sdbusplus_dep, |
| 42 | ], |
| 43 | ) |
| 44 | ) |
| 45 | |
| 46 | test( |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 47 | 'test-vtable', |
| 48 | executable( |
| 49 | 'test-vtable', |
| 50 | 'vtable/vtable.cpp', |
| 51 | 'vtable/vtable_c.c', |
Patrick Williams | 617e749 | 2020-06-18 09:28:38 -0500 | [diff] [blame^] | 52 | dependencies: [ |
| 53 | gtest_dep, |
| 54 | sdbusplus_dep, |
| 55 | ], |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 56 | ), |
| 57 | ) |
| 58 | |
| 59 | server_buildroot = meson.current_build_dir() |
| 60 | server_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 | |
| 70 | test( |
| 71 | 'test-server', |
| 72 | executable( |
| 73 | 'test-server', |
| 74 | 'server/object.cpp', |
| 75 | server_files, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 76 | include_directories: include_directories('server'), |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 77 | dependencies: [ |
| 78 | gmock_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 79 | gtest_dep, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 80 | sdbusplus_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 81 | ], |
| 82 | ), |
| 83 | ) |