12f20c5abSAndrew Jefferygtest_dep = dependency('gtest', main: true, disabler: true, required: false) 22f20c5abSAndrew Jefferygmock_dep = dependency('gmock', disabler: true, required: false) 32f20c5abSAndrew Jefferyif not gtest_dep.found() or not gmock_dep.found() 42f20c5abSAndrew Jeffery gtest_proj = import('cmake').subproject('googletest', required: false) 52f20c5abSAndrew Jeffery if gtest_proj.found() 62f20c5abSAndrew Jeffery gtest_dep = declare_dependency( 72f20c5abSAndrew Jeffery dependencies: [ 82f20c5abSAndrew Jeffery dependency('threads'), 92f20c5abSAndrew Jeffery gtest_proj.dependency('gtest'), 102f20c5abSAndrew Jeffery gtest_proj.dependency('gtest_main'), 112f20c5abSAndrew Jeffery ] 122f20c5abSAndrew Jeffery ) 132f20c5abSAndrew Jeffery gmock_dep = gtest_proj.dependency('gmock') 142f20c5abSAndrew Jeffery else 152f20c5abSAndrew Jeffery assert( 162f20c5abSAndrew Jeffery not get_option('tests').enabled(), 172f20c5abSAndrew Jeffery 'Googletest is required if tests are enabled' 182f20c5abSAndrew Jeffery ) 192f20c5abSAndrew Jeffery endif 202f20c5abSAndrew Jefferyendif 21feb19ef0SBrad Bishop 22*16966b55SEd Tanousut_deps_list = [ 23*16966b55SEd Tanous gtest_dep, 24*16966b55SEd Tanous] 25*16966b55SEd Tanous 26*16966b55SEd Tanousut_deps_list += default_deps 27*16966b55SEd Tanous 282f20c5abSAndrew Jefferyhave_boost_dbus = meson.get_compiler('cpp').has_header('dbus/connection.hpp') 29feb19ef0SBrad Bishopif have_boost_dbus 30feb19ef0SBrad Bishoptest( 31feb19ef0SBrad Bishop 'test_hwmon_temp_sensor', 32feb19ef0SBrad Bishop executable( 33feb19ef0SBrad Bishop 'test_hwmon_temp_sensor', 34feb19ef0SBrad Bishop 'test_HwmonTempSensor.cpp', 35*16966b55SEd Tanous dependencies: ut_deps_list, 36feb19ef0SBrad Bishop implicit_include_directories: false, 37feb19ef0SBrad Bishop include_directories: '../include', 38feb19ef0SBrad Bishop ) 39feb19ef0SBrad Bishop) 40feb19ef0SBrad Bishop 41feb19ef0SBrad Bishoptest( 42feb19ef0SBrad Bishop 'test_tach_sensor', 43feb19ef0SBrad Bishop executable( 44feb19ef0SBrad Bishop 'test_tach_sensor', 45feb19ef0SBrad Bishop 'test_TachSensor.cpp', 46*16966b55SEd Tanous dependencies: ut_deps_list, 47feb19ef0SBrad Bishop implicit_include_directories: false, 48feb19ef0SBrad Bishop include_directories: '../include', 49feb19ef0SBrad Bishop ) 50feb19ef0SBrad Bishop) 51feb19ef0SBrad Bishopendif 52d3204145SLei YU 53d3204145SLei YUtest( 54d3204145SLei YU 'test_utils', 55d3204145SLei YU executable( 56d3204145SLei YU 'test_utils', 57d3204145SLei YU 'test_Utils.cpp', 58d3204145SLei YU '../src/Utils.cpp', 59*16966b55SEd Tanous dependencies: ut_deps_list, 60d3204145SLei YU implicit_include_directories: false, 61d3204145SLei YU include_directories: '../include', 62d3204145SLei YU ) 63d3204145SLei YU) 64