blob: 509d67bf112a7ddd57c21f0c7b767ffcbec77504 [file] [log] [blame]
Krzysztof Grobelny73da6902020-09-24 13:42:04 +02001gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
2gmock_dep = dependency('gmock', disabler: true, required: false)
3if not gtest_dep.found() or not gmock_dep.found()
4 gtest_proj = import('cmake').subproject('googletest', required: false)
5 if gtest_proj.found()
6 gtest_dep = declare_dependency(
7 dependencies: [
8 dependency('threads'),
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +02009 gtest_proj.dependency('gtest')
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020010 ]
11 )
12 gmock_dep = gtest_proj.dependency('gmock')
13 else
14 assert(
15 not get_option('tests').enabled(),
16 'Googletest is required if tests are enabled'
17 )
18 endif
19endif
20
21test(
22 'telemetry-ut',
23 executable(
24 'telemetry-ut',
25 [
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020026 '../src/metric.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020027 '../src/persistent_json_storage.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020028 '../src/report.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020029 '../src/report_factory.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020030 '../src/report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020031 '../src/sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020032 '../src/sensor_cache.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010033 '../src/trigger.cpp',
34 '../src/trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020035 'src/dbus_environment.cpp',
36 'src/main.cpp',
37 'src/stubs/dbus_sensor_object.cpp',
38 'src/test_detached_timer.cpp',
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020039 'src/test_metric.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020040 'src/test_persistent_json_storage.cpp',
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020041 'src/test_report.cpp',
42 'src/test_report_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020043 'src/test_sensor.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020044 'src/test_sensor_cache.cpp',
Wludzik, Jozefe2362792020-10-27 17:23:55 +010045 'src/test_transform.cpp',
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010046 'src/test_trigger.cpp',
47 'src/test_trigger_manager.cpp',
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020048 'src/test_unique_call.cpp',
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020049 'src/utils/generate_unique_mock_id.cpp',
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020050 ],
51 dependencies: [
52 boost,
53 gmock_dep,
54 gtest_dep,
55 nlohmann_json,
56 phosphor_logging,
57 sdbusplus,
58 ],
Krzysztof Grobelny7f06f612020-09-24 13:42:10 +020059 include_directories: ['../src', 'src']
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +010060 ),
61 timeout: 120,
Krzysztof Grobelny73da6902020-09-24 13:42:04 +020062)