blob: 9666a03e1e752dee81af192929fee4c16775da66 [file] [log] [blame]
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +01001gtest_dep = dependency('gtest', main: false, required: false, version: '>=1.11.0')
2gmock_dep = dependency('gmock', required: false, version: '>=1.11.0')
Krzysztof Grobelny73da6902020-09-24 13:42:04 +02003if not gtest_dep.found() or not gmock_dep.found()
Wludzik, Jozef596a9942021-01-27 12:28:59 +01004 gtest_proj = import('cmake').subproject('googletest')
5 gtest_dep = gtest_proj.dependency('gtest')
6 gmock_dep = gtest_proj.dependency('gmock')
Krzysztof Grobelny73da6902020-09-24 13:42:04 +02007endif
8
9test(
10 'telemetry-ut',
11 executable(
12 'telemetry-ut',
13 [
Szymon Dompkef763c9e2021-03-12 09:19:22 +010014 '../src/discrete_threshold.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020015 '../src/metric.cpp',
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +010016 '../src/metrics/collection_data.cpp',
17 '../src/metrics/collection_function.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010018 '../src/numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010019 '../src/on_change_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020020 '../src/persistent_json_storage.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020021 '../src/report.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020022 '../src/report_factory.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020023 '../src/report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020024 '../src/sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020025 '../src/sensor_cache.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010026 '../src/trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010027 '../src/trigger_actions.cpp',
Krzysztof Grobelny62c08e92022-09-16 10:28:53 +020028 '../src/errors.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010029 '../src/trigger_factory.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010030 '../src/trigger_manager.cpp',
Krzysztof Grobelny493e62e2022-02-14 10:55:50 +010031 '../src/types/readings.cpp',
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000032 '../src/types/report_types.cpp',
Cezary Zwolak4416fce2021-03-17 03:21:06 +010033 '../src/utils/conversion_trigger.cpp',
Szymon Dompke1cdd7e42022-06-08 14:43:13 +020034 '../src/utils/dbus_path_utils.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020035 '../src/utils/make_id_name.cpp',
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +010036 '../src/utils/messanger_service.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020037 'src/dbus_environment.cpp',
38 'src/main.cpp',
39 'src/stubs/dbus_sensor_object.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010040 'src/test_conversion.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020041 'src/test_detached_timer.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010042 'src/test_discrete_threshold.cpp',
Krzysztof Grobelnyf7ea2992022-01-27 11:04:58 +010043 'src/test_ensure.cpp',
Szymon Dompke0253f6d2022-09-15 23:18:19 +020044 'src/test_labeled_tuple.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020045 'src/test_make_id_name.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020046 'src/test_metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010047 'src/test_numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010048 'src/test_on_change_threshold.cpp',
Szymon Dompke1cdd7e42022-06-08 14:43:13 +020049 'src/test_path_append.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020050 'src/test_persistent_json_storage.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020051 'src/test_report.cpp',
52 'src/test_report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020053 'src/test_sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020054 'src/test_sensor_cache.cpp',
Wludzik, Jozefe2362792020-10-27 17:23:55 +010055 'src/test_transform.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010056 'src/test_trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010057 'src/test_trigger_actions.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010058 'src/test_trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020059 'src/test_unique_call.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020060 'src/utils/generate_unique_mock_id.cpp',
Szymon Dompke32305f12022-07-05 15:37:21 +020061 'src/utils/string_utils.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020062 ],
63 dependencies: [
64 boost,
65 gmock_dep,
66 gtest_dep,
67 nlohmann_json,
68 phosphor_logging,
69 sdbusplus,
70 ],
Lukasz Kazmierczaka74e44f2021-07-23 15:02:20 +020071 include_directories: ['../src', 'src'],
72 cpp_args: '-fno-lto'
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010073 ),
74 timeout: 120,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020075)