Jan Dabros | b0800d3 | 2020-05-06 16:01:27 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Jan Dabros | 2d0ee36 | 2020-04-20 15:19:45 +0200 | [diff] [blame] | 2 | |
Yu-Ping Wu | 00c834d | 2021-12-02 10:54:32 +0800 | [diff] [blame] | 3 | tests-y += lib-test |
Jan Dabros | 2d0ee36 | 2020-04-20 15:19:45 +0200 | [diff] [blame] | 4 | tests-y += string-test |
Anna Karas | 072a9b9 | 2020-06-08 15:16:19 +0200 | [diff] [blame] | 5 | tests-y += b64_decode-test |
Anna Karas | 5664bc8 | 2020-07-02 10:09:47 +0200 | [diff] [blame] | 6 | tests-y += hexstrtobin-test |
Jakub Czapiga | 466a378 | 2020-10-05 10:44:46 +0200 | [diff] [blame] | 7 | tests-y += imd-test |
Jakub Czapiga | e0c60f3 | 2020-10-09 10:07:47 +0200 | [diff] [blame] | 8 | tests-y += timestamp-test |
Jakub Czapiga | e0af9fc | 2020-10-09 16:02:46 +0200 | [diff] [blame] | 9 | tests-y += edid-test |
Jakub Czapiga | f9961ff | 2020-11-16 15:25:34 +0100 | [diff] [blame] | 10 | tests-y += cbmem_console-romstage-test |
| 11 | tests-y += cbmem_console-ramstage-test |
Jakub Czapiga | dd85c82 | 2020-12-10 11:16:47 +0100 | [diff] [blame] | 12 | tests-y += fmap-test |
Jakub Czapiga | a2b21c2 | 2020-10-08 12:37:40 +0200 | [diff] [blame] | 13 | tests-y += imd_cbmem-romstage-test |
| 14 | tests-y += imd_cbmem-ramstage-test |
Jakub Czapiga | eb6f80d | 2021-01-07 09:24:33 +0100 | [diff] [blame] | 15 | tests-y += region_file-test |
Jakub Czapiga | b3a7c84 | 2021-02-05 15:10:25 +0100 | [diff] [blame] | 16 | tests-y += stack-test |
Jakub Czapiga | 7a940df | 2021-02-15 12:07:10 +0100 | [diff] [blame] | 17 | tests-y += memset-test |
Jakub Czapiga | c4ca8c3 | 2021-02-16 11:13:32 +0100 | [diff] [blame] | 18 | tests-y += memcmp-test |
Jakub Czapiga | cc7acb8 | 2021-02-15 14:21:20 +0100 | [diff] [blame] | 19 | tests-y += memchr-test |
Jakub Czapiga | eb4bb6f | 2021-02-16 13:27:17 +0100 | [diff] [blame] | 20 | tests-y += memcpy-test |
Jakub Czapiga | 7a18721 | 2021-02-15 09:54:03 +0100 | [diff] [blame] | 21 | tests-y += malloc-test |
Jakub Czapiga | f5e636c | 2021-02-19 10:09:42 +0100 | [diff] [blame] | 22 | tests-y += memmove-test |
Jakub Czapiga | 0b6b968 | 2021-02-24 16:33:21 +0100 | [diff] [blame] | 23 | tests-y += crc_byte-test |
Jan Dabros | 9e16ca9 | 2020-07-08 22:33:52 +0200 | [diff] [blame] | 24 | tests-y += memrange-test |
Jakub Czapiga | f5c0021 | 2021-03-31 12:41:29 +0200 | [diff] [blame] | 25 | tests-y += uuid-test |
Jan Dabros | 9357693 | 2020-07-16 12:05:47 +0200 | [diff] [blame] | 26 | tests-y += bootmem-test |
Jakub Czapiga | dadcae6 | 2021-04-08 16:29:03 +0200 | [diff] [blame] | 27 | tests-y += dimm_info_util-test |
Jakub Czapiga | 5d88483 | 2021-04-06 09:42:02 +0200 | [diff] [blame] | 28 | tests-y += coreboot_table-test |
Jakub Czapiga | a37c802 | 2021-04-15 11:39:13 +0200 | [diff] [blame] | 29 | tests-y += rtc-test |
Jakub Czapiga | 2b8d721 | 2021-04-22 20:14:02 +0200 | [diff] [blame] | 30 | tests-y += spd_cache-ddr3-test |
| 31 | tests-y += spd_cache-ddr4-test |
Jakub Czapiga | db4b21a | 2021-05-25 15:46:37 +0200 | [diff] [blame] | 32 | tests-y += cbmem_stage_cache-test |
Jakub Czapiga | ca3aa52 | 2021-07-13 15:03:10 +0200 | [diff] [blame] | 33 | tests-y += libgcc-test |
Jakub Czapiga | 6f3fd63 | 2021-07-22 08:52:46 +0200 | [diff] [blame] | 34 | tests-y += cbfs-verification-no-sha512-test |
| 35 | tests-y += cbfs-verification-has-sha512-test |
| 36 | tests-y += cbfs-no-verification-no-sha512-test |
| 37 | tests-y += cbfs-no-verification-has-sha512-test |
Jakub Czapiga | b20aa09 | 2021-07-27 17:04:11 +0200 | [diff] [blame] | 38 | tests-y += cbfs-lookup-no-mcache-test |
| 39 | tests-y += cbfs-lookup-has-mcache-test |
Jakub Czapiga | c1e4c5a | 2021-07-23 13:35:14 +0200 | [diff] [blame] | 40 | tests-y += lzma-test |
Hsuan Ting Chen | abaa4b5 | 2023-07-05 19:07:23 +0800 | [diff] [blame] | 41 | tests-y += ux_locales-test |
Maximilian Brune | 33079b8 | 2024-03-04 15:34:41 +0100 | [diff] [blame] | 42 | tests-y += device_tree-test |
Jan Dabros | 2d0ee36 | 2020-04-20 15:19:45 +0200 | [diff] [blame] | 43 | |
Yu-Ping Wu | 00c834d | 2021-12-02 10:54:32 +0800 | [diff] [blame] | 44 | lib-test-srcs += tests/lib/lib-test.c |
| 45 | |
Maximilian Brune | 33079b8 | 2024-03-04 15:34:41 +0100 | [diff] [blame] | 46 | device_tree-test-srcs += tests/lib/device_tree-test.c |
| 47 | device_tree-test-srcs += tests/stubs/console.c |
| 48 | device_tree-test-srcs += src/lib/device_tree.c |
| 49 | device_tree-test-syssrcs += tests/helpers/file.c |
| 50 | |
Jan Dabros | 2d0ee36 | 2020-04-20 15:19:45 +0200 | [diff] [blame] | 51 | string-test-srcs += tests/lib/string-test.c |
| 52 | string-test-srcs += src/lib/string.c |
Anna Karas | 072a9b9 | 2020-06-08 15:16:19 +0200 | [diff] [blame] | 53 | |
| 54 | b64_decode-test-srcs += tests/lib/b64_decode-test.c |
Anna Karas | f7cd0d5 | 2020-07-07 16:38:27 +0200 | [diff] [blame] | 55 | b64_decode-test-srcs += tests/stubs/console.c |
Anna Karas | 072a9b9 | 2020-06-08 15:16:19 +0200 | [diff] [blame] | 56 | b64_decode-test-srcs += src/lib/b64_decode.c |
Anna Karas | 5664bc8 | 2020-07-02 10:09:47 +0200 | [diff] [blame] | 57 | |
| 58 | hexstrtobin-test-srcs += tests/lib/hexstrtobin-test.c |
| 59 | hexstrtobin-test-srcs += src/lib/hexstrtobin.c |
Jakub Czapiga | 466a378 | 2020-10-05 10:44:46 +0200 | [diff] [blame] | 60 | |
| 61 | imd-test-srcs += tests/lib/imd-test.c |
| 62 | imd-test-srcs += tests/stubs/console.c |
Jakub Czapiga | e0c60f3 | 2020-10-09 10:07:47 +0200 | [diff] [blame] | 63 | imd-test-srcs += src/lib/imd.c |
| 64 | |
| 65 | timestamp-test-srcs += tests/lib/timestamp-test.c |
| 66 | timestamp-test-srcs += tests/stubs/timestamp.c |
| 67 | timestamp-test-srcs += tests/stubs/console.c |
| 68 | timestamp-test-stage := romstage |
Jakub Czapiga | e0af9fc | 2020-10-09 16:02:46 +0200 | [diff] [blame] | 69 | |
| 70 | edid-test-srcs += tests/lib/edid-test.c |
| 71 | edid-test-srcs += src/lib/edid.c |
| 72 | edid-test-srcs += tests/stubs/console.c |
| 73 | |
Jakub Czapiga | f9961ff | 2020-11-16 15:25:34 +0100 | [diff] [blame] | 74 | cbmem_console-romstage-test-stage := romstage |
| 75 | cbmem_console-romstage-test-srcs += tests/lib/cbmem_console-test.c |
| 76 | cbmem_console-romstage-test-srcs += tests/stubs/console.c |
| 77 | |
| 78 | cbmem_console-ramstage-test-stage := ramstage |
| 79 | cbmem_console-ramstage-test-srcs += tests/lib/cbmem_console-test.c |
Jakub Czapiga | ea378cc | 2020-11-12 12:10:51 +0100 | [diff] [blame] | 80 | cbmem_console-ramstage-test-srcs += tests/stubs/console.c |
| 81 | |
Jakub Czapiga | dd85c82 | 2020-12-10 11:16:47 +0100 | [diff] [blame] | 82 | fmap-test-srcs += tests/lib/fmap-test.c |
| 83 | fmap-test-srcs += src/lib/fmap.c |
| 84 | fmap-test-srcs += tests/stubs/console.c |
| 85 | fmap-test-srcs += src/lib/boot_device.c |
| 86 | fmap-test-srcs += src/commonlib/region.c |
| 87 | fmap-test-cflags += -I tests/include/tests/lib/fmap |
Jakub Czapiga | a2b21c2 | 2020-10-08 12:37:40 +0200 | [diff] [blame] | 88 | |
| 89 | imd_cbmem-ramstage-test-stage := ramstage |
| 90 | imd_cbmem-ramstage-test-srcs += tests/lib/imd_cbmem-test.c |
| 91 | imd_cbmem-ramstage-test-srcs += tests/stubs/console.c |
| 92 | imd_cbmem-ramstage-test-srcs += src/lib/imd.c |
| 93 | imd_cbmem-ramstage-test-mocks += cbmem_top_chipset |
| 94 | |
| 95 | imd_cbmem-romstage-test-stage := romstage |
| 96 | imd_cbmem-romstage-test-srcs += tests/lib/imd_cbmem-test.c |
| 97 | imd_cbmem-romstage-test-srcs += tests/stubs/console.c |
| 98 | imd_cbmem-romstage-test-srcs += src/lib/imd.c |
| 99 | imd_cbmem-romstage-test-mocks += cbmem_top_chipset |
| 100 | |
Jakub Czapiga | eb6f80d | 2021-01-07 09:24:33 +0100 | [diff] [blame] | 101 | region_file-test-srcs += tests/lib/region_file-test.c |
| 102 | region_file-test-srcs += src/commonlib/region.c |
| 103 | region_file-test-srcs += tests/stubs/console.c |
Jakub Czapiga | b3a7c84 | 2021-02-05 15:10:25 +0100 | [diff] [blame] | 104 | |
| 105 | stack-test-srcs += tests/lib/stack-test.c |
| 106 | stack-test-srcs += src/lib/stack.c |
| 107 | stack-test-srcs += tests/stubs/console.c |
Jakub Czapiga | 7a940df | 2021-02-15 12:07:10 +0100 | [diff] [blame] | 108 | |
| 109 | memset-test-srcs += tests/lib/memset-test.c |
| 110 | memset-test-srcs += src/lib/memset.c |
Jakub Czapiga | c4ca8c3 | 2021-02-16 11:13:32 +0100 | [diff] [blame] | 111 | |
| 112 | memcmp-test-srcs += tests/lib/memcmp-test.c |
| 113 | |
Jakub Czapiga | cc7acb8 | 2021-02-15 14:21:20 +0100 | [diff] [blame] | 114 | memchr-test-srcs += tests/lib/memchr-test.c |
| 115 | memchr-test-srcs += src/lib/memchr.c |
| 116 | |
Jakub Czapiga | eb4bb6f | 2021-02-16 13:27:17 +0100 | [diff] [blame] | 117 | memcpy-test-srcs += tests/lib/memcpy-test.c |
| 118 | |
Jakub Czapiga | 7a18721 | 2021-02-15 09:54:03 +0100 | [diff] [blame] | 119 | malloc-test-srcs += tests/lib/malloc-test.c |
| 120 | malloc-test-srcs += tests/stubs/console.c |
| 121 | |
Jakub Czapiga | f5e636c | 2021-02-19 10:09:42 +0100 | [diff] [blame] | 122 | memmove-test-srcs += tests/lib/memmove-test.c |
| 123 | |
Jakub Czapiga | 0b6b968 | 2021-02-24 16:33:21 +0100 | [diff] [blame] | 124 | crc_byte-test-srcs += tests/lib/crc_byte-test.c |
| 125 | crc_byte-test-srcs += src/lib/crc_byte.c |
| 126 | |
Jan Dabros | 9e16ca9 | 2020-07-08 22:33:52 +0200 | [diff] [blame] | 127 | memrange-test-srcs += tests/lib/memrange-test.c |
| 128 | memrange-test-srcs += src/lib/memrange.c |
| 129 | memrange-test-srcs += tests/stubs/console.c |
| 130 | memrange-test-srcs += src/device/device_util.c |
| 131 | |
Jakub Czapiga | f5c0021 | 2021-03-31 12:41:29 +0200 | [diff] [blame] | 132 | uuid-test-srcs += tests/lib/uuid-test.c |
| 133 | uuid-test-srcs += src/lib/hexstrtobin.c |
| 134 | uuid-test-srcs += src/lib/uuid.c |
Jan Dabros | 9357693 | 2020-07-16 12:05:47 +0200 | [diff] [blame] | 135 | |
| 136 | bootmem-test-srcs += tests/lib/bootmem-test.c |
| 137 | bootmem-test-srcs += tests/stubs/console.c |
| 138 | bootmem-test-srcs += src/device/device_util.c |
| 139 | bootmem-test-srcs += src/lib/bootmem.c |
| 140 | bootmem-test-srcs += src/lib/memrange.c |
| 141 | |
Jakub Czapiga | dadcae6 | 2021-04-08 16:29:03 +0200 | [diff] [blame] | 142 | dimm_info_util-test-srcs += tests/lib/dimm_info_util-test.c |
Subrata Banik | 6de8b42 | 2021-10-26 20:46:21 +0530 | [diff] [blame] | 143 | dimm_info_util-test-srcs += src/device/dram/spd.c |
Jakub Czapiga | dadcae6 | 2021-04-08 16:29:03 +0200 | [diff] [blame] | 144 | dimm_info_util-test-srcs += src/lib/dimm_info_util.c |
| 145 | dimm_info_util-test-srcs += tests/stubs/console.c |
| 146 | |
Jakub Czapiga | 5d88483 | 2021-04-06 09:42:02 +0200 | [diff] [blame] | 147 | coreboot_table-test-srcs += tests/lib/coreboot_table-test.c |
| 148 | coreboot_table-test-srcs += tests/stubs/console.c |
Julius Werner | de37109 | 2024-01-30 16:51:05 -0800 | [diff] [blame] | 149 | coreboot_table-test-srcs += src/commonlib/bsd/ipchksum.c |
Jakub Czapiga | 5d88483 | 2021-04-06 09:42:02 +0200 | [diff] [blame] | 150 | coreboot_table-test-srcs += src/lib/coreboot_table.c |
| 151 | coreboot_table-test-srcs += src/lib/imd_cbmem.c |
| 152 | coreboot_table-test-srcs += src/lib/imd.c |
Jakub Czapiga | 5d88483 | 2021-04-06 09:42:02 +0200 | [diff] [blame] | 153 | coreboot_table-test-cflags += -I tests/include/tests/lib/fmap |
| 154 | coreboot_table-test-mocks += cbmem_top_chipset |
Jakub Czapiga | a37c802 | 2021-04-15 11:39:13 +0200 | [diff] [blame] | 155 | |
| 156 | rtc-test-srcs += tests/lib/rtc-test.c |
| 157 | rtc-test-srcs += src/lib/rtc.c |
| 158 | |
Jakub Czapiga | 2b8d721 | 2021-04-22 20:14:02 +0200 | [diff] [blame] | 159 | spd_cache-ddr3-test-srcs += tests/lib/spd_cache-test.c |
| 160 | spd_cache-ddr3-test-srcs += tests/stubs/console.c |
| 161 | spd_cache-ddr3-test-srcs += src/lib/spd_cache.c |
| 162 | spd_cache-ddr3-test-srcs += src/lib/crc_byte.c |
| 163 | spd_cache-ddr3-test-srcs += src/commonlib/region.c |
| 164 | spd_cache-ddr3-test-mocks += fmap_locate_area_as_rdev |
| 165 | spd_cache-ddr3-test-config += CONFIG_SPD_CACHE_FMAP_NAME=\"RW_SPD_CACHE\" \ |
| 166 | CONFIG_DIMM_MAX=4 CONFIG_DIMM_SPD_SIZE=256 \ |
| 167 | CONFIG_BOOT_DEVICE_MEMORY_MAPPED=1 |
| 168 | spd_cache-ddr3-test-cflags += -D__TEST_SPD_CACHE_DDR=3 |
| 169 | |
| 170 | spd_cache-ddr4-test-srcs += tests/lib/spd_cache-test.c |
| 171 | spd_cache-ddr4-test-srcs += tests/stubs/console.c |
| 172 | spd_cache-ddr4-test-srcs += src/lib/spd_cache.c |
| 173 | spd_cache-ddr4-test-srcs += src/lib/crc_byte.c |
| 174 | spd_cache-ddr4-test-srcs += src/commonlib/region.c |
| 175 | spd_cache-ddr4-test-mocks += fmap_locate_area_as_rdev |
| 176 | spd_cache-ddr4-test-config += CONFIG_SPD_CACHE_FMAP_NAME=\"RW_SPD_CACHE\" \ |
| 177 | CONFIG_DIMM_MAX=4 CONFIG_DIMM_SPD_SIZE=512 \ |
| 178 | CONFIG_BOOT_DEVICE_MEMORY_MAPPED=1 |
| 179 | spd_cache-ddr4-test-cflags += -D__TEST_SPD_CACHE_DDR=4 |
Jakub Czapiga | db4b21a | 2021-05-25 15:46:37 +0200 | [diff] [blame] | 180 | |
| 181 | cbmem_stage_cache-test-srcs += tests/lib/cbmem_stage_cache-test.c |
| 182 | cbmem_stage_cache-test-srcs += tests/stubs/console.c |
| 183 | cbmem_stage_cache-test-srcs += src/lib/cbmem_stage_cache.c |
| 184 | cbmem_stage_cache-test-srcs += src/lib/imd_cbmem.c |
| 185 | cbmem_stage_cache-test-srcs += src/lib/imd.c |
Jakub Czapiga | db4b21a | 2021-05-25 15:46:37 +0200 | [diff] [blame] | 186 | cbmem_stage_cache-test-config += CONFIG_CBMEM_STAGE_CACHE=1 |
Jakub Czapiga | ca3aa52 | 2021-07-13 15:03:10 +0200 | [diff] [blame] | 187 | |
| 188 | libgcc-test-srcs += tests/lib/libgcc-test.c |
Jakub Czapiga | 6f3fd63 | 2021-07-22 08:52:46 +0200 | [diff] [blame] | 189 | |
| 190 | # CBFS varification tests are compiled with CONFIG_CBFS_VERIFICATION |
| 191 | # and VB2_SUPPORT_SHA512 set and unset. Code should work with and without |
| 192 | # verification and with hash structure of different sizes. |
| 193 | cbfs-verification-no-sha512-test-stage := bootblock |
| 194 | cbfs-verification-no-sha512-test-srcs := tests/lib/cbfs-verification-test.c \ |
| 195 | tests/stubs/console.c \ |
| 196 | tests/stubs/die.c \ |
| 197 | tests/mock/cbfs_file_mock.c \ |
| 198 | src/lib/cbfs.c \ |
| 199 | src/commonlib/bsd/cbfs_private.c \ |
| 200 | src/commonlib/mem_pool.c \ |
| 201 | src/commonlib/region.c |
| 202 | cbfs-verification-no-sha512-test-mocks += cbfs_get_boot_device cbfs_lookup |
| 203 | cbfs-verification-no-sha512-test-config += CONFIG_COLLECT_TIMESTAMPS=0 \ |
| 204 | CONFIG_CBFS_VERIFICATION=1 \ |
| 205 | CONFIG_NO_CBFS_MCACHE=1 \ |
| 206 | VB2_SUPPORT_SHA512=0 |
| 207 | |
| 208 | $(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test) |
| 209 | cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1 |
| 210 | |
| 211 | $(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test) |
| 212 | cbfs-no-verification-no-sha512-test-config += CONFIG_CBFS_VERIFICATION=0 |
| 213 | |
| 214 | $(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test) |
| 215 | cbfs-no-verification-has-sha512-test-config += CONFIG_CBFS_VERIFICATION=0 \ |
| 216 | VB2_SUPPORT_SHA512=1 |
Jakub Czapiga | b20aa09 | 2021-07-27 17:04:11 +0200 | [diff] [blame] | 217 | |
| 218 | cbfs-lookup-no-mcache-test-srcs = tests/lib/cbfs-lookup-test.c \ |
| 219 | tests/stubs/console.c \ |
| 220 | tests/stubs/die.c \ |
| 221 | tests/mock/cbfs_file_mock.c \ |
| 222 | src/lib/cbfs.c \ |
| 223 | src/commonlib/bsd/cbfs_private.c \ |
| 224 | src/commonlib/bsd/cbfs_mcache.c \ |
| 225 | src/commonlib/mem_pool.c \ |
| 226 | src/commonlib/region.c |
| 227 | cbfs-lookup-no-mcache-test-mocks += cbfs_get_boot_device \ |
| 228 | cbfs_lookup \ |
| 229 | cbfs_mcache_lookup \ |
| 230 | mem_pool_alloc \ |
| 231 | mem_pool_free |
| 232 | cbfs-lookup-no-mcache-test-config += CONFIG_ARCH_X86=0 \ |
| 233 | CONFIG_COLLECT_TIMESTAMPS=0 \ |
| 234 | CONFIG_NO_CBFS_MCACHE=1 |
| 235 | |
| 236 | $(call copy-test,cbfs-lookup-no-mcache-test,cbfs-lookup-has-mcache-test) |
| 237 | cbfs-lookup-has-mcache-test-config += CONFIG_NO_CBFS_MCACHE=0 |
Jakub Czapiga | c1e4c5a | 2021-07-23 13:35:14 +0200 | [diff] [blame] | 238 | |
| 239 | lzma-test-srcs += tests/lib/lzma-test.c |
| 240 | lzma-test-srcs += tests/stubs/console.c |
| 241 | lzma-test-srcs += src/lib/lzma.c |
| 242 | lzma-test-srcs += src/lib/lzmadecode.c |
Maximilian Brune | 25c737d | 2024-05-09 02:53:51 +0200 | [diff] [blame] | 243 | lzma-test-syssrcs += tests/helpers/file.c |
Hsuan Ting Chen | abaa4b5 | 2023-07-05 19:07:23 +0800 | [diff] [blame] | 244 | |
| 245 | ux_locales-test-srcs += tests/lib/ux_locales-test.c |
| 246 | ux_locales-test-srcs += tests/stubs/console.c |
| 247 | ux_locales-test-srcs += src/lib/ux_locales.c |
| 248 | ux_locales-test-mocks += _cbfs_alloc \ |
| 249 | cbfs_unmap \ |
| 250 | vb2api_get_locale_id \ |
| 251 | vboot_get_context |
Subrata Banik | 2495f24 | 2023-11-15 10:15:58 +0530 | [diff] [blame] | 252 | ux_locales-test-config += CONFIG_VBOOT=1 |