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/test:libc_test_rules.bzl", "libc_test", "libc_test_library")
8
9 package(default_visibility = ["//visibility:public"])
10
11 licenses(["notice"])
12
13 libc_test(
14 name = "strlen_test",
15 srcs = ["strlen_test.cpp"],
16 deps = [
17 "//libc:strlen",
18 ],
19 )
20
21 libc_test(
22 name = "strcpy_test",
23 srcs = ["strcpy_test.cpp"],
24 deps = [
25 "//libc:hdr_signal_macros",
26 "//libc:strcpy",
27 ],
28 )
29
30 libc_test(
31 name = "strcmp_test",
32 srcs = ["strcmp_test.cpp"],
33 deps = [
34 "//libc:strcmp",
35 ],
36 )
37
38 libc_test(
39 name = "memchr_test",
40 srcs = ["memchr_test.cpp"],
41 deps = [
42 "//libc:hdr_signal_macros",
43 "//libc:memchr",
44 ],
45 )
46
47 libc_test_library(
48 name = "strchr_test_helper",
49 hdrs = ["StrchrTest.h"],
50 deps = ["//libc/test/UnitTest:LibcUnitTest"],
51 )
52
53 libc_test(
54 name = "strchr_test",
55 srcs = ["strchr_test.cpp"],
56 deps = [
57 ":strchr_test_helper",
58 "//libc:strchr",
59 ],
60 )
61
62 libc_test(
63 name = "strstr_test",
64 srcs = ["strstr_test.cpp"],
65 deps = [
66 "//libc:strstr",
67 ],
68 )
69
70 libc_test(
71 name = "strnlen_test",
72 srcs = ["strnlen_test.cpp"],
73 deps = [
74 "//libc:strnlen",
75 ],
76 )
77
78 libc_test(
79 name = "memrchr_test",
80 srcs = ["memrchr_test.cpp"],
81 deps = [
82 "//libc:hdr_signal_macros",
83 "//libc:memrchr",
84 ],
85 )
86
87 libc_test(
88 name = "strrchr_test",
89 srcs = ["strrchr_test.cpp"],
90 deps = [
91 ":strchr_test_helper",
92 "//libc:strrchr",
93 ],
94 )
95
96 libc_test(
97 name = "strcspn_test",
98 srcs = ["strcspn_test.cpp"],
99 deps = [
100 "//libc:strcspn",
101 ],
102 )
103
104 libc_test(
105 name = "strspn_test",
106 srcs = ["strspn_test.cpp"],
107 deps = [
108 "//libc:hdr_signal_macros",
109 "//libc:strspn",
110 ],
111 )
112
113 libc_test(
114 name = "strtok_test",
115 srcs = ["strtok_test.cpp"],
116 deps = [
117 "//libc:strtok",
118 ],
119 )
120
121 libc_test_library(
122 name = "memory_check_utils",
123 hdrs = ["memory_utils/memory_check_utils.h"],
124 deps = [
125 "//libc:__support_cpp_span",
126 "//libc:__support_libc_assert",
127 "//libc:__support_macros_config",
128 "//libc:__support_macros_sanitizer",
129 "//libc:string_memory_utils",
130 ],
131 )
132
133 libc_test_library(
134 name = "protected_pages",
135 hdrs = ["memory_utils/protected_pages.h"],
136 deps = [
137 "//libc:__support_macros_attributes",
138 "//libc:__support_macros_properties_os",
139 ],
140 )
141
142 libc_test(
143 name = "memcpy_test",
144 srcs = ["memcpy_test.cpp"],
145 deps = [
146 ":memory_check_utils",
147 ":protected_pages",
148 "//libc:__support_macros_properties_os",
149 "//libc:hdr_signal_macros",
150 "//libc:memcpy",
151 ],
152 )
153
154 libc_test(
155 name = "mempcpy_test",
156 srcs = ["mempcpy_test.cpp"],
157 deps = [
158 "//libc:hdr_signal_macros",
159 "//libc:mempcpy",
160 ],
161 )
162
163 libc_test(
164 name = "memset_test",
165 srcs = ["memset_test.cpp"],
166 deps = [
167 ":memory_check_utils",
168 ":protected_pages",
169 "//libc:__support_macros_properties_os",
170 "//libc:hdr_signal_macros",
171 "//libc:memset",
172 ],
173 )
174
175 libc_test(
176 name = "memmove_test",
177 srcs = ["memmove_test.cpp"],
178 deps = [
179 ":memory_check_utils",
180 "//libc:__support_cpp_span",
181 "//libc:hdr_signal_macros",
182 "//libc:memcmp",
183 "//libc:memmove",
184 "//libc/test/UnitTest:memory_matcher",
185 ],
186 )
187
188 libc_test(
189 name = "memcmp_test",
190 srcs = ["memcmp_test.cpp"],
191 deps = [
192 ":memory_check_utils",
193 "//libc:hdr_signal_macros",
194 "//libc:memcmp",
195 "//libc/test/UnitTest:test_logger",
196 ],
197 )