1gtest_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', 25 dependencies: [ 26 gtest_dep, 27 gmock_dep, 28 gmock_main_dep, 29 sdbusplus_dep, 30 ], 31 ) 32 ) 33endforeach 34 35test( 36 'test-vtable', 37 executable( 38 'test-vtable', 39 'vtable/vtable.cpp', 40 'vtable/vtable_c.c', 41 dependencies: [ gtest_dep, gtest_main_dep, sdbusplus_dep ], 42 ), 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, 62 include_directories: include_directories('server'), 63 dependencies: [ 64 gmock_dep, 65 gmock_main_dep, 66 gtest_dep, 67 pthread_dep, 68 sdbusplus_dep, 69 ], 70 ), 71) 72