Debian Codegraph @

utils/bazel/llvm-project-overlay/libc/test/src/unistd/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 unistd.h functions.
6
7 load("//libc/test:libc_test_rules.bzl", "libc_test")
8
9 package(default_visibility = ["//visibility:public"])
10
11 licenses(["notice"])
12
13 libc_test(
14 name = "access_test",
15 srcs = ["access_test.cpp"],
16 libc_function_deps = [
17 "//libc:open",
18 "//libc:access",
19 "//libc:close",
20 "//libc:unlink",
21 ],
22 )
23
24 # libc_test(
25 # name = "chdir_test",
26 # srcs = ["chdir_test.cpp"],
27 # libc_function_deps = [
28 # "//libc:open",
29 # "//libc:chdir",
30 # "//libc:close",
31 # ],
32 # )
33
34 libc_test(
35 name = "dup_test",
36 srcs = ["dup_test.cpp"],
37 libc_function_deps = [
38 "//libc:open",
39 "//libc:close",
40 "//libc:dup",
41 "//libc:read",
42 "//libc:unlink",
43 "//libc:write",
44 ],
45 )
46
47 libc_test(
48 name = "dup2_test",
49 srcs = ["dup2_test.cpp"],
50 libc_function_deps = [
51 "//libc:open",
52 "//libc:close",
53 "//libc:dup2",
54 "//libc:read",
55 "//libc:unlink",
56 "//libc:write",
57 ],
58 )
59
60 libc_test(
61 name = "dup3_test",
62 srcs = ["dup3_test.cpp"],
63 libc_function_deps = [
64 "//libc:open",
65 "//libc:close",
66 "//libc:dup3",
67 "//libc:read",
68 "//libc:unlink",
69 "//libc:write",
70 ],
71 )
72
73 # libc_test(
74 # name = "fchdir_test",
75 # srcs = ["fchdir_test.cpp"],
76 # libc_function_deps = [
77 # "//libc:open",
78 # "//libc:fchdir",
79 # "//libc:close",
80 # ],
81 # )
82
83 libc_test(
84 name = "ftruncate_test",
85 srcs = ["ftruncate_test.cpp"],
86 libc_function_deps = [
87 "//libc:open",
88 "//libc:close",
89 "//libc:read",
90 "//libc:ftruncate",
91 "//libc:unlink",
92 "//libc:write",
93 ],
94 deps = [
95 "//libc:__support_cpp_string_view",
96 ],
97 )
98
99 libc_test(
100 name = "pread_pwrite_test",
101 srcs = ["pread_pwrite_test.cpp"],
102 libc_function_deps = [
103 "//libc:open",
104 "//libc:close",
105 "//libc:fsync",
106 "//libc:pread",
107 "//libc:pwrite",
108 "//libc:unlink",
109 "//libc:write",
110 ],
111 )
112
113 libc_test(
114 name = "read_write_test",
115 srcs = ["read_write_test.cpp"],
116 libc_function_deps = [
117 "//libc:open",
118 "//libc:close",
119 "//libc:fsync",
120 "//libc:read",
121 "//libc:write",
122 "//libc:remove",
123 ],
124 )
125
126 libc_test(
127 name = "link_test",
128 srcs = ["link_test.cpp"],
129 libc_function_deps = [
130 "//libc:open",
131 "//libc:close",
132 "//libc:link",
133 "//libc:unlink",
134 ],
135 )
136
137 # libc_test(
138 # name = "linkat_test",
139 # srcs = ["linkat_test.cpp"],
140 # libc_function_deps = [
141 # "//libc:open",
142 # "//libc:close",
143 # "//libc:linkat",
144 # "//libc:unlink",
145 # ],
146 # )
147
148 # libc_test(
149 # name = "lseek_test",
150 # srcs = ["lseek_test.cpp"],
151 # libc_function_deps = [
152 # "//libc:open",
153 # "//libc:close",
154 # "//libc:lseek",
155 # "//libc:read",
156 # ],
157 # )
158
159 # libc_test(
160 # name = "rmdir_test",
161 # srcs = ["rmdir_test.cpp"],
162 # libc_function_deps = [
163 # "//libc:mkdir",
164 # "//libc:rmdir",
165 # ],
166 # )
167
168 libc_test(
169 name = "swab_test",
170 srcs = ["swab_test.cpp"],
171 libc_function_deps = [
172 "//libc:swab",
173 ],
174 deps = [
175 "//libc:string_utils",
176 ],
177 )
178
179 # libc_test(
180 # name = "readlink_test",
181 # srcs = ["readlink_test.cpp"],
182 # libc_function_deps = [
183 # "//libc:readlink",
184 # "//libc:symlink",
185 # "//libc:unlink",
186 # ],
187 # deps = [
188 # "//libc:__support_cpp_string_view",
189 # ],
190 # )
191
192 # libc_test(
193 # name = "readlinkat_test",
194 # srcs = ["readlinkat_test.cpp"],
195 # libc_function_deps = [
196 # "//libc:readlinkat",
197 # "//libc:symlink",
198 # "//libc:unlink",
199 # ],
200 # deps = [
201 # "//libc:__support_cpp_string_view",
202 # ],
203 # )
204
205 libc_test(
206 name = "symlink_test",
207 srcs = ["symlink_test.cpp"],
208 libc_function_deps = [
209 "//libc:open",
210 "//libc:close",
211 "//libc:symlink",
212 "//libc:unlink",
213 ],
214 )
215
216 # libc_test(
217 # name = "symlinkat_test",
218 # srcs = ["symlinkat_test.cpp"],
219 # libc_function_deps = [
220 # "//libc:open",
221 # "//libc:close",
222 # "//libc:symlinkat",
223 # "//libc:unlink",
224 # ],
225 # )
226
227 libc_test(
228 name = "truncate_test",
229 srcs = ["truncate_test.cpp"],
230 libc_function_deps = [
231 "//libc:open",
232 "//libc:close",
233 "//libc:read",
234 "//libc:truncate",
235 "//libc:unlink",
236 "//libc:write",
237 ],
238 deps = [
239 "//libc:__support_cpp_string_view",
240 ],
241 )
242
243 libc_test(
244 name = "unlink_test",
245 srcs = ["unlink_test.cpp"],
246 libc_function_deps = [
247 "//libc:open",
248 "//libc:close",
249 "//libc:unlink",
250 ],
251 )
252
253 # libc_test(
254 # name = "unlinkat_test",
255 # srcs = ["unlinkat_test.cpp"],
256 # libc_function_deps = [
257 # "//libc:open",
258 # "//libc:openat",
259 # "//libc:close",
260 # "//libc:unlinkat",
261 # ],
262 # )
263
264 libc_test(
265 name = "getpid_test",
266 srcs = ["getpid_test.cpp"],
267 libc_function_deps = [
268 "//libc:getpid",
269 ],
270 )
271
272 libc_test(
273 name = "getppid_test",
274 srcs = ["getppid_test.cpp"],
275 libc_function_deps = [
276 "//libc:getppid",
277 ],
278 )
279
280 libc_test(
281 name = "getuid_test",
282 srcs = ["getuid_test.cpp"],
283 libc_function_deps = [
284 "//libc:getuid",
285 ],
286 )
287
288 libc_test(
289 name = "isatty_test",
290 srcs = ["isatty_test.cpp"],
291 libc_function_deps = [
292 "//libc:isatty",
293 "//libc:open",
294 "//libc:close",
295 ],
296 )
297
298 libc_test(
299 name = "geteuid_test",
300 srcs = ["geteuid_test.cpp"],
301 libc_function_deps = [
302 "//libc:geteuid",
303 ],
304 )
305
306 #TODO: Enable once fullbuild is added to bazel, since this depends on a macro
307 # definition in the public header
308
309 # libc_test(
310 # name = "syscall_test",
311 # srcs = ["syscall_test.cpp"],
312 # libc_function_deps = [
313 # "//libc:syscall",
314 # ],
315 # )
316
317 # TODO: add once sysconf is complete
318
319 # libc_test(
320 # name = "sysconf_test",
321 # srcs = ["sysconf_test.cpp"],
322 # libc_function_deps = [
323 # "//libc:sysconf",
324 # ],
325 # )
326
327 # TODO: add fopencookie and fflush
328
329 # libc_test(
330 # name = "getopt_test",
331 # srcs = ["getopt_test.cpp"],
332 # libc_function_deps = [
333 # "//libc:getopt",
334 # "//libc:fopencookie",
335 # "//libc:fflush",
336 # ],
337 # deps = [
338 # "//libc:__support_cpp_array",
339 # ],
340 # )