1*2f20c5abSAndrew Jefferygtest_dep = dependency('gtest', main: true, disabler: true, required: false) 2*2f20c5abSAndrew Jefferygmock_dep = dependency('gmock', disabler: true, required: false) 3*2f20c5abSAndrew Jefferyif not gtest_dep.found() or not gmock_dep.found() 4*2f20c5abSAndrew Jeffery gtest_proj = import('cmake').subproject('googletest', required: false) 5*2f20c5abSAndrew Jeffery if gtest_proj.found() 6*2f20c5abSAndrew Jeffery gtest_dep = declare_dependency( 7*2f20c5abSAndrew Jeffery dependencies: [ 8*2f20c5abSAndrew Jeffery dependency('threads'), 9*2f20c5abSAndrew Jeffery gtest_proj.dependency('gtest'), 10*2f20c5abSAndrew Jeffery gtest_proj.dependency('gtest_main'), 11*2f20c5abSAndrew Jeffery ] 12*2f20c5abSAndrew Jeffery ) 13*2f20c5abSAndrew Jeffery gmock_dep = gtest_proj.dependency('gmock') 14*2f20c5abSAndrew Jeffery else 15*2f20c5abSAndrew Jeffery assert( 16*2f20c5abSAndrew Jeffery not get_option('tests').enabled(), 17*2f20c5abSAndrew Jeffery 'Googletest is required if tests are enabled' 18*2f20c5abSAndrew Jeffery ) 19*2f20c5abSAndrew Jeffery endif 20*2f20c5abSAndrew Jefferyendif 21feb19ef0SBrad Bishop 22*2f20c5abSAndrew Jefferyhave_boost_dbus = meson.get_compiler('cpp').has_header('dbus/connection.hpp') 23feb19ef0SBrad Bishopif have_boost_dbus 24feb19ef0SBrad Bishoptest( 25feb19ef0SBrad Bishop 'test_hwmon_temp_sensor', 26feb19ef0SBrad Bishop executable( 27feb19ef0SBrad Bishop 'test_hwmon_temp_sensor', 28feb19ef0SBrad Bishop 'test_HwmonTempSensor.cpp', 29feb19ef0SBrad Bishop dependencies: [ 30feb19ef0SBrad Bishop gtest, 31feb19ef0SBrad Bishop boost_dbus, 32feb19ef0SBrad Bishop ], 33feb19ef0SBrad Bishop implicit_include_directories: false, 34feb19ef0SBrad Bishop include_directories: '../include', 35feb19ef0SBrad Bishop ) 36feb19ef0SBrad Bishop) 37feb19ef0SBrad Bishop 38feb19ef0SBrad Bishoptest( 39feb19ef0SBrad Bishop 'test_tach_sensor', 40feb19ef0SBrad Bishop executable( 41feb19ef0SBrad Bishop 'test_tach_sensor', 42feb19ef0SBrad Bishop 'test_TachSensor.cpp', 43feb19ef0SBrad Bishop dependencies: [ 44feb19ef0SBrad Bishop gtest, 45feb19ef0SBrad Bishop boost_dbus, 46feb19ef0SBrad Bishop ], 47feb19ef0SBrad Bishop implicit_include_directories: false, 48feb19ef0SBrad Bishop include_directories: '../include', 49feb19ef0SBrad Bishop ) 50feb19ef0SBrad Bishop) 51feb19ef0SBrad Bishopendif 52