blob: 6bd81aceba7f918ebed75477a71662eaf4b896d5 [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 = [
27 'elog_quiesce_test',
28 'elog_update_ts_test',
29 'extensions_test',
30 'remote_logging_test_address',
31 'remote_logging_test_config',
32 'remote_logging_test_port',
33 'sdtest',
34 'serialization_test_path',
35 'serialization_test_properties',
36 'elog_errorwrap_test',
37]
38foreach t : tests
39 test(
40 'test_' + t.underscorify(),
41 executable(
42 'test-' + t.underscorify(),
43 t + '.cpp',
William A. Kennington IIIb6b25572021-05-19 17:09:41 -070044 'common.cpp',
Patrick Williamsa5171972021-04-16 20:10:01 -050045 log_manager_sources,
46 '../phosphor-rsyslog-config/server-conf.cpp',
47 link_with: libphosphor_logging,
Patrick Williamsa5171972021-04-16 20:10:01 -050048 dependencies: [
Patrick Williamsa5171972021-04-16 20:10:01 -050049 gmock_dep,
50 gtest_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050051 log_manager_deps,
Patrick Williamsa5171972021-04-16 20:10:01 -050052 ],
53 include_directories: include_directories('..', '../gen'),
54 )
55 )
56endforeach