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