xref: /openbmc/telemetry/tests/meson.build (revision 4416fce6fb6539b4e2a6a94a8248934c2eb29820)
1gtest_dep = dependency('gtest', main: false, required: false, version: '>=1.10.0')
2gmock_dep = dependency('gmock', required: false, version: '>=1.10.0')
3if not gtest_dep.found() or not gmock_dep.found()
4    gtest_proj = import('cmake').subproject('googletest')
5    gtest_dep = gtest_proj.dependency('gtest')
6    gmock_dep = gtest_proj.dependency('gmock')
7endif
8
9test(
10    'telemetry-ut',
11    executable(
12        'telemetry-ut',
13        [
14            '../src/discrete_threshold.cpp',
15            '../src/metric.cpp',
16            '../src/numeric_threshold.cpp',
17            '../src/on_change_threshold.cpp',
18            '../src/persistent_json_storage.cpp',
19            '../src/report.cpp',
20            '../src/report_factory.cpp',
21            '../src/report_manager.cpp',
22            '../src/sensor.cpp',
23            '../src/sensor_cache.cpp',
24            '../src/trigger.cpp',
25            '../src/trigger_actions.cpp',
26            '../src/trigger_factory.cpp',
27            '../src/trigger_manager.cpp',
28            '../src/utils/conversion_trigger.cpp',
29            'src/dbus_environment.cpp',
30            'src/main.cpp',
31            'src/stubs/dbus_sensor_object.cpp',
32            'src/test_conversion.cpp',
33            'src/test_detached_timer.cpp',
34            'src/test_discrete_threshold.cpp',
35            'src/test_metric.cpp',
36            'src/test_numeric_threshold.cpp',
37            'src/test_on_change_threshold.cpp',
38            'src/test_persistent_json_storage.cpp',
39            'src/test_report.cpp',
40            'src/test_report_manager.cpp',
41            'src/test_sensor.cpp',
42            'src/test_sensor_cache.cpp',
43            'src/test_transform.cpp',
44            'src/test_trigger.cpp',
45            'src/test_trigger_actions.cpp',
46            'src/test_trigger_manager.cpp',
47            'src/test_unique_call.cpp',
48            'src/utils/generate_unique_mock_id.cpp',
49        ],
50        dependencies: [
51            boost,
52            gmock_dep,
53            gtest_dep,
54            nlohmann_json,
55            phosphor_logging,
56            sdbusplus,
57        ],
58        include_directories: ['../src', 'src']
59    ),
60    timeout: 120,
61)
62