David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 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 | |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
David Rogers | 17793d6 | 2021-02-05 03:29:02 -0800 | [diff] [blame] | 17 | import("$dir_pw_bloat/bloat.gni") |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 18 | import("$dir_pw_build/target_types.gni") |
| 19 | import("$dir_pw_docgen/docs.gni") |
| 20 | import("$dir_pw_unit_test/test.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 21 | |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 22 | config("default_config") { |
| 23 | include_dirs = [ "public" ] |
| 24 | } |
| 25 | |
| 26 | pw_source_set("pw_blob_store") { |
| 27 | public_configs = [ ":default_config" ] |
| 28 | public = [ "public/pw_blob_store/blob_store.h" ] |
David Rogers | 9692257 | 2020-08-04 10:24:57 -0700 | [diff] [blame] | 29 | sources = [ "blob_store.cc" ] |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 30 | public_deps = [ |
| 31 | dir_pw_kvs, |
| 32 | dir_pw_status, |
| 33 | dir_pw_stream, |
| 34 | ] |
David Rogers | 9692257 | 2020-08-04 10:24:57 -0700 | [diff] [blame] | 35 | deps = [ |
| 36 | dir_pw_assert, |
| 37 | dir_pw_checksum, |
| 38 | dir_pw_log, |
| 39 | ] |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | pw_test_group("tests") { |
David Rogers | 5aa32ab | 2020-09-08 14:39:24 -0700 | [diff] [blame] | 43 | tests = [ |
| 44 | ":blob_store_test", |
| 45 | ":blob_store_deferred_write_test", |
David Rogers | 1039584 | 2020-09-16 15:39:35 -0700 | [diff] [blame] | 46 | ":blob_store_chunk_write_test", |
David Rogers | 5aa32ab | 2020-09-08 14:39:24 -0700 | [diff] [blame] | 47 | ] |
David Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | pw_test("blob_store_test") { |
David Rogers | 9692257 | 2020-08-04 10:24:57 -0700 | [diff] [blame] | 51 | 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 Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 60 | } |
| 61 | |
David Rogers | 1039584 | 2020-09-16 15:39:35 -0700 | [diff] [blame] | 62 | pw_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 Rogers | 5aa32ab | 2020-09-08 14:39:24 -0700 | [diff] [blame] | 74 | pw_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 Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 86 | pw_doc_group("docs") { |
| 87 | sources = [ "docs.rst" ] |
David Rogers | 17793d6 | 2021-02-05 03:29:02 -0800 | [diff] [blame] | 88 | report_deps = [ ":blob_size" ] |
| 89 | } |
| 90 | |
| 91 | pw_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 Rogers | 2d19502 | 2020-07-16 14:07:47 -0700 | [diff] [blame] | 113 | } |