blob: af44432639f85dff8ea74371e9659fb08b26bcd0 [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 \
19 pnor_partition.cpp
Ratan Guptab0327582017-06-28 18:26:14 +053020
21mboxd_LDFLAGS += -lstdc++fs \
22 $(SDBUSPLUS_LIBS) \
23 $(PHOSPHOR_LOGGING_LIBS) \
24 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Deepak Kodihalli6c2fa902017-05-01 06:36:02 -050025else
26mboxd_SOURCES += mboxd_flash_physical.c
Deepak Kodihalli393821d2017-04-28 04:44:38 -050027endif
28
Suraj Jitindar Singhddf0edb2017-03-28 10:50:40 +110029mboxctl_SOURCES = mboxctl.c
30mboxctl_LDFLAGS = $(LIBSYSTEMD_LIBS)
31mboxctl_CFLAGS = $(LIBSYSTEMD_CFLAGS)
Andrew Jeffery65e21622017-04-12 20:25:31 +093032
33@CODE_COVERAGE_RULES@
34
35AM_LIBS = $(CODE_COVERAGE_LIBS)
36AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
37AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
Deepak Kodihalli393821d2017-04-28 04:44:38 -050038AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
Andrew Jeffery62af1ba2017-04-24 13:36:46 +093039
40test_sanity_SOURCES = test/sanity.c
41
Ratan Guptac0ef9872017-06-06 14:31:37 +053042test_copy_flash_SOURCES = \
43 test/copy_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053044 mboxd_flash_physical.c \
45 common.c mtd.c \
46 test/tmpf.c
Andrew Jeffery0484c752017-04-12 14:20:18 +093047
Ratan Guptac0ef9872017-06-06 14:31:37 +053048test_erase_flash_SOURCES = \
49 test/erase_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053050 mboxd_flash_physical.c \
51 common.c \
52 test/tmpf.c
Andrew Jefferyf37ae022017-04-12 14:21:37 +093053
Ratan Guptac0ef9872017-06-06 14:31:37 +053054test_write_flash_SOURCES = \
55 test/write_flash.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053056 mboxd_flash_physical.c \
57 common.c \
58 test/tmpf.c
Andrew Jeffery26b35672017-04-12 14:22:25 +093059
Ratan Guptac0ef9872017-06-06 14:31:37 +053060TEST_MBOX_SRCS = \
61 mboxd_msg.c \
62 mboxd_windows.c \
63 mboxd_lpc.c \
Ratan Guptac0ef9872017-06-06 14:31:37 +053064 common.c \
65 mboxd_flash_physical.c
66
Andrew Jefferyc1e7db32017-04-12 14:36:10 +093067TEST_MOCK_SRCS = test/tmpf.c test/mbox.c test/system.c
68
69test_get_mbox_info_v2_SOURCES = test/get_mbox_info_v2.c \
70 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
71
Andrew Jeffery16be9f62017-04-12 14:36:49 +093072test_reset_state_SOURCES = test/reset_state.c \
73 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
74
Andrew Jeffery182d4fe2017-04-12 14:39:24 +093075test_get_flash_info_v2_SOURCES = test/get_flash_info_v2.c \
76 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
77
Andrew Jeffery3e3cf282017-04-12 14:40:31 +093078test_create_read_window_v2_SOURCES = test/create_read_window_v2.c \
79 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
80
Andrew Jefferyccaec502017-04-12 14:42:36 +093081test_create_write_window_v2_SOURCES = test/create_write_window_v2.c \
82 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
83
Andrew Jefferyd8f24ef2017-04-12 14:43:57 +093084test_close_window_v2_SOURCES = test/close_window_v2.c \
85 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
86
Andrew Jeffery4397af92017-04-12 14:46:22 +093087test_mark_write_dirty_v2_SOURCES = test/mark_write_dirty_v2.c \
88 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
89
Andrew Jeffery1a036472017-04-12 14:47:03 +093090test_write_flush_v2_SOURCES = test/write_flush_v2.c \
91 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
92
Andrew Jefferyc5da1482017-04-12 14:49:07 +093093test_mark_write_erased_v2_SOURCES = test/mark_write_erased_v2.c \
94 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
95
Andrew Jeffery1770ce82017-04-12 14:50:32 +093096test_bmc_event_ack_v2_SOURCES = test/bmc_event_ack_v2.c \
97 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
98
Andrew Jeffery5f374bc2017-04-12 22:06:06 +093099test_create_oversize_window_SOURCES = test/create_oversize_window.c \
100 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
101
Andrew Jefferyefc6ada2017-04-12 22:13:59 +0930102test_create_zero_size_window_SOURCES = test/create_zero_size_window.c \
103 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
104
Andrew Jefferyd4a5fc82017-04-12 22:50:04 +0930105test_implicit_flush_SOURCES = test/implicit_flush.c \
106 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
107
Andrew Jeffery4510a192017-04-13 13:40:03 +0930108test_request_high_version_SOURCES = test/request_high_version.c \
109 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
110
Andrew Jefferybcacb4e2017-04-13 13:45:13 +0930111test_request_low_version_SOURCES = test/request_low_version.c \
112 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
113
Andrew Jefferyea469b02017-04-13 13:56:43 +0930114test_mark_read_dirty_SOURCES = test/mark_read_dirty.c \
115 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
116
Andrew Jefferyacdb4b32017-04-13 14:02:23 +0930117test_read_window_write_flush_SOURCES = test/read_window_write_flush.c \
118 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
119
Andrew Jefferyaed3a5f2017-04-13 14:44:26 +0930120test_read_window_mark_write_erased_SOURCES = test/read_window_mark_write_erased.c \
121 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
122
Andrew Jeffery4edb58c2017-04-13 15:10:15 +0930123test_write_window_dirty_erase_SOURCES = test/write_window_dirty_erase.c \
124 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
125
Andrew Jeffery9d4b8882017-04-13 15:39:45 +0930126test_invalid_command_SOURCES = test/invalid_command.c \
127 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
128
Andrew Jefferyb34cc542017-04-13 16:09:19 +0930129test_read_window_cycle_SOURCES = test/read_window_cycle.c \
130 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
131
Andrew Jefferycbbc13c2017-04-24 17:22:21 +0930132test_sequence_numbers_SOURCES = test/sequence_numbers.c \
133 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
134
Suraj Jitindar Singh29b3e8a2017-05-01 16:00:39 +1000135test_get_mbox_info_v2_timeout_SOURCES = test/get_mbox_info_v2_timeout.c \
136 $(TEST_MBOX_SRCS) $(TEST_MOCK_SRCS)
137
Ratan Gupta3214b512017-05-11 08:58:19 +0530138TEST_MBOX_VPNOR_SRCS = common.c pnor_partition_table.cpp
139
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500140test_create_pnor_partition_table_SOURCES = \
Ratan Gupta3214b512017-05-11 08:58:19 +0530141 $(TEST_MBOX_VPNOR_SRCS) \
142 test/create_pnor_partition_table.cpp
Ratan Gupta99551ef2017-05-25 09:50:15 +0530143test_create_pnor_partition_table_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
Deepak Kodihalli8a899692017-07-11 23:17:19 -0500144test_create_pnor_partition_table_LDADD = -lstdc++fs \
145 $(SDBUSPLUS_LIBS) \
146 $(PHOSPHOR_LOGGING_LIBS) \
147 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500148
Ratan Gupta3214b512017-05-11 08:58:19 +0530149test_create_read_window_vpnor_SOURCES = \
150 $(TEST_MBOX_VPNOR_SRCS) $(TEST_MOCK_SRCS) \
151 mboxd_msg.c \
152 mboxd_windows.c \
153 mboxd_lpc.c \
Ratan Gupta3214b512017-05-11 08:58:19 +0530154 mboxd_pnor_partition_table.cpp \
155 mboxd_flash_virtual.cpp \
Ratan Guptac0ef9872017-06-06 14:31:37 +0530156 pnor_partition.cpp \
Ratan Gupta3214b512017-05-11 08:58:19 +0530157 test/create_read_window_vpnor.cpp
158test_create_read_window_vpnor_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
Ratan Guptac0ef9872017-06-06 14:31:37 +0530159test_create_read_window_vpnor_LDADD = -lstdc++fs \
160 $(SDBUSPLUS_LIBS) \
161 $(PHOSPHOR_LOGGING_LIBS) \
162 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
Ratan Gupta3214b512017-05-11 08:58:19 +0530163
Ratan Gupta2407f152017-05-31 16:01:01 +0530164test_write_flash_vpnor_SOURCES = \
165 $(TEST_MBOX_VPNOR_SRCS) \
Ratan Gupta2407f152017-05-31 16:01:01 +0530166 mboxd_pnor_partition_table.cpp \
167 mboxd_flash_virtual.cpp \
168 mtd.c \
169 pnor_partition.cpp \
170 test/write_flash_vpnor.cpp
171test_write_flash_vpnor_LDFLAGS = $(OESDK_TESTCASE_FLAGS)
172test_write_flash_vpnor_LDADD = -lstdc++fs \
173 $(SDBUSPLUS_LIBS) \
174 $(PHOSPHOR_LOGGING_LIBS) \
175 $(PHOSPHOR_DBUS_INTERFACES_LIBS)
176
Andrew Jeffery0484c752017-04-12 14:20:18 +0930177check_PROGRAMS = test/sanity \
Andrew Jefferyc1e7db32017-04-12 14:36:10 +0930178 test/copy_flash \
179 test/erase_flash \
180 test/write_flash \
Andrew Jeffery16be9f62017-04-12 14:36:49 +0930181 test/get_mbox_info_v2 \
Andrew Jeffery182d4fe2017-04-12 14:39:24 +0930182 test/reset_state \
Andrew Jeffery3e3cf282017-04-12 14:40:31 +0930183 test/get_flash_info_v2 \
Andrew Jefferyccaec502017-04-12 14:42:36 +0930184 test/create_read_window_v2 \
Andrew Jefferyd8f24ef2017-04-12 14:43:57 +0930185 test/create_write_window_v2 \
Andrew Jeffery4397af92017-04-12 14:46:22 +0930186 test/close_window_v2 \
Andrew Jeffery1a036472017-04-12 14:47:03 +0930187 test/mark_write_dirty_v2 \
Andrew Jefferyc5da1482017-04-12 14:49:07 +0930188 test/write_flush_v2 \
Andrew Jeffery1770ce82017-04-12 14:50:32 +0930189 test/mark_write_erased_v2 \
Andrew Jeffery5f374bc2017-04-12 22:06:06 +0930190 test/bmc_event_ack_v2 \
Andrew Jefferyefc6ada2017-04-12 22:13:59 +0930191 test/create_oversize_window \
Andrew Jefferyd4a5fc82017-04-12 22:50:04 +0930192 test/create_zero_size_window \
Andrew Jeffery4510a192017-04-13 13:40:03 +0930193 test/implicit_flush \
Andrew Jefferybcacb4e2017-04-13 13:45:13 +0930194 test/request_high_version \
Andrew Jefferyea469b02017-04-13 13:56:43 +0930195 test/request_low_version \
Andrew Jefferyacdb4b32017-04-13 14:02:23 +0930196 test/mark_read_dirty \
Andrew Jefferyaed3a5f2017-04-13 14:44:26 +0930197 test/read_window_write_flush \
Andrew Jeffery4edb58c2017-04-13 15:10:15 +0930198 test/read_window_mark_write_erased \
Andrew Jeffery9d4b8882017-04-13 15:39:45 +0930199 test/write_window_dirty_erase \
Andrew Jefferyb34cc542017-04-13 16:09:19 +0930200 test/invalid_command \
Andrew Jefferycbbc13c2017-04-24 17:22:21 +0930201 test/read_window_cycle \
Suraj Jitindar Singh29b3e8a2017-05-01 16:00:39 +1000202 test/sequence_numbers \
203 test/get_mbox_info_v2_timeout
Andrew Jeffery62af1ba2017-04-24 13:36:46 +0930204
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500205if VIRTUAL_PNOR_ENABLED
Ratan Guptac0ef9872017-06-06 14:31:37 +0530206check_PROGRAMS += \
207 test/create_pnor_partition_table \
Ratan Gupta2407f152017-05-31 16:01:01 +0530208 test/create_read_window_vpnor \
209 test/write_flash_vpnor
Deepak Kodihalli393821d2017-04-28 04:44:38 -0500210endif
211
Andrew Jeffery62af1ba2017-04-24 13:36:46 +0930212TESTS = $(check_PROGRAMS)