blob: 5be01be85f532c77f12ed1db10f638fe601fa06a [file] [log] [blame]
Wludzik, Jozef596a9942021-01-27 12:28:59 +01001gtest_dep = dependency('gtest', main: false, required: false, version: '>=1.10.0')
2gmock_dep = dependency('gmock', required: false, version: '>=1.10.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 Grobelnyc8e3a642020-10-23 12:29:16 +020014 '../src/metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010015 '../src/numeric_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020016 '../src/persistent_json_storage.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020017 '../src/report.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020018 '../src/report_factory.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020019 '../src/report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020020 '../src/sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020021 '../src/sensor_cache.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010022 '../src/trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010023 '../src/trigger_actions.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010024 '../src/trigger_factory.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010025 '../src/trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020026 'src/dbus_environment.cpp',
27 'src/main.cpp',
28 'src/stubs/dbus_sensor_object.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010029 'src/test_conversion.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020030 'src/test_detached_timer.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020031 'src/test_metric.cpp',
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010032 'src/test_numeric_threshold.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020033 'src/test_persistent_json_storage.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020034 'src/test_report.cpp',
35 'src/test_report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020036 'src/test_sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020037 'src/test_sensor_cache.cpp',
Wludzik, Jozefe2362792020-10-27 17:23:55 +010038 'src/test_transform.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010039 'src/test_trigger.cpp',
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +010040 'src/test_trigger_actions.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010041 'src/test_trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020042 'src/test_unique_call.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020043 'src/utils/generate_unique_mock_id.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020044 ],
45 dependencies: [
46 boost,
47 gmock_dep,
48 gtest_dep,
49 nlohmann_json,
50 phosphor_logging,
51 sdbusplus,
52 ],
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020053 include_directories: ['../src', 'src']
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010054 ),
55 timeout: 120,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020056)