xref: /aosp_15_r20/external/pigweed/pw_kvs/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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
15load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
16load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22cc_library(
23    name = "pw_kvs",
24    srcs = [
25        "alignment.cc",
26        "checksum.cc",
27        "entry.cc",
28        "entry_cache.cc",
29        "flash_memory.cc",
30        "format.cc",
31        "key_value_store.cc",
32        "pw_kvs_private/config.h",
33        "sectors.cc",
34    ],
35    hdrs = [
36        "public/pw_kvs/alignment.h",
37        "public/pw_kvs/checksum.h",
38        "public/pw_kvs/crc16_checksum.h",
39        "public/pw_kvs/flash_memory.h",
40        "public/pw_kvs/format.h",
41        "public/pw_kvs/internal/entry.h",
42        "public/pw_kvs/internal/entry_cache.h",
43        "public/pw_kvs/internal/hash.h",
44        "public/pw_kvs/internal/key_descriptor.h",
45        "public/pw_kvs/internal/sectors.h",
46        "public/pw_kvs/internal/span_traits.h",
47        "public/pw_kvs/io.h",
48        "public/pw_kvs/key_value_store.h",
49    ],
50    strip_include_prefix = "public",
51    deps = [
52        ":config_override",
53        "//pw_assert",
54        "//pw_bytes",
55        "//pw_bytes:alignment",
56        "//pw_checksum",
57        "//pw_containers",
58        "//pw_log",
59        "//pw_log:pw_log.facade",
60        "//pw_polyfill",
61        "//pw_span",
62        "//pw_status",
63        "//pw_stream",
64    ],
65)
66
67label_flag(
68    name = "config_override",
69    build_setting_default = "//pw_build:default_module_config",
70)
71
72cc_library(
73    name = "crc16",
74    hdrs = [
75        "public/pw_kvs/crc16_checksum.h",
76    ],
77    deps = [
78        ":pw_kvs",
79        "//pw_checksum",
80        "//pw_span",
81    ],
82)
83
84cc_library(
85    name = "flash_test_partition",
86    hdrs = ["public/pw_kvs/flash_test_partition.h"],
87    strip_include_prefix = "public",
88    deps = [":pw_kvs"],
89)
90
91cc_library(
92    name = "test_key_value_store",
93    hdrs = ["public/pw_kvs/test_key_value_store.h"],
94    strip_include_prefix = "public",
95    deps = [
96        ":pw_kvs",
97        "//pw_sync:borrow",
98    ],
99)
100
101cc_library(
102    name = "fake_flash",
103    srcs = [
104        "fake_flash_memory.cc",
105    ],
106    hdrs = [
107        "public/pw_kvs/fake_flash_memory.h",
108    ],
109    strip_include_prefix = "public",
110    deps = [
111        ":pw_kvs",
112        "//pw_containers",
113        "//pw_log",
114        "//pw_log:pw_log.facade",
115        "//pw_span",
116        "//pw_status",
117    ],
118)
119
120cc_library(
121    name = "flash_partition_with_logical_sectors",
122    hdrs = [
123        "public/pw_kvs/flash_partition_with_logical_sectors.h",
124    ],
125    strip_include_prefix = "public",
126    deps = [
127        ":pw_kvs",
128    ],
129)
130
131cc_library(
132    name = "fake_flash_1_aligned_partition",
133    srcs = [
134        "fake_flash_test_partition.cc",
135    ],
136    hdrs = [
137        "public/pw_kvs/flash_test_partition.h",
138    ],
139    defines = [
140        "PW_FLASH_TEST_SECTORS=6U",
141        "PW_FLASH_TEST_SECTOR_SIZE=4096U",
142        "PW_FLASH_TEST_ALIGNMENT=1U",
143    ],
144    strip_include_prefix = "public",
145    deps = [
146        ":fake_flash",
147        ":pw_kvs",
148    ],
149)
150
151cc_library(
152    name = "fake_flash_1_aligned_4_logical_partition",
153    srcs = [
154        "fake_flash_test_logical_sector_partition.cc",
155    ],
156    hdrs = [
157        "public/pw_kvs/flash_test_partition.h",
158    ],
159    defines = [
160        "PW_FLASH_TEST_SECTORS=24U",
161        "PW_FLASH_TEST_SECTOR_SIZE=4096U",
162        "PW_FLASH_TEST_ALIGNMENT=1U",
163        "PW_FLASH_TEST_SECTORS_PER_LOGICAL_SECTOR=4U",
164    ],
165    strip_include_prefix = "public",
166    deps = [
167        ":fake_flash",
168        ":flash_partition_with_logical_sectors",
169        ":pw_kvs",
170    ],
171)
172
173cc_library(
174    name = "fake_flash_12_byte_partition",
175    srcs = ["fake_flash_test_partition.cc"],
176    hdrs = ["public/pw_kvs/flash_test_partition.h"],
177    defines = [
178        "PW_FLASH_TEST_SECTORS=3",
179        "PW_FLASH_TEST_SECTOR_SIZE=4",
180        "PW_FLASH_TEST_ALIGNMENT=4",
181    ],
182    strip_include_prefix = "public",
183    deps = [
184        ":fake_flash",
185        ":flash_test_partition",
186        ":pw_kvs",
187    ],
188)
189
190cc_library(
191    name = "fake_flash_16_aligned_partition",
192    srcs = [
193        "fake_flash_test_partition.cc",
194    ],
195    hdrs = [
196        "public/pw_kvs/flash_test_partition.h",
197    ],
198    defines = [
199        "PW_FLASH_TEST_SECTORS=6U",
200        "PW_FLASH_TEST_SECTOR_SIZE=4096U",
201        "PW_FLASH_TEST_ALIGNMENT=16",
202    ],
203    strip_include_prefix = "public",
204    deps = [
205        ":fake_flash",
206        ":pw_kvs",
207    ],
208)
209
210cc_library(
211    name = "fake_flash_64_aligned_partition",
212    srcs = [
213        "fake_flash_test_partition.cc",
214    ],
215    hdrs = [
216        "public/pw_kvs/flash_test_partition.h",
217    ],
218    defines = [
219        "PW_FLASH_TEST_SECTORS=6U",
220        "PW_FLASH_TEST_SECTOR_SIZE=4096U",
221        "PW_FLASH_TEST_ALIGNMENT=64U",
222    ],
223    strip_include_prefix = "public",
224    deps = [
225        ":fake_flash",
226        ":pw_kvs",
227    ],
228)
229
230cc_library(
231    name = "fake_flash_256_aligned_partition",
232    srcs = [
233        "fake_flash_test_partition.cc",
234    ],
235    hdrs = [
236        "public/pw_kvs/flash_test_partition.h",
237    ],
238    defines = [
239        "PW_FLASH_TEST_SECTORS=6U",
240        "PW_FLASH_TEST_SECTOR_SIZE=4096U",
241        "PW_FLASH_TEST_ALIGNMENT=256U",
242    ],
243    strip_include_prefix = "public",
244    deps = [
245        ":fake_flash",
246        ":pw_kvs",
247    ],
248)
249
250cc_library(
251    name = "fake_flash_test_key_value_store",
252    srcs = [
253        "fake_flash_test_key_value_store.cc",
254    ],
255    hdrs = [
256        "public/pw_kvs/test_key_value_store.h",
257    ],
258    strip_include_prefix = "public",
259    deps = [
260        ":crc16",
261        ":fake_flash",
262        ":pw_kvs",
263        "//pw_sync:borrow",
264    ],
265)
266
267cc_library(
268    name = "test_partition",
269    srcs = [
270        "flash_partition_with_stats.cc",
271    ],
272    hdrs = [
273        "public/pw_kvs/flash_partition_with_stats.h",
274    ],
275    strip_include_prefix = "public",
276    target_compatible_with = incompatible_with_mcu(),
277    visibility = ["//visibility:private"],
278    deps = [
279        "//pw_containers",
280        "//pw_kvs",
281        "//pw_log",
282        "//pw_log:pw_log.facade",
283        "//pw_status",
284    ],
285)
286
287pw_cc_test(
288    name = "alignment_test",
289    srcs = [
290        "alignment_test.cc",
291    ],
292    deps = [
293        ":pw_kvs",
294        "//pw_status",
295        "//pw_unit_test",
296    ],
297)
298
299pw_cc_test(
300    name = "checksum_test",
301    srcs = ["checksum_test.cc"],
302    deps = [
303        ":crc16",
304        ":pw_kvs",
305        "//pw_checksum",
306        "//pw_log",
307        "//pw_unit_test",
308    ],
309)
310
311pw_cc_test(
312    name = "converts_to_span_test",
313    srcs = ["converts_to_span_test.cc"],
314    deps = [":pw_kvs"],
315)
316
317pw_cc_test(
318    name = "entry_test",
319    srcs = [
320        "entry_test.cc",
321    ],
322    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
323    # use features such as std::map and are computationally expensive. Solving
324    # this requires a more complex capabilities-based build and configuration
325    # system which allowing enabling specific tests for targets that support
326    # them and modifying test parameters for different targets.
327    target_compatible_with = incompatible_with_mcu(),
328    deps = [
329        ":fake_flash",
330        ":pw_kvs",
331        "//pw_log",
332        "//pw_span",
333        "//pw_unit_test",
334    ],
335)
336
337pw_cc_test(
338    name = "entry_cache_test",
339    srcs = ["entry_cache_test.cc"],
340    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
341    # use features such as std::map and are computationally expensive. Solving
342    # this requires a more complex capabilities-based build and configuration
343    # system which allowing enabling specific tests for targets that support
344    # them and modifying test parameters for different targets.
345    target_compatible_with = incompatible_with_mcu(),
346    deps = [
347        ":fake_flash",
348        ":pw_kvs",
349        "//pw_log",
350        "//pw_unit_test",
351    ],
352)
353
354pw_cc_test(
355    name = "flash_partition_stream_test",
356    srcs = ["flash_partition_stream_test.cc"],
357    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
358    # use features such as std::map and are computationally expensive. Solving
359    # this requires a more complex capabilities-based build and configuration
360    # system which allowing enabling specific tests for targets that support
361    # them and modifying test parameters for different targets.
362    target_compatible_with = incompatible_with_mcu(),
363    deps = [
364        ":fake_flash",
365        ":pw_kvs",
366        "//pw_log",
367        "//pw_random",
368        "//pw_unit_test",
369    ],
370)
371
372cc_library(
373    name = "flash_partition_test_100_iterations",
374    testonly = True,
375    srcs = ["flash_partition_test.cc"],
376    defines = [
377        "PW_FLASH_TEST_ITERATIONS=100",
378        "PW_FLASH_TEST_WRITE_SIZE=1",
379    ],
380    deps = [
381        ":flash_test_partition",
382        ":pw_kvs",
383        "//pw_log",
384        "//pw_unit_test",
385    ],
386)
387
388cc_library(
389    name = "flash_partition_test_2_iterations",
390    testonly = True,
391    srcs = ["flash_partition_test.cc"],
392    defines = [
393        "PW_FLASH_TEST_ITERATIONS=2",
394        "PW_FLASH_TEST_WRITE_SIZE=1",
395    ],
396    deps = [
397        ":flash_test_partition",
398        ":pw_kvs",
399        "//pw_log",
400        "//pw_unit_test",
401    ],
402)
403
404cc_library(
405    name = "flash_partition_test_100_iterations_256_write",
406    testonly = True,
407    srcs = ["flash_partition_test.cc"],
408    defines = [
409        "PW_FLASH_TEST_ITERATIONS=100",
410        "PW_FLASH_TEST_WRITE_SIZE=256",
411    ],
412    deps = [
413        ":flash_test_partition",
414        ":pw_kvs",
415        "//pw_log",
416        "//pw_unit_test",
417    ],
418)
419
420cc_library(
421    name = "flash_partition_test_2_iterations_256_write",
422    testonly = True,
423    srcs = ["flash_partition_test.cc"],
424    defines = [
425        "PW_FLASH_TEST_ITERATIONS=2",
426        "PW_FLASH_TEST_WRITE_SIZE=256",
427    ],
428    deps = [
429        ":flash_test_partition",
430        ":pw_kvs",
431        "//pw_log",
432        "//pw_unit_test",
433    ],
434)
435
436cc_library(
437    name = "key_value_store_initialized_test",
438    testonly = True,
439    srcs = ["key_value_store_initialized_test.cc"],
440    deps = [
441        ":crc16",
442        ":flash_test_partition",
443        ":pw_kvs",
444        "//pw_bytes",
445        "//pw_checksum",
446        "//pw_log",
447        "//pw_string:builder",
448        "//pw_unit_test",
449    ],
450)
451
452pw_cc_test(
453    name = "flash_partition_1_alignment_test",
454    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
455    # use features such as std::map and are computationally expensive. Solving
456    # this requires a more complex capabilities-based build and configuration
457    # system which allowing enabling specific tests for targets that support
458    # them and modifying test parameters for different targets.
459    target_compatible_with = incompatible_with_mcu(),
460    deps = [
461        ":fake_flash_1_aligned_partition",
462        ":flash_partition_test_100_iterations",
463        ":pw_kvs",
464        "//pw_log",
465        "//pw_unit_test",
466    ],
467)
468
469pw_cc_test(
470    name = "flash_partition_1_alignment_4_logical_test",
471    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
472    # use features such as std::map and are computationally expensive. Solving
473    # this requires a more complex capabilities-based build and configuration
474    # system which allowing enabling specific tests for targets that support
475    # them and modifying test parameters for different targets.
476    target_compatible_with = incompatible_with_mcu(),
477    deps = [
478        ":fake_flash_1_aligned_4_logical_partition",
479        ":flash_partition_test_2_iterations",
480        ":pw_kvs",
481        "//pw_log",
482        "//pw_unit_test",
483    ],
484)
485
486pw_cc_test(
487    name = "flash_partition_16_alignment_test",
488    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
489    # use features such as std::map and are computationally expensive. Solving
490    # this requires a more complex capabilities-based build and configuration
491    # system which allowing enabling specific tests for targets that support
492    # them and modifying test parameters for different targets.
493    target_compatible_with = incompatible_with_mcu(),
494    deps = [
495        ":fake_flash_16_aligned_partition",
496        ":flash_partition_test_100_iterations",
497        ":pw_kvs",
498        "//pw_log",
499        "//pw_unit_test",
500    ],
501)
502
503pw_cc_test(
504    name = "flash_partition_64_alignment_test",
505    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
506    # use features such as std::map and are computationally expensive. Solving
507    # this requires a more complex capabilities-based build and configuration
508    # system which allowing enabling specific tests for targets that support
509    # them and modifying test parameters for different targets.
510    target_compatible_with = incompatible_with_mcu(),
511    deps = [
512        ":fake_flash_64_aligned_partition",
513        ":flash_partition_test_100_iterations",
514        ":pw_kvs",
515        "//pw_log",
516        "//pw_unit_test",
517    ],
518)
519
520pw_cc_test(
521    name = "flash_partition_256_alignment_test",
522    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
523    # use features such as std::map and are computationally expensive. Solving
524    # this requires a more complex capabilities-based build and configuration
525    # system which allowing enabling specific tests for targets that support
526    # them and modifying test parameters for different targets.
527    target_compatible_with = incompatible_with_mcu(),
528    deps = [
529        ":fake_flash_256_aligned_partition",
530        ":flash_partition_test_100_iterations",
531        ":pw_kvs",
532        "//pw_log",
533        "//pw_unit_test",
534    ],
535)
536
537pw_cc_test(
538    name = "flash_partition_256_write_size_test",
539    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
540    # use features such as std::map and are computationally expensive. Solving
541    # this requires a more complex capabilities-based build and configuration
542    # system which allowing enabling specific tests for targets that support
543    # them and modifying test parameters for different targets.
544    target_compatible_with = incompatible_with_mcu(),
545    deps = [
546        ":fake_flash_1_aligned_partition",
547        ":flash_partition_test_100_iterations_256_write",
548        ":pw_kvs",
549        "//pw_log",
550        "//pw_unit_test",
551    ],
552)
553
554pw_cc_test(
555    name = "flash_partition_4_logical_256_write_size_test",
556    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
557    # use features such as std::map and are computationally expensive. Solving
558    # this requires a more complex capabilities-based build and configuration
559    # system which allowing enabling specific tests for targets that support
560    # them and modifying test parameters for different targets.
561    target_compatible_with = incompatible_with_mcu(),
562    deps = [
563        ":fake_flash_1_aligned_4_logical_partition",
564        ":flash_partition_test_2_iterations_256_write",
565        ":pw_kvs",
566        "//pw_log",
567        "//pw_unit_test",
568    ],
569)
570
571pw_cc_test(
572    name = "key_value_store_test",
573    srcs = ["key_value_store_test.cc"],
574    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
575    # use features such as std::map and are computationally expensive. Solving
576    # this requires a more complex capabilities-based build and configuration
577    # system which allowing enabling specific tests for targets that support
578    # them and modifying test parameters for different targets.
579    target_compatible_with = incompatible_with_mcu(),
580    deps = [
581        ":crc16",
582        ":fake_flash",
583        ":pw_kvs",
584        "//pw_checksum",
585        "//pw_log",
586        "//pw_log:pw_log.facade",
587        "//pw_span",
588        "//pw_status",
589        "//pw_string:builder",
590        "//pw_unit_test",
591    ],
592)
593
594pw_cc_test(
595    name = "key_value_store_1_alignment_flash_test",
596    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
597    # use features such as std::map and are computationally expensive. Solving
598    # this requires a more complex capabilities-based build and configuration
599    # system which allowing enabling specific tests for targets that support
600    # them and modifying test parameters for different targets.
601    target_compatible_with = incompatible_with_mcu(),
602    deps = [
603        ":crc16",
604        ":fake_flash_1_aligned_partition",
605        ":key_value_store_initialized_test",
606        ":pw_kvs",
607        "//pw_checksum",
608        "//pw_log",
609        "//pw_log:pw_log.facade",
610        "//pw_span",
611        "//pw_status",
612        "//pw_string:builder",
613        "//pw_unit_test",
614    ],
615)
616
617pw_cc_test(
618    name = "key_value_store_1_alignment_4_logical_flash_test",
619    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
620    # use features such as std::map and are computationally expensive. Solving
621    # this requires a more complex capabilities-based build and configuration
622    # system which allowing enabling specific tests for targets that support
623    # them and modifying test parameters for different targets.
624    target_compatible_with = incompatible_with_mcu(),
625    deps = [
626        ":crc16",
627        ":fake_flash_1_aligned_4_logical_partition",
628        ":key_value_store_initialized_test",
629        ":pw_kvs",
630        "//pw_checksum",
631        "//pw_log",
632        "//pw_log:pw_log.facade",
633        "//pw_span",
634        "//pw_status",
635        "//pw_string:builder",
636        "//pw_unit_test",
637    ],
638)
639
640pw_cc_test(
641    name = "key_value_store_16_alignment_flash_test",
642    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
643    # use features such as std::map and are computationally expensive. Solving
644    # this requires a more complex capabilities-based build and configuration
645    # system which allowing enabling specific tests for targets that support
646    # them and modifying test parameters for different targets.
647    target_compatible_with = incompatible_with_mcu(),
648    deps = [
649        ":crc16",
650        ":fake_flash_16_aligned_partition",
651        ":key_value_store_initialized_test",
652        ":pw_kvs",
653        "//pw_checksum",
654        "//pw_log",
655        "//pw_log:pw_log.facade",
656        "//pw_span",
657        "//pw_status",
658        "//pw_string:builder",
659        "//pw_unit_test",
660    ],
661)
662
663pw_cc_test(
664    name = "key_value_store_64_alignment_flash_test",
665    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
666    # use features such as std::map and are computationally expensive. Solving
667    # this requires a more complex capabilities-based build and configuration
668    # system which allowing enabling specific tests for targets that support
669    # them and modifying test parameters for different targets.
670    target_compatible_with = incompatible_with_mcu(),
671    deps = [
672        ":crc16",
673        ":fake_flash_64_aligned_partition",
674        ":key_value_store_initialized_test",
675        ":pw_kvs",
676        "//pw_checksum",
677        "//pw_log",
678        "//pw_log:pw_log.facade",
679        "//pw_span",
680        "//pw_status",
681        "//pw_string:builder",
682        "//pw_unit_test",
683    ],
684)
685
686pw_cc_test(
687    name = "key_value_store_256_alignment_flash_test",
688    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
689    # use features such as std::map and are computationally expensive. Solving
690    # this requires a more complex capabilities-based build and configuration
691    # system which allowing enabling specific tests for targets that support
692    # them and modifying test parameters for different targets.
693    target_compatible_with = incompatible_with_mcu(),
694    deps = [
695        ":crc16",
696        ":fake_flash_256_aligned_partition",
697        ":key_value_store_initialized_test",
698        ":pw_kvs",
699        "//pw_checksum",
700        "//pw_log",
701        "//pw_log:pw_log.facade",
702        "//pw_span",
703        "//pw_status",
704        "//pw_string:builder",
705        "//pw_unit_test",
706    ],
707)
708
709pw_cc_test(
710    name = "fake_flash_test_key_value_store_test",
711    srcs = ["test_key_value_store_test.cc"],
712    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
713    # use features such as std::map and are computationally expensive. Solving
714    # this requires a more complex capabilities-based build and configuration
715    # system which allowing enabling specific tests for targets that support
716    # them and modifying test parameters for different targets.
717    target_compatible_with = incompatible_with_mcu(),
718    deps = [
719        ":crc16",
720        ":fake_flash_test_key_value_store",
721        ":pw_kvs",
722        "//pw_log",
723        "//pw_status",
724        "//pw_sync:borrow",
725        "//pw_unit_test",
726    ],
727)
728
729pw_cc_test(
730    name = "key_value_store_binary_format_test",
731    srcs = [
732        "key_value_store_binary_format_test.cc",
733    ],
734    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
735    # use features such as std::map and are computationally expensive. Solving
736    # this requires a more complex capabilities-based build and configuration
737    # system which allowing enabling specific tests for targets that support
738    # them and modifying test parameters for different targets.
739    target_compatible_with = incompatible_with_mcu(),
740    deps = [
741        ":crc16",
742        ":fake_flash",
743        ":pw_kvs",
744        "//pw_log",
745        "//pw_unit_test",
746    ],
747)
748
749pw_cc_test(
750    name = "key_value_store_put_test",
751    srcs = ["key_value_store_put_test.cc"],
752    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
753    # use features such as std::map and are computationally expensive. Solving
754    # this requires a more complex capabilities-based build and configuration
755    # system which allowing enabling specific tests for targets that support
756    # them and modifying test parameters for different targets.
757    target_compatible_with = incompatible_with_mcu(),
758    deps = [
759        ":crc16",
760        ":fake_flash",
761        ":pw_kvs",
762        ":test_partition",
763        "//pw_checksum",
764        "//pw_log",
765        "//pw_unit_test",
766    ],
767)
768
769pw_cc_test(
770    name = "key_value_store_map_test",
771    srcs = ["key_value_store_map_test.cc"],
772    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
773    # use features such as std::map and are computationally expensive. Solving
774    # this requires a more complex capabilities-based build and configuration
775    # system which allowing enabling specific tests for targets that support
776    # them and modifying test parameters for different targets.
777    target_compatible_with = incompatible_with_mcu(),
778    deps = [
779        ":crc16",
780        ":fake_flash",
781        ":pw_kvs",
782        ":test_partition",
783        "//pw_checksum",
784        "//pw_log",
785        "//pw_log:pw_log.facade",
786        "//pw_span",
787        "//pw_unit_test",
788    ],
789)
790
791pw_cc_test(
792    name = "sectors_test",
793    srcs = ["sectors_test.cc"],
794    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
795    # use features such as std::map and are computationally expensive. Solving
796    # this requires a more complex capabilities-based build and configuration
797    # system which allowing enabling specific tests for targets that support
798    # them and modifying test parameters for different targets.
799    target_compatible_with = incompatible_with_mcu(),
800    deps = [
801        ":fake_flash",
802        ":pw_kvs",
803        "//pw_log",
804        "//pw_unit_test",
805    ],
806)
807
808pw_cc_test(
809    name = "key_value_store_wear_test",
810    srcs = [
811        "key_value_store_wear_test.cc",
812    ],
813    # TODO: b/234883746 - KVS tests are not compatible with device builds as they
814    # use features such as std::map and are computationally expensive. Solving
815    # this requires a more complex capabilities-based build and configuration
816    # system which allowing enabling specific tests for targets that support
817    # them and modifying test parameters for different targets.
818    target_compatible_with = incompatible_with_mcu(),
819    deps = [
820        ":fake_flash",
821        ":pw_kvs",
822        ":test_partition",
823        "//pw_log",
824        "//pw_unit_test",
825    ],
826)
827
828filegroup(
829    name = "doxygen",
830    srcs = [
831        "public/pw_kvs/key_value_store.h",
832        "pw_kvs_private/config.h",
833    ],
834)
835