blob: 50eaf0e388aa0dca446fe1b6c7a88363a07310ea [file] [log] [blame]
Andrew Jeffery2f20c5a2021-05-27 14:52:49 +09301gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
2gmock_dep = dependency('gmock', disabler: true, required: false)
3if not gtest_dep.found() or not gmock_dep.found()
4 gtest_proj = import('cmake').subproject('googletest', required: false)
5 if gtest_proj.found()
6 gtest_dep = declare_dependency(
7 dependencies: [
8 dependency('threads'),
9 gtest_proj.dependency('gtest'),
10 gtest_proj.dependency('gtest_main'),
11 ]
12 )
13 gmock_dep = gtest_proj.dependency('gmock')
14 else
15 assert(
16 not get_option('tests').enabled(),
17 'Googletest is required if tests are enabled'
18 )
19 endif
20endif
Brad Bishopfeb19ef2019-11-07 18:02:16 -050021
Andrew Jeffery2f20c5a2021-05-27 14:52:49 +093022have_boost_dbus = meson.get_compiler('cpp').has_header('dbus/connection.hpp')
Brad Bishopfeb19ef2019-11-07 18:02:16 -050023if have_boost_dbus
24test(
25 'test_hwmon_temp_sensor',
26 executable(
27 'test_hwmon_temp_sensor',
28 'test_HwmonTempSensor.cpp',
29 dependencies: [
30 gtest,
31 boost_dbus,
32 ],
33 implicit_include_directories: false,
34 include_directories: '../include',
35 )
36)
37
38test(
39 'test_tach_sensor',
40 executable(
41 'test_tach_sensor',
42 'test_TachSensor.cpp',
43 dependencies: [
44 gtest,
45 boost_dbus,
46 ],
47 implicit_include_directories: false,
48 include_directories: '../include',
49 )
50)
51endif