blob: 0717c7fe78b20e8ac9a9abd0a7fcae0518d1f1ce [file] [log] [blame]
Patrick Williams7d24aa22025-02-01 08:37:37 -05001gtest_dep = dependency(
2 'gtest',
3 main: false,
4 required: false,
5 version: '>=1.11.0',
6)
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +01007gmock_dep = dependency('gmock', required: false, version: '>=1.11.0')
Krzysztof Grobelny73da6902020-09-24 13:42:04 +02008if not gtest_dep.found() or not gmock_dep.found()
Wludzik, Jozef596a9942021-01-27 12:28:59 +01009 gtest_proj = import('cmake').subproject('googletest')
10 gtest_dep = gtest_proj.dependency('gtest')
11 gmock_dep = gtest_proj.dependency('gmock')
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020012endif
13
14test(
15 'telemetry-ut',
16 executable(
17 'telemetry-ut',
18 [
Szymon Dompkef763c9e2021-03-12 09:19:22 +010019 '../src/discrete_threshold.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020020 '../src/metric.cpp',
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +010021 '../src/metrics/collection_data.cpp',
22 '../src/metrics/collection_function.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010023 '../src/numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010024 '../src/on_change_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020025 '../src/persistent_json_storage.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020026 '../src/report.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020027 '../src/report_factory.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020028 '../src/report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020029 '../src/sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020030 '../src/sensor_cache.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010031 '../src/trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010032 '../src/trigger_actions.cpp',
Krzysztof Grobelny62c08e92022-09-16 10:28:53 +020033 '../src/errors.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010034 '../src/trigger_factory.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010035 '../src/trigger_manager.cpp',
Krzysztof Grobelny493e62e2022-02-14 10:55:50 +010036 '../src/types/readings.cpp',
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000037 '../src/types/report_types.cpp',
Cezary Zwolak4416fce2021-03-17 03:21:06 +010038 '../src/utils/conversion_trigger.cpp',
Szymon Dompke1cdd7e42022-06-08 14:43:13 +020039 '../src/utils/dbus_path_utils.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020040 '../src/utils/make_id_name.cpp',
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +010041 '../src/utils/messanger_service.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020042 'src/dbus_environment.cpp',
43 'src/main.cpp',
44 'src/stubs/dbus_sensor_object.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010045 'src/test_conversion.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020046 'src/test_detached_timer.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010047 'src/test_discrete_threshold.cpp',
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +010048 'src/test_ensure.cpp',
Szymon Dompke0253f6d2022-09-15 23:18:19 +020049 'src/test_labeled_tuple.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020050 'src/test_make_id_name.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020051 'src/test_metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010052 'src/test_numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010053 'src/test_on_change_threshold.cpp',
Szymon Dompke1cdd7e42022-06-08 14:43:13 +020054 'src/test_path_append.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020055 'src/test_persistent_json_storage.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020056 'src/test_report.cpp',
57 'src/test_report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020058 'src/test_sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020059 'src/test_sensor_cache.cpp',
Wludzik, Jozefe2362792020-10-27 17:23:55 +010060 'src/test_transform.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010061 'src/test_trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010062 'src/test_trigger_actions.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010063 'src/test_trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020064 'src/test_unique_call.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020065 'src/utils/generate_unique_mock_id.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020066 'src/utils/string_utils.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020067 ],
68 dependencies: [
69 boost,
70 gmock_dep,
71 gtest_dep,
Patrick Williams4444a132023-12-08 06:35:17 -060072 nlohmann_json_dep,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020073 phosphor_logging,
74 sdbusplus,
75 ],
Lukasz Kazmierczaka74e44f2021-07-23 15:02:20 +020076 include_directories: ['../src', 'src'],
Patrick Williams7d24aa22025-02-01 08:37:37 -050077 cpp_args: '-fno-lto',
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010078 ),
79 timeout: 120,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020080)