Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 1 | gtest_dep = dependency('gtest') |
| 2 | gtest_main_dep = dependency('gtest_main') |
| 3 | gmock_dep = dependency('gmock') |
| 4 | gmock_main_dep = dependency('gmock_main') |
| 5 | |
| 6 | tests = [ |
| 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 | |
| 19 | foreach t : tests |
| 20 | test( |
| 21 | 'test_' + t.underscorify(), |
| 22 | executable( |
| 23 | 'test-' + t.underscorify(), |
| 24 | t + '.cpp', |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 25 | dependencies: [ |
| 26 | gtest_dep, |
| 27 | gmock_dep, |
| 28 | gmock_main_dep, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 29 | sdbusplus_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 30 | ], |
| 31 | ) |
| 32 | ) |
| 33 | endforeach |
| 34 | |
| 35 | test( |
| 36 | 'test-vtable', |
| 37 | executable( |
| 38 | 'test-vtable', |
| 39 | 'vtable/vtable.cpp', |
| 40 | 'vtable/vtable_c.c', |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 41 | dependencies: [ gtest_dep, gtest_main_dep, sdbusplus_dep ], |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 42 | ), |
| 43 | ) |
| 44 | |
| 45 | server_buildroot = meson.current_build_dir() |
| 46 | server_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 | |
| 56 | test( |
| 57 | 'test-server', |
| 58 | executable( |
| 59 | 'test-server', |
| 60 | 'server/object.cpp', |
| 61 | server_files, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 62 | include_directories: include_directories('server'), |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 63 | dependencies: [ |
| 64 | gmock_dep, |
| 65 | gmock_main_dep, |
| 66 | gtest_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 67 | pthread_dep, |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 68 | sdbusplus_dep, |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 69 | ], |
| 70 | ), |
| 71 | ) |