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/details/collection_function.cpp', 15 '../src/discrete_threshold.cpp', 16 '../src/metric.cpp', 17 '../src/numeric_threshold.cpp', 18 '../src/on_change_threshold.cpp', 19 '../src/persistent_json_storage.cpp', 20 '../src/report.cpp', 21 '../src/report_factory.cpp', 22 '../src/report_manager.cpp', 23 '../src/sensor.cpp', 24 '../src/sensor_cache.cpp', 25 '../src/trigger.cpp', 26 '../src/trigger_actions.cpp', 27 '../src/trigger_factory.cpp', 28 '../src/trigger_manager.cpp', 29 '../src/types/report_types.cpp', 30 '../src/utils/conversion_trigger.cpp', 31 '../src/utils/generate_id.cpp', 32 'src/dbus_environment.cpp', 33 'src/main.cpp', 34 'src/stubs/dbus_sensor_object.cpp', 35 'src/test_conversion.cpp', 36 'src/test_detached_timer.cpp', 37 'src/test_discrete_threshold.cpp', 38 'src/test_generate_id.cpp', 39 'src/test_metric.cpp', 40 'src/test_numeric_threshold.cpp', 41 'src/test_on_change_threshold.cpp', 42 'src/test_persistent_json_storage.cpp', 43 'src/test_report.cpp', 44 'src/test_report_manager.cpp', 45 'src/test_sensor.cpp', 46 'src/test_sensor_cache.cpp', 47 'src/test_transform.cpp', 48 'src/test_trigger.cpp', 49 'src/test_trigger_actions.cpp', 50 'src/test_trigger_manager.cpp', 51 'src/test_unique_call.cpp', 52 'src/utils/generate_unique_mock_id.cpp', 53 ], 54 dependencies: [ 55 boost, 56 gmock_dep, 57 gtest_dep, 58 nlohmann_json, 59 phosphor_logging, 60 sdbusplus, 61 ], 62 include_directories: ['../src', 'src'], 63 cpp_args: '-fno-lto' 64 ), 65 timeout: 120, 66) 67