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( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_test", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24cc_library( 25 name = "pw_blob_store", 26 srcs = ["blob_store.cc"], 27 hdrs = [ 28 "public/pw_blob_store/blob_store.h", 29 "public/pw_blob_store/internal/metadata_format.h", 30 ], 31 includes = ["public"], 32 deps = [ 33 "//pw_bytes", 34 "//pw_checksum", 35 "//pw_containers", 36 "//pw_kvs", 37 "//pw_log", 38 "//pw_preprocessor", 39 "//pw_span", 40 "//pw_status", 41 "//pw_stream", 42 "//pw_sync:borrow", 43 ], 44) 45 46cc_library( 47 name = "flat_file_system_entry", 48 srcs = ["flat_file_system_entry.cc"], 49 hdrs = ["public/pw_blob_store/flat_file_system_entry.h"], 50 includes = ["public"], 51 deps = [ 52 ":pw_blob_store", 53 "//pw_bytes", 54 "//pw_file:flat_file_system", 55 "//pw_status", 56 "//pw_sync:mutex", 57 ], 58) 59 60pw_cc_test( 61 name = "blob_store_test", 62 srcs = [ 63 "blob_store_test.cc", 64 ], 65 deps = [ 66 ":pw_blob_store", 67 "//pw_kvs:crc16", 68 "//pw_kvs:fake_flash", 69 "//pw_kvs:fake_flash_test_key_value_store", 70 "//pw_log", 71 "//pw_random", 72 "//pw_sync:borrow", 73 "//pw_unit_test", 74 ], 75) 76 77pw_cc_test( 78 name = "blob_store_chunk_write_test", 79 srcs = [ 80 "blob_store_chunk_write_test.cc", 81 ], 82 deps = [ 83 ":pw_blob_store", 84 "//pw_kvs:crc16", 85 "//pw_kvs:fake_flash", 86 "//pw_kvs:fake_flash_test_key_value_store", 87 "//pw_log", 88 "//pw_random", 89 "//pw_unit_test", 90 ], 91) 92 93pw_cc_test( 94 name = "blob_store_deferred_write_test", 95 srcs = [ 96 "blob_store_deferred_write_test.cc", 97 ], 98 deps = [ 99 ":pw_blob_store", 100 "//pw_kvs:crc16", 101 "//pw_kvs:fake_flash", 102 "//pw_kvs:fake_flash_test_key_value_store", 103 "//pw_log", 104 "//pw_random", 105 "//pw_unit_test", 106 ], 107) 108 109pw_cc_test( 110 name = "flat_file_system_entry_test", 111 srcs = ["flat_file_system_entry_test.cc"], 112 deps = [ 113 ":flat_file_system_entry", 114 ":pw_blob_store", 115 "//pw_kvs:crc16", 116 "//pw_kvs:fake_flash", 117 "//pw_kvs:fake_flash_test_key_value_store", 118 "//pw_random", 119 "//pw_sync:mutex", 120 ], 121) 122