blob: 822a4f8e44ee746d09c466438fcb72ef6d21e073 [file] [log] [blame]
Patrick Williamsa5171972021-04-16 20:10:01 -05001gtest_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'),
9 gtest_proj.dependency('gtest'),
10 gtest_proj.dependency('gtest_main'),
11 ]
12 )
13 gmock_dep = gtest_proj.dependency('gmock')
14 else
15 assert(
16 not get_option('tests').enabled(),
17 'Googletest is required if tests are enabled'
18 )
19 endif
20endif
21
Patrick Williamsd9f0d642021-04-21 15:43:21 -050022if not get_option('openpower-pel-extension').disabled()
23 subdir('openpower-pels')
24endif
25
Patrick Williamsa5171972021-04-16 20:10:01 -050026tests = [
Patrick Williamsa5171972021-04-16 20:10:01 -050027 'extensions_test',
Patrick Williamsf0af3582024-10-10 16:32:32 -040028 'log_manager_dbus_tests',
Patrick Williamsa5171972021-04-16 20:10:01 -050029 'remote_logging_test_address',
30 'remote_logging_test_config',
31 'remote_logging_test_port',
32 'sdtest',
33 'serialization_test_path',
34 'serialization_test_properties',
Patrick Williamsa5171972021-04-16 20:10:01 -050035]
36foreach t : tests
37 test(
38 'test_' + t.underscorify(),
39 executable(
40 'test-' + t.underscorify(),
41 t + '.cpp',
William A. Kennington IIIb6b25572021-05-19 17:09:41 -070042 'common.cpp',
Patrick Williamsa5171972021-04-16 20:10:01 -050043 log_manager_sources,
44 '../phosphor-rsyslog-config/server-conf.cpp',
Patrick Williamsa5171972021-04-16 20:10:01 -050045 dependencies: [
Patrick Williamsa5171972021-04-16 20:10:01 -050046 gmock_dep,
47 gtest_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050048 log_manager_deps,
Patrick Williamse001cd72024-10-07 10:59:30 -040049 pdi_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -070050 phosphor_logging_dep,
Patrick Williamsa5171972021-04-16 20:10:01 -050051 ],
52 include_directories: include_directories('..', '../gen'),
53 )
54 )
55endforeach
Lei YU972dd4f2023-12-12 04:04:19 +000056
57tests_non_parallel = [
58 'elog_quiesce_test',
59 'elog_update_ts_test',
60 'elog_errorwrap_test',
61]
62
63foreach t : tests_non_parallel
64 test(
65 'test_' + t.underscorify(),
66 executable(
67 'test-' + t.underscorify(),
68 t + '.cpp',
69 'common.cpp',
70 log_manager_sources,
71 '../phosphor-rsyslog-config/server-conf.cpp',
72 dependencies: [
73 gmock_dep,
74 gtest_dep,
75 log_manager_deps,
76 phosphor_logging_dep,
77 ],
78 include_directories: include_directories('..', '../gen'),
79 ),
80 is_parallel: false,
81 )
82endforeach