1# Copyright 2024 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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_build/target_types.gni") 18import("$dir_pw_unit_test/test.gni") 19 20config("public_include_path") { 21 include_dirs = [ "public" ] 22 visibility = [ ":*" ] 23} 24 25pw_source_set("base") { 26 public_configs = [ ":public_include_path" ] 27 public = [ "public/pw_allocator/bucket/base.h" ] 28 public_deps = [ 29 "$dir_pw_allocator:config", 30 "$dir_pw_allocator:deallocator", 31 "$dir_pw_allocator/block:poisonable", 32 ] 33 visibility = [ ":*" ] 34} 35 36pw_source_set("fast_sorted") { 37 public_configs = [ ":public_include_path" ] 38 public = [ "public/pw_allocator/bucket/fast_sorted.h" ] 39 public_deps = [ 40 ":base", 41 "$dir_pw_containers:intrusive_multimap", 42 ] 43} 44 45pw_source_set("sequenced") { 46 public_configs = [ ":public_include_path" ] 47 public = [ "public/pw_allocator/bucket/sequenced.h" ] 48 public_deps = [ 49 ":base", 50 "$dir_pw_containers:intrusive_list", 51 ] 52} 53 54pw_source_set("sorted") { 55 public_configs = [ ":public_include_path" ] 56 public = [ "public/pw_allocator/bucket/sorted.h" ] 57 public_deps = [ 58 ":base", 59 "$dir_pw_containers:intrusive_forward_list", 60 ] 61} 62 63pw_source_set("unordered") { 64 public_configs = [ ":public_include_path" ] 65 public = [ "public/pw_allocator/bucket/unordered.h" ] 66 public_deps = [ 67 ":base", 68 "$dir_pw_containers:intrusive_forward_list", 69 ] 70} 71 72pw_source_set("testing") { 73 public_configs = [ ":public_include_path" ] 74 public = [ "public/pw_allocator/bucket/testing.h" ] 75 public_deps = [ 76 "$dir_pw_allocator:buffer", 77 "$dir_pw_allocator:bump_allocator", 78 ] 79} 80 81pw_test("fast_sorted_test") { 82 sources = [ "fast_sorted_test.cc" ] 83 public_deps = [ 84 ":fast_sorted", 85 ":testing", 86 "$dir_pw_allocator/block:detailed_block", 87 ] 88} 89 90pw_test("sequenced_test") { 91 sources = [ "sequenced_test.cc" ] 92 public_deps = [ 93 ":sequenced", 94 ":testing", 95 "$dir_pw_allocator/block:detailed_block", 96 ] 97} 98 99pw_test("sorted_test") { 100 sources = [ "sorted_test.cc" ] 101 public_deps = [ 102 ":sorted", 103 ":testing", 104 "$dir_pw_allocator/block:detailed_block", 105 ] 106} 107 108pw_test("unordered_test") { 109 sources = [ "unordered_test.cc" ] 110 public_deps = [ 111 ":testing", 112 ":unordered", 113 "$dir_pw_allocator/block:detailed_block", 114 ] 115} 116 117pw_test_group("tests") { 118 tests = [ 119 ":sorted_test", 120 ":fast_sorted_test", 121 ":sequenced_test", 122 ":unordered_test", 123 ] 124} 125