soc/amd/sabrina,vc/amd/fsp/sabrina: Add UART support for Sabrina
[coreboot.git] / tests / lib / Makefile.inc
blob9a624767ca4590df1b187942b2686beba509e8a8
1 # SPDX-License-Identifier: GPL-2.0-only
3 tests-y += lib-test
4 tests-y += string-test
5 tests-y += b64_decode-test
6 tests-y += hexstrtobin-test
7 tests-y += imd-test
8 tests-y += timestamp-test
9 tests-y += edid-test
10 tests-y += cbmem_console-romstage-test
11 tests-y += cbmem_console-ramstage-test
12 tests-y += list-test
13 tests-y += fmap-test
14 tests-y += imd_cbmem-romstage-test
15 tests-y += imd_cbmem-ramstage-test
16 tests-y += region_file-test
17 tests-y += stack-test
18 tests-y += memset-test
19 tests-y += memcmp-test
20 tests-y += memchr-test
21 tests-y += memcpy-test
22 tests-y += malloc-test
23 tests-y += memmove-test
24 tests-y += crc_byte-test
25 tests-y += compute_ip_checksum-test
26 tests-y += memrange-test
27 tests-y += uuid-test
28 tests-y += bootmem-test
29 tests-y += dimm_info_util-test
30 tests-y += coreboot_table-test
31 tests-y += rtc-test
32 tests-y += spd_cache-ddr3-test
33 tests-y += spd_cache-ddr4-test
34 tests-y += cbmem_stage_cache-test
35 tests-y += libgcc-test
36 tests-y += cbfs-verification-no-sha512-test
37 tests-y += cbfs-verification-has-sha512-test
38 tests-y += cbfs-no-verification-no-sha512-test
39 tests-y += cbfs-no-verification-has-sha512-test
40 tests-y += cbfs-lookup-no-mcache-test
41 tests-y += cbfs-lookup-has-mcache-test
42 tests-y += lzma-test
44 lib-test-srcs += tests/lib/lib-test.c
46 string-test-srcs += tests/lib/string-test.c
47 string-test-srcs += src/lib/string.c
49 b64_decode-test-srcs += tests/lib/b64_decode-test.c
50 b64_decode-test-srcs += tests/stubs/console.c
51 b64_decode-test-srcs += src/lib/b64_decode.c
53 hexstrtobin-test-srcs += tests/lib/hexstrtobin-test.c
54 hexstrtobin-test-srcs += src/lib/hexstrtobin.c
56 imd-test-srcs += tests/lib/imd-test.c
57 imd-test-srcs += tests/stubs/console.c
58 imd-test-srcs += src/lib/imd.c
60 timestamp-test-srcs += tests/lib/timestamp-test.c
61 timestamp-test-srcs += tests/stubs/timestamp.c
62 timestamp-test-srcs += tests/stubs/console.c
63 timestamp-test-stage := romstage
65 edid-test-srcs += tests/lib/edid-test.c
66 edid-test-srcs += src/lib/edid.c
67 edid-test-srcs += tests/stubs/console.c
69 cbmem_console-romstage-test-stage := romstage
70 cbmem_console-romstage-test-srcs += tests/lib/cbmem_console-test.c
71 cbmem_console-romstage-test-srcs += tests/stubs/console.c
73 cbmem_console-ramstage-test-stage := ramstage
74 cbmem_console-ramstage-test-srcs += tests/lib/cbmem_console-test.c
75 cbmem_console-ramstage-test-srcs += tests/stubs/console.c
77 list-test-srcs += tests/lib/list-test.c
78 list-test-srcs += src/lib/list.c
80 fmap-test-srcs += tests/lib/fmap-test.c
81 fmap-test-srcs += src/lib/fmap.c
82 fmap-test-srcs += tests/stubs/console.c
83 fmap-test-srcs += src/lib/boot_device.c
84 fmap-test-srcs += src/commonlib/region.c
85 fmap-test-cflags += -I tests/include/tests/lib/fmap
87 imd_cbmem-ramstage-test-stage := ramstage
88 imd_cbmem-ramstage-test-srcs += tests/lib/imd_cbmem-test.c
89 imd_cbmem-ramstage-test-srcs += tests/stubs/console.c
90 imd_cbmem-ramstage-test-srcs += src/lib/imd.c
91 imd_cbmem-ramstage-test-mocks += cbmem_top_chipset
93 imd_cbmem-romstage-test-stage := romstage
94 imd_cbmem-romstage-test-srcs += tests/lib/imd_cbmem-test.c
95 imd_cbmem-romstage-test-srcs += tests/stubs/console.c
96 imd_cbmem-romstage-test-srcs += src/lib/imd.c
97 imd_cbmem-romstage-test-mocks += cbmem_top_chipset
99 region_file-test-srcs += tests/lib/region_file-test.c
100 region_file-test-srcs += src/commonlib/region.c
101 region_file-test-srcs += tests/stubs/console.c
103 stack-test-srcs += tests/lib/stack-test.c
104 stack-test-srcs += src/lib/stack.c
105 stack-test-srcs += tests/stubs/console.c
107 memset-test-srcs += tests/lib/memset-test.c
108 memset-test-srcs += src/lib/memset.c
110 memcmp-test-srcs += tests/lib/memcmp-test.c
112 memchr-test-srcs += tests/lib/memchr-test.c
113 memchr-test-srcs += src/lib/memchr.c
115 memcpy-test-srcs += tests/lib/memcpy-test.c
117 malloc-test-srcs += tests/lib/malloc-test.c
118 malloc-test-srcs += tests/stubs/console.c
120 memmove-test-srcs += tests/lib/memmove-test.c
122 crc_byte-test-srcs += tests/lib/crc_byte-test.c
123 crc_byte-test-srcs += src/lib/crc_byte.c
125 compute_ip_checksum-test-srcs += tests/lib/compute_ip_checksum-test.c
126 compute_ip_checksum-test-srcs += src/lib/compute_ip_checksum.c
128 memrange-test-srcs += tests/lib/memrange-test.c
129 memrange-test-srcs += src/lib/memrange.c
130 memrange-test-srcs += tests/stubs/console.c
131 memrange-test-srcs += src/device/device_util.c
133 uuid-test-srcs += tests/lib/uuid-test.c
134 uuid-test-srcs += src/lib/hexstrtobin.c
135 uuid-test-srcs += src/lib/uuid.c
137 bootmem-test-srcs += tests/lib/bootmem-test.c
138 bootmem-test-srcs += tests/stubs/console.c
139 bootmem-test-srcs += src/device/device_util.c
140 bootmem-test-srcs += src/lib/bootmem.c
141 bootmem-test-srcs += src/lib/memrange.c
143 dimm_info_util-test-srcs += tests/lib/dimm_info_util-test.c
144 dimm_info_util-test-srcs += src/device/dram/spd.c
145 dimm_info_util-test-srcs += src/lib/dimm_info_util.c
146 dimm_info_util-test-srcs += tests/stubs/console.c
148 coreboot_table-test-srcs += tests/lib/coreboot_table-test.c
149 coreboot_table-test-srcs += tests/stubs/console.c
150 coreboot_table-test-srcs += src/lib/compute_ip_checksum.c
151 coreboot_table-test-srcs += src/lib/coreboot_table.c
152 coreboot_table-test-srcs += src/lib/imd_cbmem.c
153 coreboot_table-test-srcs += src/lib/imd.c
154 coreboot_table-test-cflags += -I tests/include/tests/lib/fmap
155 coreboot_table-test-mocks += cbmem_top_chipset
157 rtc-test-srcs += tests/lib/rtc-test.c
158 rtc-test-srcs += src/lib/rtc.c
160 spd_cache-ddr3-test-srcs += tests/lib/spd_cache-test.c
161 spd_cache-ddr3-test-srcs += tests/stubs/console.c
162 spd_cache-ddr3-test-srcs += src/lib/spd_cache.c
163 spd_cache-ddr3-test-srcs += src/lib/crc_byte.c
164 spd_cache-ddr3-test-srcs += src/commonlib/region.c
165 spd_cache-ddr3-test-mocks += fmap_locate_area_as_rdev
166 spd_cache-ddr3-test-config += CONFIG_SPD_CACHE_FMAP_NAME=\"RW_SPD_CACHE\" \
167                                 CONFIG_DIMM_MAX=4 CONFIG_DIMM_SPD_SIZE=256 \
168                                 CONFIG_BOOT_DEVICE_MEMORY_MAPPED=1
169 spd_cache-ddr3-test-cflags += -D__TEST_SPD_CACHE_DDR=3
171 spd_cache-ddr4-test-srcs += tests/lib/spd_cache-test.c
172 spd_cache-ddr4-test-srcs += tests/stubs/console.c
173 spd_cache-ddr4-test-srcs += src/lib/spd_cache.c
174 spd_cache-ddr4-test-srcs += src/lib/crc_byte.c
175 spd_cache-ddr4-test-srcs += src/commonlib/region.c
176 spd_cache-ddr4-test-mocks += fmap_locate_area_as_rdev
177 spd_cache-ddr4-test-config += CONFIG_SPD_CACHE_FMAP_NAME=\"RW_SPD_CACHE\" \
178                                 CONFIG_DIMM_MAX=4 CONFIG_DIMM_SPD_SIZE=512 \
179                                 CONFIG_BOOT_DEVICE_MEMORY_MAPPED=1
180 spd_cache-ddr4-test-cflags += -D__TEST_SPD_CACHE_DDR=4
182 cbmem_stage_cache-test-srcs += tests/lib/cbmem_stage_cache-test.c
183 cbmem_stage_cache-test-srcs += tests/stubs/console.c
184 cbmem_stage_cache-test-srcs += src/lib/cbmem_stage_cache.c
185 cbmem_stage_cache-test-srcs += src/lib/imd_cbmem.c
186 cbmem_stage_cache-test-srcs += src/lib/imd.c
187 cbmem_stage_cache-test-config += CONFIG_CBMEM_STAGE_CACHE=1
189 libgcc-test-srcs += tests/lib/libgcc-test.c
191 # CBFS varification tests are compiled with CONFIG_CBFS_VERIFICATION
192 # and VB2_SUPPORT_SHA512 set and unset. Code should work with and without
193 # verification and with hash structure of different sizes.
194 cbfs-verification-no-sha512-test-stage := bootblock
195 cbfs-verification-no-sha512-test-srcs := tests/lib/cbfs-verification-test.c \
196                                         tests/stubs/console.c \
197                                         tests/stubs/die.c \
198                                         tests/mock/cbfs_file_mock.c \
199                                         src/lib/cbfs.c \
200                                         src/commonlib/bsd/cbfs_private.c \
201                                         src/commonlib/mem_pool.c \
202                                         src/commonlib/region.c
203 cbfs-verification-no-sha512-test-mocks += cbfs_get_boot_device cbfs_lookup
204 cbfs-verification-no-sha512-test-config += CONFIG_COLLECT_TIMESTAMPS=0 \
205                                         CONFIG_CBFS_VERIFICATION=1 \
206                                         CONFIG_NO_CBFS_MCACHE=1 \
207                                         VB2_SUPPORT_SHA512=0
209 $(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test)
210 cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1
212 $(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test)
213 cbfs-no-verification-no-sha512-test-config += CONFIG_CBFS_VERIFICATION=0
215 $(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test)
216 cbfs-no-verification-has-sha512-test-config += CONFIG_CBFS_VERIFICATION=0 \
217                                                 VB2_SUPPORT_SHA512=1
219 cbfs-lookup-no-mcache-test-srcs = tests/lib/cbfs-lookup-test.c \
220                                 tests/stubs/console.c \
221                                 tests/stubs/die.c \
222                                 tests/mock/cbfs_file_mock.c \
223                                 src/lib/cbfs.c \
224                                 src/commonlib/bsd/cbfs_private.c \
225                                 src/commonlib/bsd/cbfs_mcache.c \
226                                 src/commonlib/mem_pool.c \
227                                 src/commonlib/region.c
228 cbfs-lookup-no-mcache-test-mocks += cbfs_get_boot_device \
229                                         cbfs_lookup \
230                                         cbfs_mcache_lookup \
231                                         mem_pool_alloc \
232                                         mem_pool_free
233 cbfs-lookup-no-mcache-test-config += CONFIG_ARCH_X86=0 \
234                                 CONFIG_COLLECT_TIMESTAMPS=0 \
235                                 CONFIG_NO_CBFS_MCACHE=1
237 $(call copy-test,cbfs-lookup-no-mcache-test,cbfs-lookup-has-mcache-test)
238 cbfs-lookup-has-mcache-test-config += CONFIG_NO_CBFS_MCACHE=0
240 lzma-test-srcs += tests/lib/lzma-test.c
241 lzma-test-srcs += tests/stubs/console.c
242 lzma-test-srcs += src/lib/lzma.c
243 lzma-test-srcs += src/lib/lzmadecode.c