blob: 9facc2c3b075118594f8ef6ad5b0890f45bcd7f0 [file] [log] [blame]
David Rogers2d195022020-07-16 14:07:47 -07001# 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_library",
18 "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
Rob Mohr5fc25412021-06-23 09:35:23 -070023licenses(["notice"])
David Rogers2d195022020-07-16 14:07:47 -070024
25pw_cc_library(
26 name = "pw_blob_store",
Nathaniel Brougha1113be2021-03-07 09:05:41 +080027 srcs = ["blob_store.cc"],
David Rogers2d195022020-07-16 14:07:47 -070028 hdrs = [
29 "public/pw_blob_store/blob_store.h",
Armando Montanez28ad6f42021-08-30 16:23:57 -070030 "public/pw_blob_store/internal/metadata_format.h",
David Rogers2d195022020-07-16 14:07:47 -070031 ],
32 includes = ["public"],
33 deps = [
Armando Montanez28ad6f42021-08-30 16:23:57 -070034 "//pw_bytes",
David Rogers2d195022020-07-16 14:07:47 -070035 "//pw_checksum",
36 "//pw_containers",
Nathaniel Broughf91e7632021-07-26 17:12:14 +080037 "//pw_kvs",
David Rogers2d195022020-07-16 14:07:47 -070038 "//pw_log",
Armando Montanez28ad6f42021-08-30 16:23:57 -070039 "//pw_preprocessor",
David Rogers2d195022020-07-16 14:07:47 -070040 "//pw_span",
41 "//pw_status",
Nathaniel Broughf91e7632021-07-26 17:12:14 +080042 "//pw_stream",
Ewout van Bekkum1d0aa6d2021-09-22 12:38:10 -070043 "//pw_sync:borrow",
David Rogers2d195022020-07-16 14:07:47 -070044 ],
45)
David Rogers96922572020-08-04 10:24:57 -070046
Armando Montanez0aa452b2021-09-29 17:21:33 -070047pw_cc_library(
48 name = "flat_file_system_entry",
49 srcs = ["flat_file_system_entry.cc"],
50 hdrs = ["public/pw_blob_store/flat_file_system_entry.h"],
51 includes = ["public"],
52 deps = [
53 ":pw_blob_store",
54 "//pw_bytes",
55 "//pw_file:flat_file_system",
56 "//pw_status",
57 "//pw_sync:mutex",
58 ],
59)
60
David Rogers96922572020-08-04 10:24:57 -070061pw_cc_test(
62 name = "blob_store_test",
63 srcs = [
64 "blob_store_test.cc",
65 ],
66 deps = [
67 ":pw_blob_store",
68 "//pw_kvs:crc16",
69 "//pw_kvs:fake_flash",
70 "//pw_kvs:fake_flash_test_key_value_store",
71 "//pw_log",
Ewout van Bekkum1d0aa6d2021-09-22 12:38:10 -070072 "//pw_sync:borrow",
David Rogers96922572020-08-04 10:24:57 -070073 "//pw_unit_test",
74 ],
75)
David Rogers5aa32ab2020-09-08 14:39:24 -070076
77pw_cc_test(
David Rogers10395842020-09-16 15:39:35 -070078 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)
Nathaniel Brougha1113be2021-03-07 09:05:41 +080092
David Rogers10395842020-09-16 15:39:35 -070093pw_cc_test(
David Rogers5aa32ab2020-09-08 14:39:24 -070094 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)
Armando Montanez0aa452b2021-09-29 17:21:33 -0700108
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)