xref: /openbmc/phosphor-logging/test/meson.build (revision 66491c61)
1gtest_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
22if not get_option('openpower-pel-extension').disabled()
23    subdir('openpower-pels')
24endif
25
26tests = [
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',
44            'common.cpp',
45            log_manager_sources,
46            '../phosphor-rsyslog-config/server-conf.cpp',
47            dependencies: [
48                gmock_dep,
49                gtest_dep,
50                log_manager_deps,
51                phosphor_logging_dep,
52            ],
53            include_directories: include_directories('..', '../gen'),
54        )
55    )
56endforeach
57