228 lines · plain
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-exception4 5# Tests for LLVM libc unistd.h functions.6 7load("//libc/test:libc_test_rules.bzl", "libc_test")8 9package(default_visibility = ["//visibility:public"])10 11licenses(["notice"])12 13libc_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 24libc_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 37libc_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 50libc_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 63libc_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 77libc_test(78 name = "pread_pwrite_test",79 srcs = ["pread_pwrite_test.cpp"],80 deps = [81 "//libc:close",82 "//libc:fsync",83 "//libc:open",84 "//libc:pread",85 "//libc:pwrite",86 "//libc:unlink",87 "//libc:write",88 ],89)90 91libc_test(92 name = "read_write_test",93 srcs = ["read_write_test.cpp"],94 deps = [95 "//libc:close",96 "//libc:fsync",97 "//libc:open",98 "//libc:read",99 "//libc:remove",100 "//libc:write",101 ],102)103 104libc_test(105 name = "link_test",106 srcs = ["link_test.cpp"],107 deps = [108 "//libc:close",109 "//libc:link",110 "//libc:open",111 "//libc:unlink",112 ],113)114 115libc_test(116 name = "swab_test",117 srcs = ["swab_test.cpp"],118 deps = [119 "//libc:string_utils",120 "//libc:swab",121 ],122)123 124libc_test(125 name = "symlink_test",126 srcs = ["symlink_test.cpp"],127 deps = [128 "//libc:close",129 "//libc:open",130 "//libc:symlink",131 "//libc:unlink",132 ],133)134 135libc_test(136 name = "truncate_test",137 srcs = ["truncate_test.cpp"],138 deps = [139 "//libc:__support_cpp_string_view",140 "//libc:close",141 "//libc:open",142 "//libc:read",143 "//libc:truncate",144 "//libc:unlink",145 "//libc:write",146 ],147)148 149libc_test(150 name = "unlink_test",151 srcs = ["unlink_test.cpp"],152 deps = [153 "//libc:close",154 "//libc:open",155 "//libc:unlink",156 ],157)158 159libc_test(160 name = "getppid_test",161 srcs = ["getppid_test.cpp"],162 deps = [163 "//libc:getppid",164 ],165)166 167libc_test(168 name = "getuid_test",169 srcs = ["getuid_test.cpp"],170 deps = [171 "//libc:getuid",172 ],173)174 175libc_test(176 name = "isatty_test",177 srcs = ["isatty_test.cpp"],178 deps = [179 "//libc:close",180 "//libc:isatty",181 "//libc:open",182 ],183)184 185libc_test(186 name = "geteuid_test",187 srcs = ["geteuid_test.cpp"],188 deps = [189 "//libc:geteuid",190 ],191)192 193# TODO: add rules for functions modifying directories.194 195#TODO: Enable once fullbuild is added to bazel, since this depends on a macro196# definition in the public header197 198# libc_test(199# name = "syscall_test",200# srcs = ["syscall_test.cpp"],201# deps = [202# "//libc:syscall",203# ],204# )205 206# TODO: add once sysconf is complete207 208# libc_test(209# name = "sysconf_test",210# srcs = ["sysconf_test.cpp"],211# deps = [212# "//libc:sysconf",213# ],214# )215 216# TODO: add fopencookie and fflush217 218# libc_test(219# name = "getopt_test",220# srcs = ["getopt_test.cpp"],221# deps = [222# "//libc:__support_cpp_array",223# "//libc:getopt",224# "//libc:fopencookie",225# "//libc:fflush",226# ],227# )228