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    'pel_paths.cpp',
71    libpel_sources,
72    peltool_sources,
73    '../common.cpp',
74    include_directories: include_directories(
75        '../../',
76        '../../gen',
77    ),
78    dependencies: [
79        libpel_deps,
80        peltool_deps,
81        gtest_dep,
82    ],
83)
84
85foreach t : openpower_pels.keys()
86    test(
87        'test_openpower_pels_' + t.underscorify(),
88        executable(
89            'test-openpower-pels-' + t.underscorify(),
90            t + '_test.cpp',
91            openpower_pels.get(t).get('sources', []),
92            link_with: [
93                openpower_test_lib,
94            ],
95            link_args: [ '-lpython' + python_ver ],
96            dependencies: [
97                gtest_dep,
98                gmock_dep,
99                phosphor_logging_dep,
100                libpel_deps,
101                peltool_deps,
102                openpower_pels.get(t).get('deps', []),
103            ],
104            include_directories: include_directories(
105                '../../',
106                '../../gen',
107            ),
108        )
109    )
110endforeach
111