blob: 89c6a00fb16f89a68559bc127bb333332f6eac42 [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 [
Krzysztof Grobelny80697712021-03-04 09:49:27 +000014 '../src/details/collection_function.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010015 '../src/discrete_threshold.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020016 '../src/metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010017 '../src/numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010018 '../src/on_change_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020019 '../src/persistent_json_storage.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020020 '../src/report.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020021 '../src/report_factory.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020022 '../src/report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020023 '../src/sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020024 '../src/sensor_cache.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010025 '../src/trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010026 '../src/trigger_actions.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010027 '../src/trigger_factory.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010028 '../src/trigger_manager.cpp',
Krzysztof Grobelnydcc4e192021-03-08 09:09:34 +000029 '../src/types/report_types.cpp',
Cezary Zwolak4416fce2021-03-17 03:21:06 +010030 '../src/utils/conversion_trigger.cpp',
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010031 '../src/utils/generate_id.cpp',
Krzysztof Grobelnye6d48872022-02-08 13:41:30 +010032 '../src/utils/messanger_service.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020033 'src/dbus_environment.cpp',
34 'src/main.cpp',
35 'src/stubs/dbus_sensor_object.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010036 'src/test_conversion.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020037 'src/test_detached_timer.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010038 'src/test_discrete_threshold.cpp',
Krzysztof Grobelnyb8cc78d2021-11-29 15:54:53 +010039 'src/test_generate_id.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020040 'src/test_metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010041 'src/test_numeric_threshold.cpp',
Szymon Dompkef763c9e2021-03-12 09:19:22 +010042 'src/test_on_change_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020043 'src/test_persistent_json_storage.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020044 'src/test_report.cpp',
45 'src/test_report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020046 'src/test_sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020047 'src/test_sensor_cache.cpp',
Wludzik, Jozefe2362792020-10-27 17:23:55 +010048 'src/test_transform.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010049 'src/test_trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010050 'src/test_trigger_actions.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010051 'src/test_trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020052 'src/test_unique_call.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020053 'src/utils/generate_unique_mock_id.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020054 ],
55 dependencies: [
56 boost,
57 gmock_dep,
58 gtest_dep,
59 nlohmann_json,
60 phosphor_logging,
61 sdbusplus,
62 ],
Lukasz Kazmierczaka74e44f2021-07-23 15:02:20 +020063 include_directories: ['../src', 'src'],
64 cpp_args: '-fno-lto'
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010065 ),
66 timeout: 120,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020067)