blob: f182f1a0921f8ad2c988fee781d674b757fc4b9d [file] [log] [blame]
Andrew Jeffery22778042017-01-13 22:37:26 +10301ACLOCAL_AMFLAGS = -I m4
Suraj Jitindar Singhddf0edb2017-03-28 10:50:40 +11002sbin_PROGRAMS = mboxd mboxctl
Andrew Jeffery22778042017-01-13 22:37:26 +10303
Deepak Kodihalli393821d2017-04-28 04:44:38 -05004mboxd_SOURCES = \
5 mboxd.c \
6 common.c \
7 mboxd_dbus.c \
Deepak Kodihalli393821d2017-04-28 04:44:38 -05008 mboxd_lpc.c \
9 mboxd_msg.c \
10 mboxd_windows.c \
11 mtd.c
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110012mboxd_LDFLAGS = $(LIBSYSTEMD_LIBS)
13mboxd_CFLAGS = $(LIBSYSTEMD_CFLAGS)
Suraj Jitindar Singhddf0edb2017-03-28 10:50:40 +110014
Deepak Kodihalli393821d2017-04-28 04:44:38 -050015if VIRTUAL_PNOR_ENABLED
Ratan Guptab0327582017-06-28 18:26:14 +053016mboxd_SOURCES += pnor_partition_table.cpp \
17 mboxd_pnor_partition_table.cpp \
Ratan Guptac0ef9872017-06-06 14:31:37 +053018 mboxd_flash_virtual.cpp \
Deepak Kodihalli017e45c2017-07-12 01:06:30 -050019 pnor_partition.cpp \
20 mboxd_lpc_virtual.cpp
Ratan Guptab0327582017-06-28 18:26:14 +053021
22mboxd_LDFLAGS += -lstdc++fs \
23 $(SDBUSPLUS_LIBS) \
24 $(PHOSPHOR_LOGGING_LIBS) \
25 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Deepak Kodihalli6c2fa902017-05-01 06:36:02 -050026else
Deepak Kodihalli017e45c2017-07-12 01:06:30 -050027mboxd_SOURCES += mboxd_flash_physical.c \
28 mboxd_lpc_physical.c
Deepak Kodihalli393821d2017-04-28 04:44:38 -050029endif
30
Suraj Jitindar Singhddf0edb2017-03-28 10:50:40 +110031mboxctl_SOURCES = mboxctl.c
32mboxctl_LDFLAGS = $(LIBSYSTEMD_LIBS)
33mboxctl_CFLAGS = $(LIBSYSTEMD_CFLAGS)
Andrew Jeffery65e21622017-04-12 20:25:31 +093034
35@CODE_COVERAGE_RULES@
36
37AM_LIBS = $(CODE_COVERAGE_LIBS)
38AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
39AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
Deepak Kodihalli393821d2017-04-28 04:44:38 -050040AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
Andrew Jeffery62af1ba2017-04-24 13:36:46 +093041
42test_sanity_SOURCES = test/sanity.c
43
Ratan Guptac0ef9872017-06-06 14:31:37 +053044test_copy_flash_SOURCES = \
45 test/copy_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053046 mboxd_flash_physical.c \
47 common.c mtd.c \
48 test/tmpf.c
Andrew Jeffery0484c752017-04-12 14:20:18 +093049
Ratan Guptac0ef9872017-06-06 14:31:37 +053050test_erase_flash_SOURCES = \
51 test/erase_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053052 mboxd_flash_physical.c \
53 common.c \
54 test/tmpf.c
Andrew Jefferyf37ae022017-04-12 14:21:37 +093055
Ratan Guptac0ef9872017-06-06 14:31:37 +053056test_write_flash_SOURCES = \
57 test/write_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053058 mboxd_flash_physical.c \
59 common.c \
60 test/tmpf.c
Andrew Jeffery26b35672017-04-12 14:22:25 +093061
Ratan Guptac0ef9872017-06-06 14:31:37 +053062TEST_MBOX_SRCS = \
63 mboxd_msg.c \
64 mboxd_windows.c \
65 mboxd_lpc.c \
Deepak Kodihalli017e45c2017-07-12 01:06:30 -050066 mboxd_lpc_physical.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053067 common.c \
68 mboxd_flash_physical.c
69
Andrew Jefferyc1e7db32017-04-12 14:36:10 +093070TEST_MOCK_SRCS = test/tmpf.c test/mbox.c test/system.c
71
72test_get_mbox_info_v2_SOURCES = test/get_mbox_info_v2.c \
73 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
74
Andrew Jeffery16be9f62017-04-12 14:36:49 +093075test_reset_state_SOURCES = test/reset_state.c \
76 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
77
Andrew Jeffery182d4fe2017-04-12 14:39:24 +093078test_get_flash_info_v2_SOURCES = test/get_flash_info_v2.c \
79 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
80
Andrew Jeffery3e3cf282017-04-12 14:40:31 +093081test_create_read_window_v2_SOURCES = test/create_read_window_v2.c \
82 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
83
Andrew Jefferyccaec502017-04-12 14:42:36 +093084test_create_write_window_v2_SOURCES = test/create_write_window_v2.c \
85 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
86
Andrew Jefferyd8f24ef2017-04-12 14:43:57 +093087test_close_window_v2_SOURCES = test/close_window_v2.c \
88 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
89
Andrew Jeffery4397af92017-04-12 14:46:22 +093090test_mark_write_dirty_v2_SOURCES = test/mark_write_dirty_v2.c \
91 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
92
Andrew Jeffery1a036472017-04-12 14:47:03 +093093test_write_flush_v2_SOURCES = test/write_flush_v2.c \
94 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
95
Andrew Jefferyc5da1482017-04-12 14:49:07 +093096test_mark_write_erased_v2_SOURCES = test/mark_write_erased_v2.c \
97 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
98
Andrew Jeffery1770ce82017-04-12 14:50:32 +093099test_bmc_event_ack_v2_SOURCES = test/bmc_event_ack_v2.c \
100 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
101
Andrew Jeffery5f374bc2017-04-12 22:06:06 +0930102test_create_oversize_window_SOURCES = test/create_oversize_window.c \
103 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
104
Andrew Jefferyefc6ada2017-04-12 22:13:59 +0930105test_create_zero_size_window_SOURCES = test/create_zero_size_window.c \
106 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
107
Andrew Jefferyd4a5fc82017-04-12 22:50:04 +0930108test_implicit_flush_SOURCES = test/implicit_flush.c \
109 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
110
Andrew Jeffery4510a192017-04-13 13:40:03 +0930111test_request_high_version_SOURCES = test/request_high_version.c \
112 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
113
Andrew Jefferybcacb4e2017-04-13 13:45:13 +0930114test_request_low_version_SOURCES = test/request_low_version.c \
115 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
116
Andrew Jefferyea469b02017-04-13 13:56:43 +0930117test_mark_read_dirty_SOURCES = test/mark_read_dirty.c \
118 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
119
Andrew Jefferyacdb4b32017-04-13 14:02:23 +0930120test_read_window_write_flush_SOURCES = test/read_window_write_flush.c \
121 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
122
Andrew Jefferyaed3a5f2017-04-13 14:44:26 +0930123test_read_window_mark_write_erased_SOURCES = test/read_window_mark_write_erased.c \
124 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
125
Andrew Jeffery4edb58c2017-04-13 15:10:15 +0930126test_write_window_dirty_erase_SOURCES = test/write_window_dirty_erase.c \
127 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
128
Andrew Jeffery9d4b8882017-04-13 15:39:45 +0930129test_invalid_command_SOURCES = test/invalid_command.c \
130 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
131
Andrew Jefferyb34cc542017-04-13 16:09:19 +0930132test_read_window_cycle_SOURCES = test/read_window_cycle.c \
133 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
134
Andrew Jefferycbbc13c2017-04-24 17:22:21 +0930135test_sequence_numbers_SOURCES = test/sequence_numbers.c \
136 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
137
Suraj Jitindar Singh29b3e8a2017-05-01 16:00:39 +1000138test_get_mbox_info_v2_timeout_SOURCES = test/get_mbox_info_v2_timeout.c \
139 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
140
Ratan Gupta3214b512017-05-11 08:58:19 +0530141TEST_MBOX_VPNOR_SRCS = common.c pnor_partition_table.cpp
142
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500143test_create_pnor_partition_table_SOURCES = \
Ratan Gupta3214b512017-05-11 08:58:19 +0530144 $(TEST_MBOX_VPNOR_SRCS) \
145 test/create_pnor_partition_table.cpp
Ratan Gupta99551ef2017-05-25 09:50:15 +0530146test_create_pnor_partition_table_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
Deepak Kodihalli8a899692017-07-11 23:17:19 -0500147test_create_pnor_partition_table_LDADD = -lstdc++fs \
148 $(SDBUSPLUS_LIBS) \
149 $(PHOSPHOR_LOGGING_LIBS) \
150 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500151
Ratan Gupta3214b512017-05-11 08:58:19 +0530152test_create_read_window_vpnor_SOURCES = \
153 $(TEST_MBOX_VPNOR_SRCS) $(TEST_MOCK_SRCS) \
154 mboxd_msg.c \
155 mboxd_windows.c \
156 mboxd_lpc.c \
Deepak Kodihalli017e45c2017-07-12 01:06:30 -0500157 mboxd_lpc_virtual.cpp \
Ratan Gupta3214b512017-05-11 08:58:19 +0530158 mboxd_pnor_partition_table.cpp \
159 mboxd_flash_virtual.cpp \
Ratan Guptac0ef9872017-06-06 14:31:37 +0530160 pnor_partition.cpp \
Ratan Gupta3214b512017-05-11 08:58:19 +0530161 test/create_read_window_vpnor.cpp
162test_create_read_window_vpnor_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
Ratan Guptac0ef9872017-06-06 14:31:37 +0530163test_create_read_window_vpnor_LDADD = -lstdc++fs \
164 $(SDBUSPLUS_LIBS) \
165 $(PHOSPHOR_LOGGING_LIBS) \
166 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Ratan Gupta3214b512017-05-11 08:58:19 +0530167
Ratan Gupta2407f152017-05-31 16:01:01 +0530168test_write_flash_vpnor_SOURCES = \
169 $(TEST_MBOX_VPNOR_SRCS) \
Ratan Gupta2407f152017-05-31 16:01:01 +0530170 mboxd_pnor_partition_table.cpp \
171 mboxd_flash_virtual.cpp \
172 mtd.c \
173 pnor_partition.cpp \
174 test/write_flash_vpnor.cpp
175test_write_flash_vpnor_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
176test_write_flash_vpnor_LDADD = -lstdc++fs \
177 $(SDBUSPLUS_LIBS) \
178 $(PHOSPHOR_LOGGING_LIBS) \
179 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
180
Andrew Jeffery0484c752017-04-12 14:20:18 +0930181check_PROGRAMS = test/sanity \
Andrew Jefferyc1e7db32017-04-12 14:36:10 +0930182 test/copy_flash \
183 test/erase_flash \
184 test/write_flash \
Andrew Jeffery16be9f62017-04-12 14:36:49 +0930185 test/get_mbox_info_v2 \
Andrew Jeffery182d4fe2017-04-12 14:39:24 +0930186 test/reset_state \
Andrew Jeffery3e3cf282017-04-12 14:40:31 +0930187 test/get_flash_info_v2 \
Andrew Jefferyccaec502017-04-12 14:42:36 +0930188 test/create_read_window_v2 \
Andrew Jefferyd8f24ef2017-04-12 14:43:57 +0930189 test/create_write_window_v2 \
Andrew Jeffery4397af92017-04-12 14:46:22 +0930190 test/close_window_v2 \
Andrew Jeffery1a036472017-04-12 14:47:03 +0930191 test/mark_write_dirty_v2 \
Andrew Jefferyc5da1482017-04-12 14:49:07 +0930192 test/write_flush_v2 \
Andrew Jeffery1770ce82017-04-12 14:50:32 +0930193 test/mark_write_erased_v2 \
Andrew Jeffery5f374bc2017-04-12 22:06:06 +0930194 test/bmc_event_ack_v2 \
Andrew Jefferyefc6ada2017-04-12 22:13:59 +0930195 test/create_oversize_window \
Andrew Jefferyd4a5fc82017-04-12 22:50:04 +0930196 test/create_zero_size_window \
Andrew Jeffery4510a192017-04-13 13:40:03 +0930197 test/implicit_flush \
Andrew Jefferybcacb4e2017-04-13 13:45:13 +0930198 test/request_high_version \
Andrew Jefferyea469b02017-04-13 13:56:43 +0930199 test/request_low_version \
Andrew Jefferyacdb4b32017-04-13 14:02:23 +0930200 test/mark_read_dirty \
Andrew Jefferyaed3a5f2017-04-13 14:44:26 +0930201 test/read_window_write_flush \
Andrew Jeffery4edb58c2017-04-13 15:10:15 +0930202 test/read_window_mark_write_erased \
Andrew Jeffery9d4b8882017-04-13 15:39:45 +0930203 test/write_window_dirty_erase \
Andrew Jefferyb34cc542017-04-13 16:09:19 +0930204 test/invalid_command \
Andrew Jefferycbbc13c2017-04-24 17:22:21 +0930205 test/read_window_cycle \
Suraj Jitindar Singh29b3e8a2017-05-01 16:00:39 +1000206 test/sequence_numbers \
207 test/get_mbox_info_v2_timeout
Andrew Jeffery62af1ba2017-04-24 13:36:46 +0930208
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500209if VIRTUAL_PNOR_ENABLED
Ratan Guptac0ef9872017-06-06 14:31:37 +0530210check_PROGRAMS += \
211 test/create_pnor_partition_table \
Ratan Gupta2407f152017-05-31 16:01:01 +0530212 test/create_read_window_vpnor \
213 test/write_flash_vpnor
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500214endif
215
Andrew Jeffery62af1ba2017-04-24 13:36:46 +0930216TESTS = $(check_PROGRAMS)