blob: e94ebaa50a83dd89a0d8342d065ef20a82e16dd0 [file] [log] [blame]
Wyatt Hepler2ad60672020-01-21 08:00:16 -08001# 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 Montanezfb3d3fb2020-06-09 18:12:12 -070015import("//build_overrides/pigweed.gni")
16
David Rogersa2c4d1d2021-01-15 03:17:28 -080017import("$dir_pw_bloat/bloat.gni")
Wyatt Heplerae222dc2020-10-14 10:46:27 -070018import("$dir_pw_build/module_config.gni")
Alexei Frolovedd2f142020-06-09 19:11:27 -070019import("$dir_pw_build/target_types.gni")
Wyatt Hepler2ad60672020-01-21 08:00:16 -080020import("$dir_pw_docgen/docs.gni")
21import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070022
Wyatt Heplerae222dc2020-10-14 10:46:27 -070023declare_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
30config("public_include_path") {
Wyatt Hepler2ad60672020-01-21 08:00:16 -080031 include_dirs = [ "public" ]
Wyatt Heplerae222dc2020-10-14 10:46:27 -070032 visibility = [ ":*" ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -080033}
34
Alexei Frolovedd2f142020-06-09 19:11:27 -070035pw_source_set("pw_kvs") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -070036 public_configs = [ ":public_include_path" ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -080037 public = [
Wyatt Hepler1927c282020-02-11 16:45:02 -080038 "public/pw_kvs/alignment.h",
Wyatt Hepler4da1fcb2020-01-30 17:32:18 -080039 "public/pw_kvs/checksum.h",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080040 "public/pw_kvs/flash_memory.h",
David Rogers6a262b42020-07-09 03:27:41 -070041 "public/pw_kvs/flash_test_partition.h",
Wyatt Hepler88adfe82020-02-20 19:33:27 -080042 "public/pw_kvs/format.h",
Wyatt Hepler06b1b0b2020-03-09 08:26:34 -070043 "public/pw_kvs/io.h",
Rob Olivere64daf42020-11-24 11:50:03 -050044 "public/pw_kvs/key.h",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080045 "public/pw_kvs/key_value_store.h",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080046 ]
47 sources = [
Wyatt Hepler1927c282020-02-11 16:45:02 -080048 "alignment.cc",
Wyatt Hepler4da1fcb2020-01-30 17:32:18 -080049 "checksum.cc",
Wyatt Heplerd31d9702020-02-14 08:46:36 -080050 "entry.cc",
Wyatt Hepler7ded6da2020-03-11 18:24:43 -070051 "entry_cache.cc",
Wyatt Hepler4da1fcb2020-01-30 17:32:18 -080052 "flash_memory.cc",
Wyatt Hepler22d0d9f2020-03-05 14:57:11 -080053 "format.cc",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080054 "key_value_store.cc",
Wyatt Heplerbdd8e5a2020-02-20 19:27:26 -080055 "public/pw_kvs/internal/entry.h",
Wyatt Hepler7ded6da2020-03-11 18:24:43 -070056 "public/pw_kvs/internal/entry_cache.h",
Wyatt Hepler1fc11042020-02-19 17:17:51 -080057 "public/pw_kvs/internal/hash.h",
58 "public/pw_kvs/internal/key_descriptor.h",
Wyatt Hepler2454f2d2020-03-20 12:54:35 -070059 "public/pw_kvs/internal/sectors.h",
Keir Mierle0dd24a82020-02-21 16:08:59 -080060 "public/pw_kvs/internal/span_traits.h",
Wyatt Heplerc84393f2020-03-20 11:23:24 -070061 "sectors.cc",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080062 ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -080063 public_deps = [
David Rogers02892d22020-07-30 00:33:00 -070064 dir_pw_assert,
Rob Oliverf61adbd2020-12-09 13:46:46 -050065 dir_pw_bytes,
Wyatt Hepler1c329ca2020-02-07 18:07:23 -080066 dir_pw_containers,
Wyatt Heplerad684a12020-02-04 17:17:29 -080067 dir_pw_status,
Rob Oliverf61adbd2020-12-09 13:46:46 -050068 dir_pw_string,
Wyatt Hepler2ad60672020-01-21 08:00:16 -080069 ]
70 deps = [
Wyatt Heplerae222dc2020-10-14 10:46:27 -070071 ":config",
Wyatt Hepler2ad60672020-01-21 08:00:16 -080072 dir_pw_checksum,
73 dir_pw_log,
Wyatt Hepler2ad60672020-01-21 08:00:16 -080074 ]
Wyatt Heplera8557ef2020-05-04 16:29:23 -070075 friend = [ ":*" ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -080076}
77
Wyatt Heplerae222dc2020-10-14 10:46:27 -070078pw_source_set("config") {
79 public_deps = [ pw_kvs_CONFIG ]
80 public = [ "pw_kvs_private/config.h" ]
81 visibility = [ ":*" ]
82}
83
Alexei Frolovedd2f142020-06-09 19:11:27 -070084pw_source_set("crc16") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080085 public = [ "public/pw_kvs/crc16_checksum.h" ]
Wyatt Heplerec4b9352020-01-31 15:51:50 -080086 public_deps = [
87 ":pw_kvs",
88 dir_pw_checksum,
89 ]
90}
91
David Rogersa5c39a52020-08-07 18:18:56 -070092pw_source_set("flash_test_partition") {
93 public = [ "public/pw_kvs/flash_test_partition.h" ]
94 public_deps = [ ":pw_kvs" ]
95}
96
97pw_source_set("test_key_value_store") {
98 public = [ "public/pw_kvs/test_key_value_store.h" ]
99 public_deps = [ ":pw_kvs" ]
100}
101
Alexei Frolovedd2f142020-06-09 19:11:27 -0700102pw_source_set("fake_flash") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700103 public_configs = [ ":public_include_path" ]
David Rogersd64cc012020-05-26 12:37:37 -0700104 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 Rogersd64cc012020-05-26 12:37:37 -0700109 dir_pw_status,
110 ]
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700111 deps = [
112 ":config",
113 dir_pw_log,
114 ]
David Rogersd64cc012020-05-26 12:37:37 -0700115}
116
David Rogers6a262b42020-07-09 03:27:41 -0700117pw_source_set("fake_flash_small_partition") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700118 public_configs = [ ":public_include_path" ]
David Rogers6a262b42020-07-09 03:27:41 -0700119 public = [ "public/pw_kvs/flash_test_partition.h" ]
120 sources = [ "fake_flash_test_partition.cc" ]
David Rogersa5c39a52020-08-07 18:18:56 -0700121 public_deps = [ ":flash_test_partition" ]
David Rogers6a262b42020-07-09 03:27:41 -0700122 deps = [
123 ":fake_flash",
124 dir_pw_kvs,
125 ]
126}
127
David Rogersa2c4d1d2021-01-15 03:17:28 -0800128pw_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 Rogers6a262b42020-07-09 03:27:41 -0700144pw_source_set("fake_flash_64_aligned_partition") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700145 public_configs = [ ":public_include_path" ]
David Rogers6a262b42020-07-09 03:27:41 -0700146 public = [ "public/pw_kvs/flash_test_partition.h" ]
147 sources = [ "fake_flash_test_partition.cc" ]
David Rogersa5c39a52020-08-07 18:18:56 -0700148 public_deps = [ ":flash_test_partition" ]
David Rogers6a262b42020-07-09 03:27:41 -0700149 deps = [
150 ":fake_flash",
151 dir_pw_kvs,
152 ]
153 defines = [ "PW_FLASH_TEST_ALIGNMENT=64" ]
154}
155
156pw_source_set("fake_flash_256_aligned_partition") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700157 public_configs = [ ":public_include_path" ]
David Rogers6a262b42020-07-09 03:27:41 -0700158 public = [ "public/pw_kvs/flash_test_partition.h" ]
159 sources = [ "fake_flash_test_partition.cc" ]
David Rogersa5c39a52020-08-07 18:18:56 -0700160 public_deps = [ ":flash_test_partition" ]
David Rogers6a262b42020-07-09 03:27:41 -0700161 deps = [
162 ":fake_flash",
163 dir_pw_kvs,
164 ]
165 defines = [ "PW_FLASH_TEST_ALIGNMENT=256" ]
166}
167
David Rogerseaa2a692020-08-07 00:48:16 -0700168pw_source_set("fake_flash_test_key_value_store") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700169 public_configs = [ ":public_include_path" ]
David Rogerseaa2a692020-08-07 00:48:16 -0700170 sources = [ "fake_flash_test_key_value_store.cc" ]
David Rogersa5c39a52020-08-07 18:18:56 -0700171 public_deps = [ ":test_key_value_store" ]
David Rogerseaa2a692020-08-07 00:48:16 -0700172 deps = [
173 ":crc16",
174 ":fake_flash",
175 dir_pw_kvs,
176 ]
177}
178
David Rogers6a262b42020-07-09 03:27:41 -0700179pw_source_set("flash_partition_test_100_iterations") {
David Rogersca592962020-07-01 09:21:54 -0700180 deps = [
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700181 ":config",
David Rogersa5c39a52020-08-07 18:18:56 -0700182 ":flash_test_partition",
David Rogersca592962020-07-01 09:21:54 -0700183 dir_pw_kvs,
184 dir_pw_log,
David Rogersca592962020-07-01 09:21:54 -0700185 dir_pw_unit_test,
186 ]
David Rogers6a262b42020-07-09 03:27:41 -0700187 sources = [ "flash_partition_test.cc" ]
188 defines = [ "PW_FLASH_TEST_ITERATIONS=100" ]
189}
190
191pw_source_set("flash_partition_test_2_iterations") {
192 deps = [
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700193 ":config",
David Rogersa5c39a52020-08-07 18:18:56 -0700194 ":flash_test_partition",
David Rogers6a262b42020-07-09 03:27:41 -0700195 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
203pw_source_set("key_value_store_initialized_test") {
204 deps = [
205 ":crc16",
David Rogersa5c39a52020-08-07 18:18:56 -0700206 ":flash_test_partition",
David Rogers6a262b42020-07-09 03:27:41 -0700207 ":pw_kvs",
Wyatt Hepler6b3a6c92020-08-03 10:15:56 -0700208 dir_pw_bytes,
David Rogers6a262b42020-07-09 03:27:41 -0700209 dir_pw_checksum,
210 dir_pw_log,
211 dir_pw_unit_test,
212 ]
213 sources = [ "key_value_store_initialized_test.cc" ]
David Rogersca592962020-07-01 09:21:54 -0700214}
215
David Rogers67cf06d2021-04-15 14:56:46 -0700216pw_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 Rogersa5c39a52020-08-07 18:18:56 -0700229pw_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 Frolovedd2f142020-06-09 19:11:27 -0700238pw_source_set("test_partition") {
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700239 public_configs = [ ":public_include_path" ]
David Rogers5cc5ce82020-03-13 19:19:03 -0700240 public = [ "public/pw_kvs/flash_partition_with_stats.h" ]
Wyatt Heplera8557ef2020-05-04 16:29:23 -0700241 sources = [ "flash_partition_with_stats.cc" ]
David Rogers5cc5ce82020-03-13 19:19:03 -0700242 visibility = [ ":*" ]
243 public_deps = [
244 dir_pw_kvs,
245 dir_pw_log,
246 dir_pw_status,
247 ]
Wyatt Heplerae222dc2020-10-14 10:46:27 -0700248 deps = [ ":config" ]
David Rogers5cc5ce82020-03-13 19:19:03 -0700249}
250
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800251pw_test_group("tests") {
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800252 tests = [
Wyatt Hepler1927c282020-02-11 16:45:02 -0800253 ":alignment_test",
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800254 ":checksum_test",
Wyatt Hepler2debeb62020-12-03 08:19:57 -0800255 ":converts_to_span_test",
Wyatt Hepler97fc7942020-02-06 15:55:45 -0800256 ":entry_test",
Wyatt Hepler7ded6da2020-03-11 18:24:43 -0700257 ":entry_cache_test",
David Rogers6a262b42020-07-09 03:27:41 -0700258 ":flash_partition_small_test",
259 ":flash_partition_64_alignment_test",
260 ":flash_partition_256_alignment_test",
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800261 ":key_value_store_test",
David Rogers6a262b42020-07-09 03:27:41 -0700262 ":key_value_store_small_flash_test",
263 ":key_value_store_64_alignment_flash_test",
David Rogers67cf06d2021-04-15 14:56:46 -0700264 ":key_value_store_fuzz_64_alignment_flash_test",
David Rogers6a262b42020-07-09 03:27:41 -0700265 ":key_value_store_256_alignment_flash_test",
Wyatt Hepler8e94ed62020-03-05 16:45:32 -0800266 ":key_value_store_binary_format_test",
David Rogers67cf06d2021-04-15 14:56:46 -0700267 ":key_value_store_put_test",
Wyatt Hepler495b6ee2020-02-12 18:58:01 -0800268 ":key_value_store_map_test",
David Rogerseaa2a692020-08-07 00:48:16 -0700269 ":fake_flash_test_key_value_store_test",
Wyatt Heplerc84393f2020-03-20 11:23:24 -0700270 ":sectors_test",
Rob Olivere64daf42020-11-24 11:50:03 -0500271 ":key_test",
David Rogersd5138f32020-04-28 15:18:56 -0700272 ":key_value_store_wear_test",
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800273 ]
274}
275
Wyatt Hepler1927c282020-02-11 16:45:02 -0800276pw_test("alignment_test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800277 deps = [ ":pw_kvs" ]
278 sources = [ "alignment_test.cc" ]
Wyatt Hepler1927c282020-02-11 16:45:02 -0800279}
280
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800281pw_test("checksum_test") {
282 deps = [
283 ":crc16",
284 ":pw_kvs",
285 dir_pw_log,
286 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800287 sources = [ "checksum_test.cc" ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800288}
289
Wyatt Hepler2debeb62020-12-03 08:19:57 -0800290pw_test("converts_to_span_test") {
291 deps = [ ":pw_kvs" ]
292 sources = [ "converts_to_span_test.cc" ]
293}
294
Wyatt Hepler97fc7942020-02-06 15:55:45 -0800295pw_test("entry_test") {
296 deps = [
Wyatt Heplercdd6dfc2020-02-18 12:04:04 -0800297 ":crc16",
David Rogersd64cc012020-05-26 12:37:37 -0700298 ":fake_flash",
Wyatt Hepler97fc7942020-02-06 15:55:45 -0800299 ":pw_kvs",
Wyatt Hepler6b3a6c92020-08-03 10:15:56 -0700300 dir_pw_bytes,
Wyatt Hepler97fc7942020-02-06 15:55:45 -0800301 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800302 sources = [ "entry_test.cc" ]
Wyatt Hepler97fc7942020-02-06 15:55:45 -0800303}
304
Wyatt Hepler7ded6da2020-03-11 18:24:43 -0700305pw_test("entry_cache_test") {
Wyatt Hepler02946272020-03-18 10:36:22 -0700306 deps = [
David Rogersd64cc012020-05-26 12:37:37 -0700307 ":fake_flash",
Wyatt Hepler02946272020-03-18 10:36:22 -0700308 ":pw_kvs",
Wyatt Hepler6b3a6c92020-08-03 10:15:56 -0700309 dir_pw_bytes,
Wyatt Hepler02946272020-03-18 10:36:22 -0700310 ]
Wyatt Hepler7ded6da2020-03-11 18:24:43 -0700311 sources = [ "entry_cache_test.cc" ]
312}
313
David Rogers6a262b42020-07-09 03:27:41 -0700314pw_test("flash_partition_small_test") {
David Rogersca592962020-07-01 09:21:54 -0700315 deps = [
316 ":fake_flash",
David Rogers6a262b42020-07-09 03:27:41 -0700317 ":fake_flash_small_partition",
318 ":flash_partition_test_100_iterations",
David Rogersca592962020-07-01 09:21:54 -0700319 dir_pw_log,
320 ]
David Rogers6a262b42020-07-09 03:27:41 -0700321}
322
323pw_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
332pw_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 Rogersca592962020-07-01 09:21:54 -0700339}
340
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800341pw_test("key_value_store_test") {
342 deps = [
Wyatt Heplerec4b9352020-01-31 15:51:50 -0800343 ":crc16",
David Rogersd64cc012020-05-26 12:37:37 -0700344 ":fake_flash",
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800345 ":pw_kvs",
Wyatt Hepler6b3a6c92020-08-03 10:15:56 -0700346 dir_pw_bytes,
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800347 dir_pw_checksum,
348 dir_pw_log,
349 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800350 sources = [ "key_value_store_test.cc" ]
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800351}
352
David Rogers6a262b42020-07-09 03:27:41 -0700353pw_test("key_value_store_small_flash_test") {
354 deps = [
355 ":fake_flash_small_partition",
356 ":key_value_store_initialized_test",
357 ]
358}
359
360pw_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 Rogers67cf06d2021-04-15 14:56:46 -0700367pw_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 Rogers6a262b42020-07-09 03:27:41 -0700374pw_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 Hepler8e94ed62020-03-05 16:45:32 -0800381pw_test("key_value_store_binary_format_test") {
Wyatt Hepler118fc3c2020-02-21 14:23:19 -0800382 deps = [
383 ":crc16",
David Rogersd64cc012020-05-26 12:37:37 -0700384 ":fake_flash",
Wyatt Hepler118fc3c2020-02-21 14:23:19 -0800385 ":pw_kvs",
Wyatt Hepler6b3a6c92020-08-03 10:15:56 -0700386 dir_pw_bytes,
Wyatt Hepler118fc3c2020-02-21 14:23:19 -0800387 dir_pw_log,
388 ]
Wyatt Hepler8e94ed62020-03-05 16:45:32 -0800389 sources = [ "key_value_store_binary_format_test.cc" ]
Wyatt Hepler118fc3c2020-02-21 14:23:19 -0800390}
391
David Rogers67cf06d2021-04-15 14:56:46 -0700392pw_test("key_value_store_put_test") {
Wyatt Hepler16b04522020-02-07 16:00:14 -0800393 deps = [
394 ":crc16",
David Rogersd64cc012020-05-26 12:37:37 -0700395 ":fake_flash",
Wyatt Hepler16b04522020-02-07 16:00:14 -0800396 ":pw_kvs",
David Rogers5cc5ce82020-03-13 19:19:03 -0700397 ":test_partition",
Wyatt Hepler16b04522020-02-07 16:00:14 -0800398 ]
David Rogers67cf06d2021-04-15 14:56:46 -0700399 sources = [ "key_value_store_put_test.cc" ]
Wyatt Hepler16b04522020-02-07 16:00:14 -0800400}
401
David Rogerseaa2a692020-08-07 00:48:16 -0700402pw_test("fake_flash_test_key_value_store_test") {
403 deps = [
404 ":fake_flash_test_key_value_store",
David Rogersa5c39a52020-08-07 18:18:56 -0700405 ":test_key_value_store_test",
David Rogerseaa2a692020-08-07 00:48:16 -0700406 ]
David Rogerseaa2a692020-08-07 00:48:16 -0700407}
408
Wyatt Hepler495b6ee2020-02-12 18:58:01 -0800409pw_test("key_value_store_map_test") {
410 deps = [
411 ":crc16",
David Rogersd64cc012020-05-26 12:37:37 -0700412 ":fake_flash",
Wyatt Hepler495b6ee2020-02-12 18:58:01 -0800413 ":pw_kvs",
David Rogers5cc5ce82020-03-13 19:19:03 -0700414 ":test_partition",
Wyatt Hepler495b6ee2020-02-12 18:58:01 -0800415 dir_pw_checksum,
416 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -0800417 sources = [ "key_value_store_map_test.cc" ]
Wyatt Hepler495b6ee2020-02-12 18:58:01 -0800418}
419
Wyatt Heplerc84393f2020-03-20 11:23:24 -0700420pw_test("sectors_test") {
421 deps = [
David Rogersd64cc012020-05-26 12:37:37 -0700422 ":fake_flash",
Wyatt Heplerc84393f2020-03-20 11:23:24 -0700423 ":pw_kvs",
Wyatt Heplerc84393f2020-03-20 11:23:24 -0700424 ]
425 sources = [ "sectors_test.cc" ]
426}
427
Rob Olivere64daf42020-11-24 11:50:03 -0500428pw_test("key_test") {
429 deps = [ ":pw_kvs" ]
430 sources = [ "key_test.cc" ]
431}
432
David Rogersd5138f32020-04-28 15:18:56 -0700433pw_test("key_value_store_wear_test") {
Armando Montanezf9e93e12020-04-22 07:44:14 -0700434 deps = [
David Rogersd64cc012020-05-26 12:37:37 -0700435 ":fake_flash",
Armando Montanezf9e93e12020-04-22 07:44:14 -0700436 ":pw_kvs",
David Rogersd5138f32020-04-28 15:18:56 -0700437 ":test_partition",
Armando Montanezf9e93e12020-04-22 07:44:14 -0700438 dir_pw_log,
439 ]
440 sources = [ "key_value_store_wear_test.cc" ]
441}
442
Wyatt Hepler2ad60672020-01-21 08:00:16 -0800443pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800444 sources = [ "docs.rst" ]
David Rogersa2c4d1d2021-01-15 03:17:28 -0800445 report_deps = [ ":kvs_size" ]
446}
447
448pw_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 Hepler2ad60672020-01-21 08:00:16 -0800470}