1openpower_pels = {
2    'additional_data': {},
3    'ascii_string': {},
4    'bcd_time': {},
5    'data_interface': {},
6    'device_callouts': {},
7    'event_logger': {},
8    'extended_user_data': {},
9    'extended_user_header': {},
10    'failing_mtms': {},
11    'fru_identity': {},
12    'generic_section': {},
13    'host_notifier': {
14        'sources': [
15            '../../extensions/openpower-pels/host_notifier.cpp',
16            '../../extensions/openpower-pels/repository.cpp',
17        ],
18    },
19    'json_utils': {},
20    'log_id': {},
21    'mru': {},
22    'mtms': {},
23    'pce_identity': {},
24    'pel_manager': {
25        'sources': [
26            '../../elog_entry.cpp',
27            '../../elog_meta.cpp',
28            '../../elog_serialize.cpp',
29            '../../extensions.cpp',
30            '../../log_manager.cpp',
31            elog_lookup_gen,
32            elog_process_gen,
33            generated_sources,
34            log_manager_ext_sources,
35        ],
36        'deps': [ cereal_dep ],
37    },
38    'pel_rules': {},
39    'pel': {},
40    'pel_values': {},
41    'private_header': {},
42    'real_pel': {},
43    'registry': {},
44    'repository': {
45        'sources': [
46            '../../extensions/openpower-pels/repository.cpp',
47        ],
48    },
49    'section_header': {},
50    'service_indicators': {},
51    'severity': {},
52    'src': {},
53    'src_callout': {},
54    'src_callouts': {},
55    'stream': {},
56    'user_data': {},
57    'user_header': {},
58    'temporary_file': {
59         'sources': [
60            '../../extensions/openpower-pels/temporary_file.cpp',
61        ],
62    },
63}
64
65# Build a common shared library for all openpower tests of all the widely
66# used sources under test.
67openpower_test_lib = static_library(
68    'openpower_test_lib',
69    'pel_utils.cpp',
70    'paths.cpp',
71    libpel_sources,
72    peltool_sources,
73    '../common.cpp',
74    '../../util.cpp',
75    include_directories: include_directories(
76        '../../',
77        '../../gen',
78    ),
79    dependencies: [
80        libpel_deps,
81        peltool_deps,
82        gtest_dep,
83    ],
84)
85
86foreach t : openpower_pels.keys()
87    test(
88        'test_openpower_pels_' + t.underscorify(),
89        executable(
90            'test-openpower-pels-' + t.underscorify(),
91            t + '_test.cpp',
92            openpower_pels.get(t).get('sources', []),
93            link_with: [
94                openpower_test_lib,
95            ],
96            link_args: [ '-lpython' + python_ver ],
97            dependencies: [
98                gtest_dep,
99                gmock_dep,
100                phosphor_logging_dep,
101                libpel_deps,
102                peltool_deps,
103                openpower_pels.get(t).get('deps', []),
104            ],
105            include_directories: include_directories(
106                '../../',
107                '../../gen',
108            ),
109        )
110    )
111endforeach
112