Debian Codegraph @

utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel

raw
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5 # Tests for LLVM libc string.h functions.
6
7 load("//libc:libc_build_rules.bzl", "libc_support_library")
8 load("//libc/test:libc_test_rules.bzl", "libc_test")
9
10 package(default_visibility = ["//visibility:public"])
11
12 licenses(["notice"])
13
14 libc_test(
15 name = "strlen_test",
16 srcs = ["strlen_test.cpp"],
17 libc_function_deps = [
18 "//libc:strlen",
19 ],
20 )
21
22 libc_test(
23 name = "strcpy_test",
24 srcs = ["strcpy_test.cpp"],
25 libc_function_deps = [
26 "//libc:strcpy_sanitized",
27 ],
28 )
29
30 libc_test(
31 name = "strcmp_test",
32 srcs = ["strcmp_test.cpp"],
33 libc_function_deps = [
34 "//libc:strcmp",
35 ],
36 )
37
38 libc_test(
39 name = "memchr_test",
40 srcs = ["memchr_test.cpp"],
41 libc_function_deps = [
42 "//libc:memchr",
43 ],
44 )
45
46 libc_support_library(
47 name = "strchr_test_helper",
48 hdrs = ["StrchrTest.h"],
49 deps = ["//libc/test/UnitTest:LibcUnitTest"],
50 )
51
52 libc_test(
53 name = "strchr_test",
54 srcs = ["strchr_test.cpp"],
55 libc_function_deps = [
56 "//libc:strchr",
57 ],
58 deps = [":strchr_test_helper"],
59 )
60
61 libc_test(
62 name = "strstr_test",
63 srcs = ["strstr_test.cpp"],
64 libc_function_deps = [
65 "//libc:strstr",
66 ],
67 )
68
69 libc_test(
70 name = "strnlen_test",
71 srcs = ["strnlen_test.cpp"],
72 libc_function_deps = [
73 "//libc:strnlen",
74 ],
75 )
76
77 libc_test(
78 name = "memrchr_test",
79 srcs = ["memrchr_test.cpp"],
80 libc_function_deps = [
81 "//libc:memrchr",
82 ],
83 )
84
85 libc_test(
86 name = "strrchr_test",
87 srcs = ["strrchr_test.cpp"],
88 libc_function_deps = [
89 "//libc:strrchr",
90 ],
91 deps = [":strchr_test_helper"],
92 )
93
94 libc_test(
95 name = "strcspn_test",
96 srcs = ["strcspn_test.cpp"],
97 libc_function_deps = [
98 "//libc:strcspn",
99 ],
100 )
101
102 libc_test(
103 name = "strspn_test",
104 srcs = ["strspn_test.cpp"],
105 libc_function_deps = [
106 "//libc:strspn",
107 ],
108 )
109
110 libc_test(
111 name = "strtok_test",
112 srcs = ["strtok_test.cpp"],
113 libc_function_deps = [
114 "//libc:strtok",
115 ],
116 )
117
118 libc_support_library(
119 name = "memory_check_utils",
120 hdrs = ["memory_utils/memory_check_utils.h"],
121 deps = [
122 "//libc:__support_cpp_span",
123 "//libc:__support_libc_assert",
124 "//libc:__support_macros_config",
125 "//libc:__support_macros_sanitizer",
126 "//libc:string_memory_utils",
127 ],
128 )
129
130 libc_support_library(
131 name = "protected_pages",
132 hdrs = ["memory_utils/protected_pages.h"],
133 deps = [
134 "//libc:__support_macros_attributes",
135 "//libc:__support_macros_properties_os",
136 ],
137 )
138
139 libc_test(
140 name = "memcpy_test",
141 srcs = ["memcpy_test.cpp"],
142 libc_function_deps = [
143 "//libc:memcpy",
144 ],
145 deps = [
146 ":memory_check_utils",
147 ":protected_pages",
148 "//libc:__support_macros_properties_os",
149 ],
150 )
151
152 libc_test(
153 name = "mempcpy_test",
154 srcs = ["mempcpy_test.cpp"],
155 libc_function_deps = [
156 "//libc:mempcpy",
157 ],
158 )
159
160 libc_test(
161 name = "memset_test",
162 srcs = ["memset_test.cpp"],
163 libc_function_deps = [
164 "//libc:memset",
165 ],
166 deps = [
167 ":memory_check_utils",
168 ":protected_pages",
169 "//libc:__support_macros_properties_os",
170 ],
171 )
172
173 libc_test(
174 name = "memmove_test",
175 srcs = ["memmove_test.cpp"],
176 libc_function_deps = [
177 "//libc:memcmp",
178 "//libc:memmove",
179 ],
180 deps = [
181 ":memory_check_utils",
182 "//libc:__support_cpp_span",
183 "//libc/test/UnitTest:memory_matcher",
184 ],
185 )
186
187 libc_test(
188 name = "bcopy_test",
189 srcs = ["bcopy_test.cpp"],
190 libc_function_deps = [
191 "//libc:bcopy",
192 ],
193 deps = [
194 ":memory_check_utils",
195 "//libc:__support_cpp_span",
196 "//libc/test/UnitTest:memory_matcher",
197 ],
198 )
199
200 libc_test(
201 name = "memcmp_test",
202 srcs = ["memcmp_test.cpp"],
203 libc_function_deps = [
204 "//libc:memcmp",
205 ],
206 deps = [
207 ":memory_check_utils",
208 "//libc/test/UnitTest:test_logger",
209 ],
210 )
211
212 libc_test(
213 name = "bcmp_test",
214 srcs = ["bcmp_test.cpp"],
215 libc_function_deps = [
216 "//libc:bcmp",
217 ],
218 deps = [
219 ":memory_check_utils",
220 "//libc/test/UnitTest:test_logger",
221 ],
222 )
223
224 libc_test(
225 name = "bzero_test",
226 srcs = ["bzero_test.cpp"],
227 libc_function_deps = [
228 "//libc:bzero",
229 ],
230 deps = [":memory_check_utils"],
231 )