blob: e6c9311b0a93cee69e4c32e301a173e6d36541c8 [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
17import("$dir_pw_build/target_types.gni")
18import("$dir_pw_docgen/docs.gni")
19import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070020
David Rogers2d195022020-07-16 14:07:47 -070021config("default_config") {
22 include_dirs = [ "public" ]
23}
24
25pw_source_set("pw_blob_store") {
26 public_configs = [ ":default_config" ]
27 public = [ "public/pw_blob_store/blob_store.h" ]
David Rogers96922572020-08-04 10:24:57 -070028 sources = [ "blob_store.cc" ]
David Rogers2d195022020-07-16 14:07:47 -070029 public_deps = [
30 dir_pw_kvs,
31 dir_pw_status,
32 dir_pw_stream,
33 ]
David Rogers96922572020-08-04 10:24:57 -070034 deps = [
35 dir_pw_assert,
36 dir_pw_checksum,
37 dir_pw_log,
38 ]
David Rogers2d195022020-07-16 14:07:47 -070039}
40
41pw_test_group("tests") {
David Rogers5aa32ab2020-09-08 14:39:24 -070042 tests = [
43 ":blob_store_test",
44 ":blob_store_deferred_write_test",
David Rogers10395842020-09-16 15:39:35 -070045 ":blob_store_chunk_write_test",
David Rogers5aa32ab2020-09-08 14:39:24 -070046 ]
David Rogers2d195022020-07-16 14:07:47 -070047}
48
49pw_test("blob_store_test") {
David Rogers96922572020-08-04 10:24:57 -070050 deps = [
51 ":pw_blob_store",
52 "$dir_pw_kvs:crc16",
53 "$dir_pw_kvs:fake_flash",
54 "$dir_pw_kvs:fake_flash_test_key_value_store",
55 dir_pw_log,
56 dir_pw_random,
57 ]
58 sources = [ "blob_store_test.cc" ]
David Rogers2d195022020-07-16 14:07:47 -070059}
60
David Rogers10395842020-09-16 15:39:35 -070061pw_test("blob_store_chunk_write_test") {
62 deps = [
63 ":pw_blob_store",
64 "$dir_pw_kvs:crc16",
65 "$dir_pw_kvs:fake_flash",
66 "$dir_pw_kvs:fake_flash_test_key_value_store",
67 dir_pw_log,
68 dir_pw_random,
69 ]
70 sources = [ "blob_store_chunk_write_test.cc" ]
71}
72
David Rogers5aa32ab2020-09-08 14:39:24 -070073pw_test("blob_store_deferred_write_test") {
74 deps = [
75 ":pw_blob_store",
76 "$dir_pw_kvs:crc16",
77 "$dir_pw_kvs:fake_flash",
78 "$dir_pw_kvs:fake_flash_test_key_value_store",
79 dir_pw_log,
80 dir_pw_random,
81 ]
82 sources = [ "blob_store_deferred_write_test.cc" ]
83}
84
David Rogers2d195022020-07-16 14:07:47 -070085pw_doc_group("docs") {
86 sources = [ "docs.rst" ]
87}