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 deps = [
17 "//libc:access",
18 "//libc:close",
19 "//libc:open",
20 "//libc:unlink",
21 ],
22 )
23
24 libc_test(
25 name = "dup_test",
26 srcs = ["dup_test.cpp"],
27 deps = [
28 "//libc:close",
29 "//libc:dup",
30 "//libc:open",
31 "//libc:read",
32 "//libc:unlink",
33 "//libc:write",
34 ],
35 )
36
37 libc_test(
38 name = "dup2_test",
39 srcs = ["dup2_test.cpp"],
40 deps = [
41 "//libc:close",
42 "//libc:dup2",
43 "//libc:open",
44 "//libc:read",
45 "//libc:unlink",
46 "//libc:write",
47 ],
48 )
49
50 libc_test(
51 name = "dup3_test",
52 srcs = ["dup3_test.cpp"],
53 deps = [
54 "//libc:close",
55 "//libc:dup3",
56 "//libc:open",
57 "//libc:read",
58 "//libc:unlink",
59 "//libc:write",
60 ],
61 )
62
63 libc_test(
64 name = "ftruncate_test",
65 srcs = ["ftruncate_test.cpp"],
66 deps = [
67 "//libc:__support_cpp_string_view",
68 "//libc:close",
69 "//libc:ftruncate",
70 "//libc:open",
71 "//libc:read",
72 "//libc:unlink",
73 "//libc:write",
74 ],
75 )
76
77 libc_test(
78 name = "getpagesize_test",
79 srcs = ["getpagesize_test.cpp"],
80 deps = [
81 "//libc:getpagesize",
82 ],
83 )
84
85 libc_test(
86 name = "pread_pwrite_test",
87 srcs = ["pread_pwrite_test.cpp"],
88 deps = [
89 "//libc:close",
90 "//libc:fsync",
91 "//libc:open",
92 "//libc:pread",
93 "//libc:pwrite",
94 "//libc:unlink",
95 "//libc:write",
96 ],
97 )
98
99 libc_test(
100 name = "read_write_test",
101 srcs = ["read_write_test.cpp"],
102 deps = [
103 "//libc:close",
104 "//libc:fsync",
105 "//libc:open",
106 "//libc:read",
107 "//libc:remove",
108 "//libc:write",
109 ],
110 )
111
112 libc_test(
113 name = "link_test",
114 srcs = ["link_test.cpp"],
115 deps = [
116 "//libc:close",
117 "//libc:link",
118 "//libc:open",
119 "//libc:unlink",
120 ],
121 )
122
123 libc_test(
124 name = "swab_test",
125 srcs = ["swab_test.cpp"],
126 deps = [
127 "//libc:string_utils",
128 "//libc:swab",
129 ],
130 )
131
132 libc_test(
133 name = "symlink_test",
134 srcs = ["symlink_test.cpp"],
135 deps = [
136 "//libc:close",
137 "//libc:open",
138 "//libc:symlink",
139 "//libc:unlink",
140 ],
141 )
142
143 libc_test(
144 name = "truncate_test",
145 srcs = ["truncate_test.cpp"],
146 deps = [
147 "//libc:__support_cpp_string_view",
148 "//libc:close",
149 "//libc:open",
150 "//libc:read",
151 "//libc:truncate",
152 "//libc:unlink",
153 "//libc:write",
154 ],
155 )
156
157 libc_test(
158 name = "unlink_test",
159 srcs = ["unlink_test.cpp"],
160 deps = [
161 "//libc:close",
162 "//libc:open",
163 "//libc:unlink",
164 ],
165 )
166
167 libc_test(
168 name = "getppid_test",
169 srcs = ["getppid_test.cpp"],
170 deps = [
171 "//libc:getppid",
172 ],
173 )
174
175 libc_test(
176 name = "getuid_test",
177 srcs = ["getuid_test.cpp"],
178 deps = [
179 "//libc:getuid",
180 ],
181 )
182
183 libc_test(
184 name = "isatty_test",
185 srcs = ["isatty_test.cpp"],
186 deps = [
187 "//libc:close",
188 "//libc:isatty",
189 "//libc:open",
190 ],
191 )
192
193 libc_test(
194 name = "geteuid_test",
195 srcs = ["geteuid_test.cpp"],
196 deps = [
197 "//libc:geteuid",
198 ],
199 )
200
201 # TODO: add rules for functions modifying directories.
202
203 #TODO: Enable once fullbuild is added to bazel, since this depends on a macro
204 # definition in the public header
205
206 # libc_test(
207 # name = "syscall_test",
208 # srcs = ["syscall_test.cpp"],
209 # deps = [
210 # "//libc:syscall",
211 # ],
212 # )
213
214 # TODO: add once sysconf is complete
215
216 # libc_test(
217 # name = "sysconf_test",
218 # srcs = ["sysconf_test.cpp"],
219 # deps = [
220 # "//libc:sysconf",
221 # ],
222 # )
223
224 # TODO: add fopencookie and fflush
225
226 # libc_test(
227 # name = "getopt_test",
228 # srcs = ["getopt_test.cpp"],
229 # deps = [
230 # "//libc:__support_cpp_array",
231 # "//libc:getopt",
232 # "//libc:fopencookie",
233 # "//libc:fflush",
234 # ],
235 # )