Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
Armando Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
David Rogers | a2c4d1d | 2021-01-15 03:17:28 -0800 | [diff] [blame] | 17 | import("$dir_pw_bloat/bloat.gni") |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 18 | import("$dir_pw_build/module_config.gni") |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 19 | import("$dir_pw_build/target_types.gni") |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 20 | import("$dir_pw_docgen/docs.gni") |
| 21 | import("$dir_pw_unit_test/test.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 22 | |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 23 | declare_args() { |
| 24 | # The build target that overrides the default configuration options for this |
| 25 | # module. This should point to a source set that provides defines through a |
| 26 | # public config (which may -include a file or add defines directly). |
| 27 | pw_kvs_CONFIG = pw_build_DEFAULT_MODULE_CONFIG |
| 28 | } |
| 29 | |
| 30 | config("public_include_path") { |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 31 | include_dirs = [ "public" ] |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 32 | visibility = [ ":*" ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 33 | } |
| 34 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 35 | pw_source_set("pw_kvs") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 36 | public_configs = [ ":public_include_path" ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 37 | public = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 38 | "public/pw_kvs/alignment.h", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 39 | "public/pw_kvs/checksum.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 40 | "public/pw_kvs/flash_memory.h", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 41 | "public/pw_kvs/flash_test_partition.h", |
Wyatt Hepler | 88adfe8 | 2020-02-20 19:33:27 -0800 | [diff] [blame] | 42 | "public/pw_kvs/format.h", |
Wyatt Hepler | 06b1b0b | 2020-03-09 08:26:34 -0700 | [diff] [blame] | 43 | "public/pw_kvs/io.h", |
Rob Oliver | e64daf4 | 2020-11-24 11:50:03 -0500 | [diff] [blame] | 44 | "public/pw_kvs/key.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 45 | "public/pw_kvs/key_value_store.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 46 | ] |
| 47 | sources = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 48 | "alignment.cc", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 49 | "checksum.cc", |
Wyatt Hepler | d31d970 | 2020-02-14 08:46:36 -0800 | [diff] [blame] | 50 | "entry.cc", |
Wyatt Hepler | 7ded6da | 2020-03-11 18:24:43 -0700 | [diff] [blame] | 51 | "entry_cache.cc", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 52 | "flash_memory.cc", |
Wyatt Hepler | 22d0d9f | 2020-03-05 14:57:11 -0800 | [diff] [blame] | 53 | "format.cc", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 54 | "key_value_store.cc", |
Wyatt Hepler | bdd8e5a | 2020-02-20 19:27:26 -0800 | [diff] [blame] | 55 | "public/pw_kvs/internal/entry.h", |
Wyatt Hepler | 7ded6da | 2020-03-11 18:24:43 -0700 | [diff] [blame] | 56 | "public/pw_kvs/internal/entry_cache.h", |
Wyatt Hepler | 1fc1104 | 2020-02-19 17:17:51 -0800 | [diff] [blame] | 57 | "public/pw_kvs/internal/hash.h", |
| 58 | "public/pw_kvs/internal/key_descriptor.h", |
Wyatt Hepler | 2454f2d | 2020-03-20 12:54:35 -0700 | [diff] [blame] | 59 | "public/pw_kvs/internal/sectors.h", |
Keir Mierle | 0dd24a8 | 2020-02-21 16:08:59 -0800 | [diff] [blame] | 60 | "public/pw_kvs/internal/span_traits.h", |
Wyatt Hepler | c84393f | 2020-03-20 11:23:24 -0700 | [diff] [blame] | 61 | "sectors.cc", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 62 | ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 63 | public_deps = [ |
David Rogers | 02892d2 | 2020-07-30 00:33:00 -0700 | [diff] [blame] | 64 | dir_pw_assert, |
Rob Oliver | f61adbd | 2020-12-09 13:46:46 -0500 | [diff] [blame] | 65 | dir_pw_bytes, |
Wyatt Hepler | 1c329ca | 2020-02-07 18:07:23 -0800 | [diff] [blame] | 66 | dir_pw_containers, |
Wyatt Hepler | ad684a1 | 2020-02-04 17:17:29 -0800 | [diff] [blame] | 67 | dir_pw_status, |
Rob Oliver | f61adbd | 2020-12-09 13:46:46 -0500 | [diff] [blame] | 68 | dir_pw_string, |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 69 | ] |
| 70 | deps = [ |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 71 | ":config", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 72 | dir_pw_checksum, |
| 73 | dir_pw_log, |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 74 | ] |
Wyatt Hepler | a8557ef | 2020-05-04 16:29:23 -0700 | [diff] [blame] | 75 | friend = [ ":*" ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 76 | } |
| 77 | |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 78 | pw_source_set("config") { |
| 79 | public_deps = [ pw_kvs_CONFIG ] |
| 80 | public = [ "pw_kvs_private/config.h" ] |
| 81 | visibility = [ ":*" ] |
| 82 | } |
| 83 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 84 | pw_source_set("crc16") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 85 | public = [ "public/pw_kvs/crc16_checksum.h" ] |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 86 | public_deps = [ |
| 87 | ":pw_kvs", |
| 88 | dir_pw_checksum, |
| 89 | ] |
| 90 | } |
| 91 | |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 92 | pw_source_set("flash_test_partition") { |
| 93 | public = [ "public/pw_kvs/flash_test_partition.h" ] |
| 94 | public_deps = [ ":pw_kvs" ] |
| 95 | } |
| 96 | |
| 97 | pw_source_set("test_key_value_store") { |
| 98 | public = [ "public/pw_kvs/test_key_value_store.h" ] |
| 99 | public_deps = [ ":pw_kvs" ] |
| 100 | } |
| 101 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 102 | pw_source_set("fake_flash") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 103 | public_configs = [ ":public_include_path" ] |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 104 | public = [ "public/pw_kvs/fake_flash_memory.h" ] |
| 105 | sources = [ "fake_flash_memory.cc" ] |
| 106 | public_deps = [ |
| 107 | dir_pw_containers, |
| 108 | dir_pw_kvs, |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 109 | dir_pw_status, |
| 110 | ] |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 111 | deps = [ |
| 112 | ":config", |
| 113 | dir_pw_log, |
| 114 | ] |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 115 | } |
| 116 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 117 | pw_source_set("fake_flash_small_partition") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 118 | public_configs = [ ":public_include_path" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 119 | public = [ "public/pw_kvs/flash_test_partition.h" ] |
| 120 | sources = [ "fake_flash_test_partition.cc" ] |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 121 | public_deps = [ ":flash_test_partition" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 122 | deps = [ |
| 123 | ":fake_flash", |
| 124 | dir_pw_kvs, |
| 125 | ] |
| 126 | } |
| 127 | |
David Rogers | a2c4d1d | 2021-01-15 03:17:28 -0800 | [diff] [blame] | 128 | pw_source_set("fake_flash_12_byte_partition") { |
| 129 | public_configs = [ ":public_include_path" ] |
| 130 | public = [ "public/pw_kvs/flash_test_partition.h" ] |
| 131 | sources = [ "fake_flash_test_partition.cc" ] |
| 132 | public_deps = [ ":flash_test_partition" ] |
| 133 | deps = [ |
| 134 | ":fake_flash", |
| 135 | dir_pw_kvs, |
| 136 | ] |
| 137 | defines = [ |
| 138 | "PW_FLASH_TEST_SECTORS=3", |
| 139 | "PW_FLASH_TEST_SECTOR_SIZE=4", |
| 140 | "PW_FLASH_TEST_ALIGNMENT=4", |
| 141 | ] |
| 142 | } |
| 143 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 144 | pw_source_set("fake_flash_64_aligned_partition") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 145 | public_configs = [ ":public_include_path" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 146 | public = [ "public/pw_kvs/flash_test_partition.h" ] |
| 147 | sources = [ "fake_flash_test_partition.cc" ] |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 148 | public_deps = [ ":flash_test_partition" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 149 | deps = [ |
| 150 | ":fake_flash", |
| 151 | dir_pw_kvs, |
| 152 | ] |
| 153 | defines = [ "PW_FLASH_TEST_ALIGNMENT=64" ] |
| 154 | } |
| 155 | |
| 156 | pw_source_set("fake_flash_256_aligned_partition") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 157 | public_configs = [ ":public_include_path" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 158 | public = [ "public/pw_kvs/flash_test_partition.h" ] |
| 159 | sources = [ "fake_flash_test_partition.cc" ] |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 160 | public_deps = [ ":flash_test_partition" ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 161 | deps = [ |
| 162 | ":fake_flash", |
| 163 | dir_pw_kvs, |
| 164 | ] |
| 165 | defines = [ "PW_FLASH_TEST_ALIGNMENT=256" ] |
| 166 | } |
| 167 | |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 168 | pw_source_set("fake_flash_test_key_value_store") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 169 | public_configs = [ ":public_include_path" ] |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 170 | sources = [ "fake_flash_test_key_value_store.cc" ] |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 171 | public_deps = [ ":test_key_value_store" ] |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 172 | deps = [ |
| 173 | ":crc16", |
| 174 | ":fake_flash", |
| 175 | dir_pw_kvs, |
| 176 | ] |
| 177 | } |
| 178 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 179 | pw_source_set("flash_partition_test_100_iterations") { |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 180 | deps = [ |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 181 | ":config", |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 182 | ":flash_test_partition", |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 183 | dir_pw_kvs, |
| 184 | dir_pw_log, |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 185 | dir_pw_unit_test, |
| 186 | ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 187 | sources = [ "flash_partition_test.cc" ] |
| 188 | defines = [ "PW_FLASH_TEST_ITERATIONS=100" ] |
| 189 | } |
| 190 | |
| 191 | pw_source_set("flash_partition_test_2_iterations") { |
| 192 | deps = [ |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 193 | ":config", |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 194 | ":flash_test_partition", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 195 | dir_pw_kvs, |
| 196 | dir_pw_log, |
| 197 | dir_pw_unit_test, |
| 198 | ] |
| 199 | sources = [ "flash_partition_test.cc" ] |
| 200 | defines = [ "PW_FLASH_TEST_ITERATIONS=2" ] |
| 201 | } |
| 202 | |
| 203 | pw_source_set("key_value_store_initialized_test") { |
| 204 | deps = [ |
| 205 | ":crc16", |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 206 | ":flash_test_partition", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 207 | ":pw_kvs", |
Wyatt Hepler | 6b3a6c9 | 2020-08-03 10:15:56 -0700 | [diff] [blame] | 208 | dir_pw_bytes, |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 209 | dir_pw_checksum, |
| 210 | dir_pw_log, |
| 211 | dir_pw_unit_test, |
| 212 | ] |
| 213 | sources = [ "key_value_store_initialized_test.cc" ] |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 214 | } |
| 215 | |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 216 | pw_source_set("key_value_store_fuzz_test") { |
| 217 | deps = [ |
| 218 | ":crc16", |
| 219 | ":flash_test_partition", |
| 220 | ":pw_kvs", |
| 221 | dir_pw_bytes, |
| 222 | dir_pw_checksum, |
| 223 | dir_pw_log, |
| 224 | dir_pw_unit_test, |
| 225 | ] |
| 226 | sources = [ "key_value_store_fuzz_test.cc" ] |
| 227 | } |
| 228 | |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 229 | pw_source_set("test_key_value_store_test") { |
| 230 | deps = [ |
| 231 | ":pw_kvs", |
| 232 | ":test_key_value_store", |
| 233 | dir_pw_unit_test, |
| 234 | ] |
| 235 | sources = [ "test_key_value_store_test.cc" ] |
| 236 | } |
| 237 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 238 | pw_source_set("test_partition") { |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 239 | public_configs = [ ":public_include_path" ] |
David Rogers | 5cc5ce8 | 2020-03-13 19:19:03 -0700 | [diff] [blame] | 240 | public = [ "public/pw_kvs/flash_partition_with_stats.h" ] |
Wyatt Hepler | a8557ef | 2020-05-04 16:29:23 -0700 | [diff] [blame] | 241 | sources = [ "flash_partition_with_stats.cc" ] |
David Rogers | 5cc5ce8 | 2020-03-13 19:19:03 -0700 | [diff] [blame] | 242 | visibility = [ ":*" ] |
| 243 | public_deps = [ |
| 244 | dir_pw_kvs, |
| 245 | dir_pw_log, |
| 246 | dir_pw_status, |
| 247 | ] |
Wyatt Hepler | ae222dc | 2020-10-14 10:46:27 -0700 | [diff] [blame] | 248 | deps = [ ":config" ] |
David Rogers | 5cc5ce8 | 2020-03-13 19:19:03 -0700 | [diff] [blame] | 249 | } |
| 250 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 251 | pw_test_group("tests") { |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 252 | tests = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 253 | ":alignment_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 254 | ":checksum_test", |
Wyatt Hepler | 2debeb6 | 2020-12-03 08:19:57 -0800 | [diff] [blame] | 255 | ":converts_to_span_test", |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 256 | ":entry_test", |
Wyatt Hepler | 7ded6da | 2020-03-11 18:24:43 -0700 | [diff] [blame] | 257 | ":entry_cache_test", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 258 | ":flash_partition_small_test", |
| 259 | ":flash_partition_64_alignment_test", |
| 260 | ":flash_partition_256_alignment_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 261 | ":key_value_store_test", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 262 | ":key_value_store_small_flash_test", |
| 263 | ":key_value_store_64_alignment_flash_test", |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 264 | ":key_value_store_fuzz_64_alignment_flash_test", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 265 | ":key_value_store_256_alignment_flash_test", |
Wyatt Hepler | 8e94ed6 | 2020-03-05 16:45:32 -0800 | [diff] [blame] | 266 | ":key_value_store_binary_format_test", |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 267 | ":key_value_store_put_test", |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame] | 268 | ":key_value_store_map_test", |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 269 | ":fake_flash_test_key_value_store_test", |
Wyatt Hepler | c84393f | 2020-03-20 11:23:24 -0700 | [diff] [blame] | 270 | ":sectors_test", |
Rob Oliver | e64daf4 | 2020-11-24 11:50:03 -0500 | [diff] [blame] | 271 | ":key_test", |
David Rogers | d5138f3 | 2020-04-28 15:18:56 -0700 | [diff] [blame] | 272 | ":key_value_store_wear_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 273 | ] |
| 274 | } |
| 275 | |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 276 | pw_test("alignment_test") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 277 | deps = [ ":pw_kvs" ] |
| 278 | sources = [ "alignment_test.cc" ] |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 279 | } |
| 280 | |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 281 | pw_test("checksum_test") { |
| 282 | deps = [ |
| 283 | ":crc16", |
| 284 | ":pw_kvs", |
| 285 | dir_pw_log, |
| 286 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 287 | sources = [ "checksum_test.cc" ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 288 | } |
| 289 | |
Wyatt Hepler | 2debeb6 | 2020-12-03 08:19:57 -0800 | [diff] [blame] | 290 | pw_test("converts_to_span_test") { |
| 291 | deps = [ ":pw_kvs" ] |
| 292 | sources = [ "converts_to_span_test.cc" ] |
| 293 | } |
| 294 | |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 295 | pw_test("entry_test") { |
| 296 | deps = [ |
Wyatt Hepler | cdd6dfc | 2020-02-18 12:04:04 -0800 | [diff] [blame] | 297 | ":crc16", |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 298 | ":fake_flash", |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 299 | ":pw_kvs", |
Wyatt Hepler | 6b3a6c9 | 2020-08-03 10:15:56 -0700 | [diff] [blame] | 300 | dir_pw_bytes, |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 301 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 302 | sources = [ "entry_test.cc" ] |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 303 | } |
| 304 | |
Wyatt Hepler | 7ded6da | 2020-03-11 18:24:43 -0700 | [diff] [blame] | 305 | pw_test("entry_cache_test") { |
Wyatt Hepler | 0294627 | 2020-03-18 10:36:22 -0700 | [diff] [blame] | 306 | deps = [ |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 307 | ":fake_flash", |
Wyatt Hepler | 0294627 | 2020-03-18 10:36:22 -0700 | [diff] [blame] | 308 | ":pw_kvs", |
Wyatt Hepler | 6b3a6c9 | 2020-08-03 10:15:56 -0700 | [diff] [blame] | 309 | dir_pw_bytes, |
Wyatt Hepler | 0294627 | 2020-03-18 10:36:22 -0700 | [diff] [blame] | 310 | ] |
Wyatt Hepler | 7ded6da | 2020-03-11 18:24:43 -0700 | [diff] [blame] | 311 | sources = [ "entry_cache_test.cc" ] |
| 312 | } |
| 313 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 314 | pw_test("flash_partition_small_test") { |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 315 | deps = [ |
| 316 | ":fake_flash", |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 317 | ":fake_flash_small_partition", |
| 318 | ":flash_partition_test_100_iterations", |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 319 | dir_pw_log, |
| 320 | ] |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | pw_test("flash_partition_64_alignment_test") { |
| 324 | deps = [ |
| 325 | ":fake_flash", |
| 326 | ":fake_flash_64_aligned_partition", |
| 327 | ":flash_partition_test_100_iterations", |
| 328 | dir_pw_log, |
| 329 | ] |
| 330 | } |
| 331 | |
| 332 | pw_test("flash_partition_256_alignment_test") { |
| 333 | deps = [ |
| 334 | ":fake_flash", |
| 335 | ":fake_flash_256_aligned_partition", |
| 336 | ":flash_partition_test_100_iterations", |
| 337 | dir_pw_log, |
| 338 | ] |
David Rogers | ca59296 | 2020-07-01 09:21:54 -0700 | [diff] [blame] | 339 | } |
| 340 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 341 | pw_test("key_value_store_test") { |
| 342 | deps = [ |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 343 | ":crc16", |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 344 | ":fake_flash", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 345 | ":pw_kvs", |
Wyatt Hepler | 6b3a6c9 | 2020-08-03 10:15:56 -0700 | [diff] [blame] | 346 | dir_pw_bytes, |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 347 | dir_pw_checksum, |
| 348 | dir_pw_log, |
| 349 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 350 | sources = [ "key_value_store_test.cc" ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 351 | } |
| 352 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 353 | pw_test("key_value_store_small_flash_test") { |
| 354 | deps = [ |
| 355 | ":fake_flash_small_partition", |
| 356 | ":key_value_store_initialized_test", |
| 357 | ] |
| 358 | } |
| 359 | |
| 360 | pw_test("key_value_store_64_alignment_flash_test") { |
| 361 | deps = [ |
| 362 | ":fake_flash_64_aligned_partition", |
| 363 | ":key_value_store_initialized_test", |
| 364 | ] |
| 365 | } |
| 366 | |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 367 | pw_test("key_value_store_fuzz_64_alignment_flash_test") { |
| 368 | deps = [ |
| 369 | ":fake_flash_64_aligned_partition", |
| 370 | ":key_value_store_fuzz_test", |
| 371 | ] |
| 372 | } |
| 373 | |
David Rogers | 6a262b4 | 2020-07-09 03:27:41 -0700 | [diff] [blame] | 374 | pw_test("key_value_store_256_alignment_flash_test") { |
| 375 | deps = [ |
| 376 | ":fake_flash_256_aligned_partition", |
| 377 | ":key_value_store_initialized_test", |
| 378 | ] |
| 379 | } |
| 380 | |
Wyatt Hepler | 8e94ed6 | 2020-03-05 16:45:32 -0800 | [diff] [blame] | 381 | pw_test("key_value_store_binary_format_test") { |
Wyatt Hepler | 118fc3c | 2020-02-21 14:23:19 -0800 | [diff] [blame] | 382 | deps = [ |
| 383 | ":crc16", |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 384 | ":fake_flash", |
Wyatt Hepler | 118fc3c | 2020-02-21 14:23:19 -0800 | [diff] [blame] | 385 | ":pw_kvs", |
Wyatt Hepler | 6b3a6c9 | 2020-08-03 10:15:56 -0700 | [diff] [blame] | 386 | dir_pw_bytes, |
Wyatt Hepler | 118fc3c | 2020-02-21 14:23:19 -0800 | [diff] [blame] | 387 | dir_pw_log, |
| 388 | ] |
Wyatt Hepler | 8e94ed6 | 2020-03-05 16:45:32 -0800 | [diff] [blame] | 389 | sources = [ "key_value_store_binary_format_test.cc" ] |
Wyatt Hepler | 118fc3c | 2020-02-21 14:23:19 -0800 | [diff] [blame] | 390 | } |
| 391 | |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 392 | pw_test("key_value_store_put_test") { |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 393 | deps = [ |
| 394 | ":crc16", |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 395 | ":fake_flash", |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 396 | ":pw_kvs", |
David Rogers | 5cc5ce8 | 2020-03-13 19:19:03 -0700 | [diff] [blame] | 397 | ":test_partition", |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 398 | ] |
David Rogers | 67cf06d | 2021-04-15 14:56:46 -0700 | [diff] [blame] | 399 | sources = [ "key_value_store_put_test.cc" ] |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 400 | } |
| 401 | |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 402 | pw_test("fake_flash_test_key_value_store_test") { |
| 403 | deps = [ |
| 404 | ":fake_flash_test_key_value_store", |
David Rogers | a5c39a5 | 2020-08-07 18:18:56 -0700 | [diff] [blame] | 405 | ":test_key_value_store_test", |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 406 | ] |
David Rogers | eaa2a69 | 2020-08-07 00:48:16 -0700 | [diff] [blame] | 407 | } |
| 408 | |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame] | 409 | pw_test("key_value_store_map_test") { |
| 410 | deps = [ |
| 411 | ":crc16", |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 412 | ":fake_flash", |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame] | 413 | ":pw_kvs", |
David Rogers | 5cc5ce8 | 2020-03-13 19:19:03 -0700 | [diff] [blame] | 414 | ":test_partition", |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame] | 415 | dir_pw_checksum, |
| 416 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 417 | sources = [ "key_value_store_map_test.cc" ] |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame] | 418 | } |
| 419 | |
Wyatt Hepler | c84393f | 2020-03-20 11:23:24 -0700 | [diff] [blame] | 420 | pw_test("sectors_test") { |
| 421 | deps = [ |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 422 | ":fake_flash", |
Wyatt Hepler | c84393f | 2020-03-20 11:23:24 -0700 | [diff] [blame] | 423 | ":pw_kvs", |
Wyatt Hepler | c84393f | 2020-03-20 11:23:24 -0700 | [diff] [blame] | 424 | ] |
| 425 | sources = [ "sectors_test.cc" ] |
| 426 | } |
| 427 | |
Rob Oliver | e64daf4 | 2020-11-24 11:50:03 -0500 | [diff] [blame] | 428 | pw_test("key_test") { |
| 429 | deps = [ ":pw_kvs" ] |
| 430 | sources = [ "key_test.cc" ] |
| 431 | } |
| 432 | |
David Rogers | d5138f3 | 2020-04-28 15:18:56 -0700 | [diff] [blame] | 433 | pw_test("key_value_store_wear_test") { |
Armando Montanez | f9e93e1 | 2020-04-22 07:44:14 -0700 | [diff] [blame] | 434 | deps = [ |
David Rogers | d64cc01 | 2020-05-26 12:37:37 -0700 | [diff] [blame] | 435 | ":fake_flash", |
Armando Montanez | f9e93e1 | 2020-04-22 07:44:14 -0700 | [diff] [blame] | 436 | ":pw_kvs", |
David Rogers | d5138f3 | 2020-04-28 15:18:56 -0700 | [diff] [blame] | 437 | ":test_partition", |
Armando Montanez | f9e93e1 | 2020-04-22 07:44:14 -0700 | [diff] [blame] | 438 | dir_pw_log, |
| 439 | ] |
| 440 | sources = [ "key_value_store_wear_test.cc" ] |
| 441 | } |
| 442 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 443 | pw_doc_group("docs") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 444 | sources = [ "docs.rst" ] |
David Rogers | a2c4d1d | 2021-01-15 03:17:28 -0800 | [diff] [blame] | 445 | report_deps = [ ":kvs_size" ] |
| 446 | } |
| 447 | |
| 448 | pw_size_report("kvs_size") { |
| 449 | title = "Pigweed KVS size report" |
| 450 | |
| 451 | # To see all the symbols, uncomment the following: |
| 452 | # Note: The size report RST table won't be generated when full_report = true. |
| 453 | # full_report = true |
| 454 | |
| 455 | binaries = [ |
| 456 | { |
| 457 | target = "size_report:with_kvs" |
| 458 | base = "size_report:base_with_only_flash" |
| 459 | label = "KeyValueStore" |
| 460 | }, |
| 461 | ] |
| 462 | |
| 463 | binaries += [ |
| 464 | { |
| 465 | target = "size_report:base_with_only_flash" |
| 466 | base = "size_report:base" |
| 467 | label = "FlashPartition" |
| 468 | }, |
| 469 | ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 470 | } |