blob: 236c8d183fb2af90ca887598febf991e4b24ed14 [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
David Rogers2d195022020-07-16 14:07:47 -070015import("//build_overrides/pigweed.gni")
16
David Rogers17793d62021-02-05 03:29:02 -080017import("$dir_pw_bloat/bloat.gni")
David Rogers2d195022020-07-16 14:07:47 -070018import("$dir_pw_build/target_types.gni")
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070021
David Rogers2d195022020-07-16 14:07:47 -070022config("default_config") {
23 include_dirs = [ "public" ]
24}
25
26pw_source_set("pw_blob_store") {
27 public_configs = [ ":default_config" ]
28 public = [ "public/pw_blob_store/blob_store.h" ]
David Rogers96922572020-08-04 10:24:57 -070029 sources = [ "blob_store.cc" ]
David Rogers2d195022020-07-16 14:07:47 -070030 public_deps = [
31 dir_pw_kvs,
32 dir_pw_status,
33 dir_pw_stream,
34 ]
David Rogers96922572020-08-04 10:24:57 -070035 deps = [
36 dir_pw_assert,
37 dir_pw_checksum,
38 dir_pw_log,
39 ]
David Rogers2d195022020-07-16 14:07:47 -070040}
41
42pw_test_group("tests") {
David Rogers5aa32ab2020-09-08 14:39:24 -070043 tests = [
44 ":blob_store_test",
45 ":blob_store_deferred_write_test",
David Rogers10395842020-09-16 15:39:35 -070046 ":blob_store_chunk_write_test",
David Rogers5aa32ab2020-09-08 14:39:24 -070047 ]
David Rogers2d195022020-07-16 14:07:47 -070048}
49
50pw_test("blob_store_test") {
David Rogers96922572020-08-04 10:24:57 -070051 deps = [
52 ":pw_blob_store",
53 "$dir_pw_kvs:crc16",
54 "$dir_pw_kvs:fake_flash",
55 "$dir_pw_kvs:fake_flash_test_key_value_store",
56 dir_pw_log,
57 dir_pw_random,
58 ]
59 sources = [ "blob_store_test.cc" ]
David Rogers2d195022020-07-16 14:07:47 -070060}
61
David Rogers10395842020-09-16 15:39:35 -070062pw_test("blob_store_chunk_write_test") {
63 deps = [
64 ":pw_blob_store",
65 "$dir_pw_kvs:crc16",
66 "$dir_pw_kvs:fake_flash",
67 "$dir_pw_kvs:fake_flash_test_key_value_store",
68 dir_pw_log,
69 dir_pw_random,
70 ]
71 sources = [ "blob_store_chunk_write_test.cc" ]
72}
73
David Rogers5aa32ab2020-09-08 14:39:24 -070074pw_test("blob_store_deferred_write_test") {
75 deps = [
76 ":pw_blob_store",
77 "$dir_pw_kvs:crc16",
78 "$dir_pw_kvs:fake_flash",
79 "$dir_pw_kvs:fake_flash_test_key_value_store",
80 dir_pw_log,
81 dir_pw_random,
82 ]
83 sources = [ "blob_store_deferred_write_test.cc" ]
84}
85
David Rogers2d195022020-07-16 14:07:47 -070086pw_doc_group("docs") {
87 sources = [ "docs.rst" ]
David Rogers17793d62021-02-05 03:29:02 -080088 report_deps = [ ":blob_size" ]
89}
90
91pw_size_report("blob_size") {
92 title = "Pigweed BlobStore size report"
93
94 # To see all the symbols, uncomment the following:
95 # Note: The size report RST table won't be generated when full_report = true.
96 # full_report = true
97
98 binaries = [
99 {
100 target = "size_report:basic_blob"
101 base = "size_report:base"
102 label = "BlobStore"
103 },
104 ]
105
106 binaries += [
107 {
108 target = "size_report:deferred_write_blob"
109 base = "size_report:base"
110 label = "BlobStore with deferred write"
111 },
112 ]
David Rogers2d195022020-07-16 14:07:47 -0700113}