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