Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [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 | |
| 15 | import("$dir_pw_docgen/docs.gni") |
| 16 | import("$dir_pw_unit_test/test.gni") |
| 17 | |
| 18 | config("default_config") { |
| 19 | include_dirs = [ "public" ] |
| 20 | } |
| 21 | |
| 22 | source_set("pw_kvs") { |
| 23 | public_configs = [ ":default_config" ] |
| 24 | public = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 25 | "public/pw_kvs/alignment.h", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 26 | "public/pw_kvs/checksum.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 27 | "public/pw_kvs/flash_memory.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 28 | "public/pw_kvs/key_value_store.h", |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 29 | "public/pw_kvs/output.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 30 | ] |
| 31 | sources = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 32 | "alignment.cc", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 33 | "checksum.cc", |
| 34 | "flash_memory.cc", |
Wyatt Hepler | 6e3a83b | 2020-02-04 07:36:45 -0800 | [diff] [blame] | 35 | "format.cc", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 36 | "key_value_store.cc", |
Wyatt Hepler | 4da1fcb | 2020-01-30 17:32:18 -0800 | [diff] [blame] | 37 | "pw_kvs_private/format.h", |
| 38 | "pw_kvs_private/macros.h", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 39 | ] |
| 40 | sources += public |
| 41 | public_deps = [ |
Wyatt Hepler | 1c329ca | 2020-02-07 18:07:23 -0800 | [diff] [blame] | 42 | dir_pw_containers, |
Wyatt Hepler | ad684a1 | 2020-02-04 17:17:29 -0800 | [diff] [blame] | 43 | dir_pw_span, |
| 44 | dir_pw_status, |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 45 | ] |
| 46 | deps = [ |
| 47 | dir_pw_checksum, |
| 48 | dir_pw_log, |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 49 | ] |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 50 | friend = [ |
| 51 | ":entry_test", |
| 52 | ":key_value_store_test", |
| 53 | ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 54 | } |
| 55 | |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 56 | source_set("crc16") { |
| 57 | public = [ |
| 58 | "public/pw_kvs/crc16_checksum.h", |
| 59 | ] |
| 60 | sources = public |
| 61 | public_deps = [ |
| 62 | ":pw_kvs", |
| 63 | dir_pw_checksum, |
| 64 | ] |
| 65 | } |
| 66 | |
Wyatt Hepler | ad684a1 | 2020-02-04 17:17:29 -0800 | [diff] [blame] | 67 | source_set("in_memory_fake_flash") { |
| 68 | public = [ |
| 69 | "public/pw_kvs/in_memory_fake_flash.h", |
| 70 | ] |
| 71 | sources = public |
| 72 | visibility = [ ":*" ] |
| 73 | public_deps = [ |
| 74 | dir_pw_log, |
| 75 | ] |
| 76 | } |
| 77 | |
Wyatt Hepler | d621682 | 2020-02-04 16:39:15 -0800 | [diff] [blame] | 78 | executable("debug_cli") { |
| 79 | sources = [ |
| 80 | "debug_cli.cc", |
| 81 | ] |
| 82 | deps = [ |
| 83 | ":crc16", |
| 84 | ":in_memory_fake_flash", |
| 85 | ":pw_kvs", |
| 86 | ] |
| 87 | } |
| 88 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 89 | pw_test_group("tests") { |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 90 | tests = [ |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 91 | ":alignment_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 92 | ":checksum_test", |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 93 | ":entry_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 94 | ":key_value_store_test", |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 95 | ":key_value_store_fuzz_test", |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame^] | 96 | ":key_value_store_map_test", |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 97 | ] |
| 98 | } |
| 99 | |
Wyatt Hepler | 1927c28 | 2020-02-11 16:45:02 -0800 | [diff] [blame] | 100 | pw_test("alignment_test") { |
| 101 | deps = [ |
| 102 | ":pw_kvs", |
| 103 | ] |
| 104 | sources = [ |
| 105 | "alignment_test.cc", |
| 106 | ] |
| 107 | } |
| 108 | |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 109 | pw_test("checksum_test") { |
| 110 | deps = [ |
| 111 | ":crc16", |
| 112 | ":pw_kvs", |
| 113 | dir_pw_log, |
| 114 | ] |
| 115 | sources = [ |
| 116 | "checksum_test.cc", |
| 117 | ] |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 118 | } |
| 119 | |
Wyatt Hepler | 97fc794 | 2020-02-06 15:55:45 -0800 | [diff] [blame] | 120 | pw_test("entry_test") { |
| 121 | deps = [ |
| 122 | ":pw_kvs", |
| 123 | ] |
| 124 | sources = [ |
| 125 | "entry_test.cc", |
| 126 | ] |
| 127 | } |
| 128 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 129 | pw_test("key_value_store_test") { |
| 130 | deps = [ |
Wyatt Hepler | ec4b935 | 2020-01-31 15:51:50 -0800 | [diff] [blame] | 131 | ":crc16", |
Wyatt Hepler | ad684a1 | 2020-02-04 17:17:29 -0800 | [diff] [blame] | 132 | ":in_memory_fake_flash", |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 133 | ":pw_kvs", |
| 134 | dir_pw_checksum, |
| 135 | dir_pw_log, |
| 136 | ] |
| 137 | sources = [ |
| 138 | "key_value_store_test.cc", |
| 139 | ] |
| 140 | } |
| 141 | |
Wyatt Hepler | 16b0452 | 2020-02-07 16:00:14 -0800 | [diff] [blame] | 142 | pw_test("key_value_store_fuzz_test") { |
| 143 | deps = [ |
| 144 | ":crc16", |
| 145 | ":in_memory_fake_flash", |
| 146 | ":pw_kvs", |
| 147 | ] |
| 148 | sources = [ |
| 149 | "key_value_store_fuzz_test.cc", |
| 150 | ] |
| 151 | } |
| 152 | |
Wyatt Hepler | 495b6ee | 2020-02-12 18:58:01 -0800 | [diff] [blame^] | 153 | pw_test("key_value_store_map_test") { |
| 154 | deps = [ |
| 155 | ":crc16", |
| 156 | ":in_memory_fake_flash", |
| 157 | ":pw_kvs", |
| 158 | dir_pw_checksum, |
| 159 | ] |
| 160 | sources = [ |
| 161 | "key_value_store_map_test.cc", |
| 162 | ] |
| 163 | } |
| 164 | |
Wyatt Hepler | 2ad6067 | 2020-01-21 08:00:16 -0800 | [diff] [blame] | 165 | pw_doc_group("docs") { |
| 166 | sources = [ |
| 167 | "docs.rst", |
| 168 | ] |
| 169 | } |